Index: tests/DeviceLooperTest.cpp |
diff --git a/tests/DeviceLooperTest.cpp b/tests/DeviceLooperTest.cpp |
index 5735043074d72b096d7dde04365404f3c0f71d34..1a51b5898038e7cb6e3cd1dfd58040188c0c4f91 100644 |
--- a/tests/DeviceLooperTest.cpp |
+++ b/tests/DeviceLooperTest.cpp |
@@ -9,9 +9,8 @@ |
#include "SkRasterClip.h" |
#include "Test.h" |
-static void make_bm(SkBitmap* bm, int w, int h) { |
- bm->allocPixels(SkImageInfo::Make(w, h, kAlpha_8_SkColorType, |
- kPremul_SkAlphaType)); |
+static void make_pm(SkAutoPixmapStorage* pixmap, int w, int h) { |
+ pixmap->alloc(SkImageInfo::Make(w, h, kAlpha_8_SkColorType, kPremul_SkAlphaType)); |
} |
static bool equal(const SkRasterClip& a, const SkRasterClip& b) { |
@@ -40,19 +39,19 @@ static const struct { |
static void test_simple(skiatest::Reporter* reporter) { |
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) { |
- SkBitmap bitmap; |
- make_bm(&bitmap, gRec[i].fDevSize.width(), gRec[i].fDevSize.height()); |
+ SkAutoPixmapStorage pmap; |
+ make_pm(&pmap, gRec[i].fDevSize.width(), gRec[i].fDevSize.height()); |
SkRasterClip rc(gRec[i].fRCBounds); |
for (int aa = 0; aa <= 1; ++aa) { |
- SkDeviceLooper looper(bitmap, rc, gRec[i].fRect, SkToBool(aa)); |
+ SkDeviceLooper looper(pmap, rc, gRec[i].fRect, SkToBool(aa)); |
bool valid = looper.next(); |
REPORTER_ASSERT(reporter, valid); |
if (valid) { |
- REPORTER_ASSERT(reporter, looper.getBitmap().width() == bitmap.width()); |
- REPORTER_ASSERT(reporter, looper.getBitmap().height() == bitmap.height()); |
+ REPORTER_ASSERT(reporter, looper.getPixmap().width() == pmap.width()); |
+ REPORTER_ASSERT(reporter, looper.getPixmap().height() == pmap.height()); |
REPORTER_ASSERT(reporter, equal(looper.getRC(), rc)); |
REPORTER_ASSERT(reporter, !looper.next()); |
@@ -62,7 +61,7 @@ static void test_simple(skiatest::Reporter* reporter) { |
{ |
SkIRect r = rc.getBounds(); |
r.offset(r.width(), 0); |
- SkDeviceLooper looper(bitmap, rc, r, false); |
+ SkDeviceLooper looper(pmap, rc, r, false); |
REPORTER_ASSERT(reporter, !looper.next()); |
} |
} |
@@ -109,8 +108,8 @@ static void test_complex(skiatest::Reporter* reporter) { |
const int w = gRec[i].fSize.width(); |
const int h = gRec[i].fSize.height(); |
- SkBitmap bitmap; |
- make_bm(&bitmap, w, h); |
+ SkAutoPixmapStorage pmap; |
+ make_pm(&pmap, w, h); |
const SkIRect rect = SkIRect::MakeWH(w, h); |
@@ -125,7 +124,7 @@ static void test_complex(skiatest::Reporter* reporter) { |
SkRasterClip rc; |
rc.op(rgn, SkRegion::kReplace_Op); |
- SkDeviceLooper looper(bitmap, rc, rect, gRec[i].fAA); |
+ SkDeviceLooper looper(pmap, rc, rect, gRec[i].fAA); |
while (looper.next()) { |
REPORTER_ASSERT(reporter, !looper.getRC().isEmpty()); |
} |