use of com.bumptech.glide.load.ImageHeaderParser 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<ImageHeaderParser>();
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.ImageHeaderParser in project glide by bumptech.
the class DownsamplerTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
options = new Options();
DisplayMetrics displayMetrics = RuntimeEnvironment.application.getResources().getDisplayMetrics();
when(byteArrayPool.get(anyInt(), Matchers.eq(byte[].class))).thenReturn(new byte[ArrayPool.STANDARD_BUFFER_SIZE_BYTES]);
List<ImageHeaderParser> parsers = new ArrayList<ImageHeaderParser>();
parsers.add(new DefaultImageHeaderParser());
downsampler = new Downsampler(parsers, displayMetrics, bitmapPool, byteArrayPool);
initialSdkVersion = Build.VERSION.SDK_INT;
}
use of com.bumptech.glide.load.ImageHeaderParser in project glide by bumptech.
the class StreamGifDecoderTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
List<ImageHeaderParser> parsers = new ArrayList<ImageHeaderParser>();
parsers.add(new DefaultImageHeaderParser());
decoder = new StreamGifDecoder(parsers, byteBufferDecoder, new LruArrayPool());
options = new Options();
}
Aggregations