diff options
Diffstat (limited to 'libs/hwui/tests/unit/BitmapTests.cpp')
-rw-r--r-- | libs/hwui/tests/unit/BitmapTests.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/hwui/tests/unit/BitmapTests.cpp b/libs/hwui/tests/unit/BitmapTests.cpp index 8c7e08183a1e..ed689bd6f174 100644 --- a/libs/hwui/tests/unit/BitmapTests.cpp +++ b/libs/hwui/tests/unit/BitmapTests.cpp @@ -29,16 +29,15 @@ using namespace android::uirenderer; TEST(Bitmap, colorTableRefCounting) { const SkPMColor c[] = { SkPackARGB32(0x80, 0x80, 0, 0) }; - SkColorTable* ctable = new SkColorTable(c, SK_ARRAY_COUNT(c)); + sk_sp<SkColorTable> ctable = SkColorTable::Make(c, SK_ARRAY_COUNT(c)); SkBitmap* bm = new SkBitmap(); bm->allocPixels(SkImageInfo::Make(1, 1, kIndex_8_SkColorType, kPremul_SkAlphaType), - nullptr, ctable); + ctable); sk_sp<Bitmap> bitmap = Bitmap::allocateHeapBitmap(bm, ctable); EXPECT_FALSE(ctable->unique()); delete bm; bitmap.reset(); EXPECT_TRUE(ctable->unique()); - ctable->unref(); } |