use of com.bumptech.glide.load.Options in project glide by bumptech.
the class DecodeJob method runLoadPath.
private <Data, ResourceType> Resource<R> runLoadPath(Data data, DataSource dataSource, LoadPath<Data, ResourceType, R> path) throws GlideException {
Options options = getOptionsWithHardwareConfig(dataSource);
DataRewinder<Data> rewinder = glideContext.getRegistry().getRewinder(data);
try {
// ResourceType in DecodeCallback below is required for compilation to work with gradle.
return path.load(rewinder, options, width, height, new DecodeCallback<ResourceType>(dataSource));
} finally {
rewinder.cleanup();
}
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class VideoDecoderTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
when(factory.build()).thenReturn(retriever);
decoder = new VideoDecoder<>(bitmapPool, initializer, factory);
options = new Options();
initialSdkVersion = Build.VERSION.SDK_INT;
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class ByteBufferGifDecoderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
gifHeader = Mockito.spy(new GifHeader());
when(parser.parseHeader()).thenReturn(gifHeader);
when(parserPool.obtain(isA(ByteBuffer.class))).thenReturn(parser);
when(decoderFactory.build(isA(GifDecoder.BitmapProvider.class), eq(gifHeader), isA(ByteBuffer.class), anyInt())).thenReturn(gifDecoder);
List<ImageHeaderParser> parsers = new ArrayList<>();
parsers.add(new DefaultImageHeaderParser());
options = new Options();
decoder = new ByteBufferGifDecoder(RuntimeEnvironment.application, parsers, bitmapPool, new LruArrayPool(ARRAY_POOL_SIZE_BYTES), parserPool, decoderFactory);
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class GifFrameResourceDecoderTest method setUp.
@Before
public void setUp() {
gifDecoder = mock(GifDecoder.class);
resourceDecoder = new GifFrameResourceDecoder(mock(BitmapPool.class));
options = new Options();
}
use of com.bumptech.glide.load.Options in project glide by bumptech.
the class BitmapDrawableTranscoderTest method testReturnsBitmapDrawableResourceContainingGivenBitmap.
@Test
public void testReturnsBitmapDrawableResourceContainingGivenBitmap() {
Bitmap expected = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
Resource<Bitmap> resource = mockResource();
when(resource.get()).thenReturn(expected);
Resource<BitmapDrawable> transcoded = transcoder.transcode(resource, new Options());
assertEquals(expected, transcoded.get().getBitmap());
}
Aggregations