diff options
author | 2016-02-18 08:48:03 -0800 | |
---|---|---|
committer | 2016-02-18 08:48:04 -0800 | |
commit | 3b087f4010327b304242aaf27ef3689150dfc226 (patch) | |
tree | 53c0d5533e8f7d566f115dfdf0fe80a388c7c08e /tests/SpecialSurfaceTest.cpp | |
parent | 4528c867c4ba65fdf5cfd6de35ea4c36a16c73f6 (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/SpecialSurfaceTest.cpp')
-rw-r--r-- | tests/SpecialSurfaceTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp index b1cbf68082..580d2ddc87 100644 --- a/tests/SpecialSurfaceTest.cpp +++ b/tests/SpecialSurfaceTest.cpp @@ -59,7 +59,7 @@ static void test_surface(SkSpecialSurface* surf, skiatest::Reporter* reporter, i DEF_TEST(SpecialSurface_Raster, reporter) { SkImageInfo info = SkImageInfo::MakeN32(kSmallerSize, kSmallerSize, kOpaque_SkAlphaType); - SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewRaster(info)); + SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewRaster(nullptr, info)); test_surface(surf, reporter, 0); } @@ -71,7 +71,7 @@ DEF_TEST(SpecialSurface_Raster2, reporter) { const SkIRect subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); - SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewFromBitmap(subset, bm)); + SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewFromBitmap(nullptr, subset, bm)); test_surface(surf, reporter, kPad); @@ -87,7 +87,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, context) { desc.fWidth = kSmallerSize; desc.fHeight = kSmallerSize; - SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewRenderTarget(context, desc)); + SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewRenderTarget(nullptr, context, desc)); test_surface(surf, reporter, 0); } @@ -105,7 +105,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu2, reporter, context) { const SkIRect subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize); - SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewFromTexture(subset, temp)); + SkAutoTUnref<SkSpecialSurface> surf(SkSpecialSurface::NewFromTexture(nullptr, subset, temp)); test_surface(surf, reporter, kPad); |