aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SpecialImageTest.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-02-18 08:48:03 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-18 08:48:04 -0800
commit3b087f4010327b304242aaf27ef3689150dfc226 (patch)
tree53c0d5533e8f7d566f115dfdf0fe80a388c7c08e /tests/SpecialImageTest.cpp
parent4528c867c4ba65fdf5cfd6de35ea4c36a16c73f6 (diff)
Update SkSpecialImage API
This adds some temporary compatibility features: internal_getBM & internal_fromBM - to convert back & forth from Bitmaps in the ImageFilters internal_getProxy - to allow the special images to interface with the current ImagerFilter system It also adds a unique ID, opaque flag and size method. The unique ID and size method are needed for the image filter's caching system. The opaque flag is need for swapping back & forth from Bitmaps These are all calved off of https://codereview.chromium.org/1695823002/ (Get OffsetImageFilter really working with SkSpecialImages) which actually makes use of them. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1705113002 Review URL: https://codereview.chromium.org/1705113002
Diffstat (limited to 'tests/SpecialImageTest.cpp')
-rw-r--r--tests/SpecialImageTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index bc770a0ddc..049453d302 100644
--- a/tests/SpecialImageTest.cpp
+++ b/tests/SpecialImageTest.cpp
@@ -110,7 +110,7 @@ DEF_TEST(SpecialImage_Raster, reporter) {
const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
- SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromRaster(subset, bm));
+ SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromRaster(nullptr, subset, bm));
test_image(img, reporter, true, false);
}
@@ -143,7 +143,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, context) {
const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
- SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromGpu(subset, texture));
+ SkAutoTUnref<SkSpecialImage> img(SkSpecialImage::NewFromGpu(nullptr, subset,
+ kNeedNewImageUniqueID_SpecialImage,
+ texture));
test_image(img, reporter, false, true);
}