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

Unified Diff: tests/SpecialImageTest.cpp

Issue 1921393003: Revert of Remove gpu-specialization of SkSpecialImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/core/SkSpecialImage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SpecialImageTest.cpp
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index 7ab7cfc4ce17ef228d933cc0ffa7bc8b48316c2d..f5174478ef27e672adbb439918b9cb63c33d8f83 100644
--- a/tests/SpecialImageTest.cpp
+++ b/tests/SpecialImageTest.cpp
@@ -75,8 +75,13 @@
// Test getROPixels - this should always succeed regardless of backing store
SkBitmap bitmap;
REPORTER_ASSERT(reporter, img->getROPixels(&bitmap));
- REPORTER_ASSERT(reporter, size == bitmap.width());
- REPORTER_ASSERT(reporter, size == bitmap.height());
+ if (context) {
+ REPORTER_ASSERT(reporter, kSmallerSize == bitmap.width());
+ REPORTER_ASSERT(reporter, kSmallerSize == bitmap.height());
+ } else {
+ REPORTER_ASSERT(reporter, size == bitmap.width());
+ REPORTER_ASSERT(reporter, size == bitmap.height());
+ }
//--------------
// Test that draw restricts itself to the subset
@@ -163,12 +168,12 @@
{
sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeFromImage(subset, fullImage));
- test_image(subSImg1, reporter, nullptr, false, kPad, kSmallerSize);
+ test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize);
}
{
sk_sp<SkSpecialImage> subSImg2(fullSImage->makeSubset(subset));
- test_image(subSImg2, reporter, nullptr, false, kPad, kSmallerSize);
+ test_image(subSImg2, reporter, nullptr, false, 0, kSmallerSize);
}
}
@@ -295,12 +300,12 @@
subset,
kNeedNewImageUniqueID_SpecialImage,
texture));
- test_image(subSImg1, reporter, context, true, kPad, kSmallerSize);
+ test_image(subSImg1, reporter, context, true, kPad, kFullSize);
}
{
sk_sp<SkSpecialImage> subSImg2(fullSImg->makeSubset(subset));
- test_image(subSImg2, reporter, context, true, kPad, kSmallerSize);
+ test_image(subSImg2, reporter, context, true, kPad, kFullSize);
}
}
« no previous file with comments | « src/core/SkSpecialImage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698