Search in sources :

Example 1 with CanonicalBitmap

use of com.bumptech.glide.test.CanonicalBitmap in project glide by bumptech.

the class FitCenterRegressionTest method setUp.

@Before
public void setUp() {
    context = InstrumentationRegistry.getTargetContext();
    bitmapRegressionTester = new BitmapRegressionTester(getClass(), testName);
    canonical = new CanonicalBitmap();
}
Also used : BitmapRegressionTester(com.bumptech.glide.test.BitmapRegressionTester) CanonicalBitmap(com.bumptech.glide.test.CanonicalBitmap) Before(org.junit.Before)

Example 2 with CanonicalBitmap

use of com.bumptech.glide.test.CanonicalBitmap in project glide by bumptech.

the class CenterInsideRegressionTest method setUp.

@Before
public void setUp() {
    context = InstrumentationRegistry.getTargetContext();
    bitmapRegressionTester = new BitmapRegressionTester(getClass(), testName);
    canonical = new CanonicalBitmap();
}
Also used : BitmapRegressionTester(com.bumptech.glide.test.BitmapRegressionTester) CanonicalBitmap(com.bumptech.glide.test.CanonicalBitmap) Before(org.junit.Before)

Example 3 with CanonicalBitmap

use of com.bumptech.glide.test.CanonicalBitmap in project glide by bumptech.

the class RoundedCornersRegressionTest method testRoundedCorners_usePool.

@Test
public void testRoundedCorners_usePool() throws ExecutionException, InterruptedException {
    canonicalBitmap = canonicalBitmap.scale(0.1f);
    Bitmap redRect = createRect(Color.RED, canonicalBitmap.getWidth(), canonicalBitmap.getHeight(), Bitmap.Config.ARGB_8888);
    Glide.get(context).getBitmapPool().put(redRect);
    Bitmap roundedRect = bitmapRegressionTester.test(GlideApp.with(context).asBitmap().load(canonicalBitmap.getBitmap()).override(canonicalBitmap.getWidth(), canonicalBitmap.getHeight()).transform(new RoundedCorners(5)));
    assertThat(roundedRect).isEqualTo(redRect);
}
Also used : CanonicalBitmap(com.bumptech.glide.test.CanonicalBitmap) Bitmap(android.graphics.Bitmap) RoundedCorners(com.bumptech.glide.load.resource.bitmap.RoundedCorners) RegressionTest(com.bumptech.glide.test.RegressionTest) Test(org.junit.Test)

Example 4 with CanonicalBitmap

use of com.bumptech.glide.test.CanonicalBitmap in project glide by bumptech.

the class RoundedCornersRegressionTest method setUp.

@Before
public void setUp() throws Exception {
    context = InstrumentationRegistry.getTargetContext();
    bitmapRegressionTester = new BitmapRegressionTester(getClass(), testName);
    canonicalBitmap = new CanonicalBitmap();
}
Also used : BitmapRegressionTester(com.bumptech.glide.test.BitmapRegressionTester) CanonicalBitmap(com.bumptech.glide.test.CanonicalBitmap) Before(org.junit.Before)

Example 5 with CanonicalBitmap

use of com.bumptech.glide.test.CanonicalBitmap in project glide by bumptech.

the class CenterCropRegressionTest method setUp.

@Before
public void setUp() {
    context = InstrumentationRegistry.getTargetContext();
    bitmapRegressionTester = new BitmapRegressionTester(getClass(), testName);
    canonical = new CanonicalBitmap();
}
Also used : BitmapRegressionTester(com.bumptech.glide.test.BitmapRegressionTester) CanonicalBitmap(com.bumptech.glide.test.CanonicalBitmap) Before(org.junit.Before)

Aggregations

CanonicalBitmap (com.bumptech.glide.test.CanonicalBitmap)6 BitmapRegressionTester (com.bumptech.glide.test.BitmapRegressionTester)5 Before (org.junit.Before)5 Bitmap (android.graphics.Bitmap)1 RoundedCorners (com.bumptech.glide.load.resource.bitmap.RoundedCorners)1 RegressionTest (com.bumptech.glide.test.RegressionTest)1 Test (org.junit.Test)1