Revert of Remove gpu-specialization of SkSpecialImage (patchset #5 id:80001 of https://codereview.chromium.org/1918993002/ )
Reason for revert:
N6 bot has gone red
Original issue's description:
> Remove gpu-specialization of SkSpecialImage
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1918993002
>
> Committed: https://skia.googlesource.com/skia/+/0533d6e4142c2787d6d3c325ef0d8d1962292cad
TBR=reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1921393003
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index 7ab7cfc..f517447 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);
}
}