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

Unified Diff: tests/DeviceLooperTest.cpp

Issue 1164373003: Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/TextureCompressionTest.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 1a51b5898038e7cb6e3cd1dfd58040188c0c4f91..5735043074d72b096d7dde04365404f3c0f71d34 100644
--- a/tests/DeviceLooperTest.cpp
+++ b/tests/DeviceLooperTest.cpp
@@ -9,8 +9,9 @@
#include "SkRasterClip.h"
#include "Test.h"
-static void make_pm(SkAutoPixmapStorage* pixmap, int w, int h) {
- pixmap->alloc(SkImageInfo::Make(w, h, kAlpha_8_SkColorType, kPremul_SkAlphaType));
+static void make_bm(SkBitmap* bm, int w, int h) {
+ bm->allocPixels(SkImageInfo::Make(w, h, kAlpha_8_SkColorType,
+ kPremul_SkAlphaType));
}
static bool equal(const SkRasterClip& a, const SkRasterClip& b) {
@@ -39,19 +40,19 @@
static void test_simple(skiatest::Reporter* reporter) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
- SkAutoPixmapStorage pmap;
- make_pm(&pmap, gRec[i].fDevSize.width(), gRec[i].fDevSize.height());
+ SkBitmap bitmap;
+ make_bm(&bitmap, gRec[i].fDevSize.width(), gRec[i].fDevSize.height());
SkRasterClip rc(gRec[i].fRCBounds);
for (int aa = 0; aa <= 1; ++aa) {
- SkDeviceLooper looper(pmap, rc, gRec[i].fRect, SkToBool(aa));
+ SkDeviceLooper looper(bitmap, rc, gRec[i].fRect, SkToBool(aa));
bool valid = looper.next();
REPORTER_ASSERT(reporter, valid);
if (valid) {
- REPORTER_ASSERT(reporter, looper.getPixmap().width() == pmap.width());
- REPORTER_ASSERT(reporter, looper.getPixmap().height() == pmap.height());
+ REPORTER_ASSERT(reporter, looper.getBitmap().width() == bitmap.width());
+ REPORTER_ASSERT(reporter, looper.getBitmap().height() == bitmap.height());
REPORTER_ASSERT(reporter, equal(looper.getRC(), rc));
REPORTER_ASSERT(reporter, !looper.next());
@@ -61,7 +62,7 @@
{
SkIRect r = rc.getBounds();
r.offset(r.width(), 0);
- SkDeviceLooper looper(pmap, rc, r, false);
+ SkDeviceLooper looper(bitmap, rc, r, false);
REPORTER_ASSERT(reporter, !looper.next());
}
}
@@ -108,8 +109,8 @@
const int w = gRec[i].fSize.width();
const int h = gRec[i].fSize.height();
- SkAutoPixmapStorage pmap;
- make_pm(&pmap, w, h);
+ SkBitmap bitmap;
+ make_bm(&bitmap, w, h);
const SkIRect rect = SkIRect::MakeWH(w, h);
@@ -124,7 +125,7 @@
SkRasterClip rc;
rc.op(rgn, SkRegion::kReplace_Op);
- SkDeviceLooper looper(pmap, rc, rect, gRec[i].fAA);
+ SkDeviceLooper looper(bitmap, 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/TextureCompressionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698