aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/DeviceLooperTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-06-08 10:47:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-08 10:47:13 -0700
commitc31af44336f5eb4a50e83e76e51962d46c3ed458 (patch)
tree244dcbfbeb638de8da65980dd59707ee323c5d24 /tests/DeviceLooperTest.cpp
parent77dcbdeb19d26e52428e392fca0ec9a72658b746 (diff)
change SkDraw and all Blitters to use pixmap instead of bitmap
Diffstat (limited to 'tests/DeviceLooperTest.cpp')
-rw-r--r--tests/DeviceLooperTest.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/DeviceLooperTest.cpp b/tests/DeviceLooperTest.cpp
index 5735043074..1a51b58980 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());
}