Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: tests/DeviceLooperTest.cpp

Issue 1168303006: Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox to new test Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkTextureCompressor_Blitter.h ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/utils/SkTextureCompressor_Blitter.h ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698