blob: 83977952614234b6525edf84f592f69586983cf6 [file] [log] [blame]
robertphillipsb6c65e92016-02-04 10:52:42 -08001/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file
6 */
7
robertphillipsc5035e72016-03-17 06:58:39 -07008#include "SkAutoPixmapStorage.h"
robertphillipsb6c65e92016-02-04 10:52:42 -08009#include "SkBitmap.h"
10#include "SkCanvas.h"
11#include "SkImage.h"
robertphillipsc5035e72016-03-17 06:58:39 -070012#include "SkPixmap.h"
robertphillipsb6c65e92016-02-04 10:52:42 -080013#include "SkSpecialImage.h"
14#include "SkSpecialSurface.h"
robertphillipsb4bd11e2016-03-21 13:44:18 -070015#include "SkSurface.h"
robertphillipsb6c65e92016-02-04 10:52:42 -080016#include "Test.h"
17
18#if SK_SUPPORT_GPU
19#include "GrContext.h"
Robert Phillips1afd4cd2018-01-08 13:40:32 -050020#include "GrContextPriv.h"
Robert Phillips0bd24dc2018-01-16 08:06:32 -050021#include "GrProxyProvider.h"
Robert Phillips37430132016-11-09 06:50:43 -050022#include "GrSurfaceProxy.h"
Mike Reed84dd8572017-03-08 22:21:00 -050023#include "GrTextureProxy.h"
Brian Osman3b655982017-03-07 16:58:08 -050024#include "SkGr.h"
robertphillipsb6c65e92016-02-04 10:52:42 -080025#endif
26
robertphillipsb6c65e92016-02-04 10:52:42 -080027
28// This test creates backing resources exactly sized to [kFullSize x kFullSize].
29// It then wraps them in an SkSpecialImage with only the center (red) region being active.
30// It then draws the SkSpecialImage to a full sized (all blue) canvas and checks that none
31// of the inactive (green) region leaked out.
32
33static const int kSmallerSize = 10;
34static const int kPad = 3;
35static const int kFullSize = kSmallerSize + 2 * kPad;
36
37// Create a bitmap with red in the center and green around it
38static SkBitmap create_bm() {
39 SkBitmap bm;
40 bm.allocN32Pixels(kFullSize, kFullSize, true);
41
42 SkCanvas temp(bm);
43
44 temp.clear(SK_ColorGREEN);
45 SkPaint p;
46 p.setColor(SK_ColorRED);
47 p.setAntiAlias(false);
48
49 temp.drawRect(SkRect::MakeXYWH(SkIntToScalar(kPad), SkIntToScalar(kPad),
halcanary9d524f22016-03-29 09:03:52 -070050 SkIntToScalar(kSmallerSize), SkIntToScalar(kSmallerSize)),
robertphillipsb6c65e92016-02-04 10:52:42 -080051 p);
52
53 return bm;
54}
55
56// Basic test of the SkSpecialImage public API (e.g., peekTexture, peekPixels & draw)
robertphillips37bd7c32016-03-17 14:31:39 -070057static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* reporter,
Robert Phillips6de99042017-01-31 11:31:39 -050058 GrContext* context, bool isGPUBacked,
robertphillipsc5035e72016-03-17 06:58:39 -070059 int offset, int size) {
robertphillips3e302272016-04-20 11:48:36 -070060 const SkIRect subset = img->subset();
robertphillipsc5035e72016-03-17 06:58:39 -070061 REPORTER_ASSERT(reporter, offset == subset.left());
62 REPORTER_ASSERT(reporter, offset == subset.top());
robertphillipsb6c65e92016-02-04 10:52:42 -080063 REPORTER_ASSERT(reporter, kSmallerSize == subset.width());
64 REPORTER_ASSERT(reporter, kSmallerSize == subset.height());
65
66 //--------------
Robert Phillips2c6d2bf2017-02-21 10:19:29 -050067 // Test that isTextureBacked reports the correct backing type
Robert Phillips6de99042017-01-31 11:31:39 -050068 REPORTER_ASSERT(reporter, isGPUBacked == img->isTextureBacked());
robertphillips64612512016-04-08 12:10:42 -070069
70#if SK_SUPPORT_GPU
71 //--------------
Robert Phillips8e1c4e62017-02-19 12:27:01 -050072 // Test asTextureProxyRef - as long as there is a context this should succeed
robertphillips64612512016-04-08 12:10:42 -070073 if (context) {
Robert Phillips8e1c4e62017-02-19 12:27:01 -050074 sk_sp<GrTextureProxy> proxy(img->asTextureProxyRef(context));
75 REPORTER_ASSERT(reporter, proxy);
robertphillips64612512016-04-08 12:10:42 -070076 }
77#endif
robertphillipsb6c65e92016-02-04 10:52:42 -080078
79 //--------------
robertphillips64612512016-04-08 12:10:42 -070080 // Test getROPixels - this should always succeed regardless of backing store
81 SkBitmap bitmap;
82 REPORTER_ASSERT(reporter, img->getROPixels(&bitmap));
robertphillipsed086ca2016-04-26 15:02:25 -070083 if (context) {
84 REPORTER_ASSERT(reporter, kSmallerSize == bitmap.width());
85 REPORTER_ASSERT(reporter, kSmallerSize == bitmap.height());
86 } else {
87 REPORTER_ASSERT(reporter, size == bitmap.width());
88 REPORTER_ASSERT(reporter, size == bitmap.height());
89 }
robertphillipsb6c65e92016-02-04 10:52:42 -080090
91 //--------------
robertphillipsb4bd11e2016-03-21 13:44:18 -070092 // Test that draw restricts itself to the subset
brianosmaneed6b0e2016-09-23 13:04:05 -070093 SkImageFilter::OutputProperties outProps(img->getColorSpace());
94 sk_sp<SkSpecialSurface> surf(img->makeSurface(outProps, SkISize::Make(kFullSize, kFullSize),
Matt Sarettcb6266b2017-01-17 10:48:53 -050095 kPremul_SkAlphaType));
robertphillipsb6c65e92016-02-04 10:52:42 -080096
97 SkCanvas* canvas = surf->getCanvas();
98
99 canvas->clear(SK_ColorBLUE);
robertphillipse8c34972016-02-16 12:09:36 -0800100 img->draw(canvas, SkIntToScalar(kPad), SkIntToScalar(kPad), nullptr);
robertphillipsb6c65e92016-02-04 10:52:42 -0800101
102 SkBitmap bm;
Matt Sarettcb6266b2017-01-17 10:48:53 -0500103 bm.allocN32Pixels(kFullSize, kFullSize, false);
robertphillipsb6c65e92016-02-04 10:52:42 -0800104
105 bool result = canvas->readPixels(bm.info(), bm.getPixels(), bm.rowBytes(), 0, 0);
106 SkASSERT_RELEASE(result);
107
108 // Only the center (red) portion should've been drawn into the canvas
109 REPORTER_ASSERT(reporter, SK_ColorBLUE == bm.getColor(kPad-1, kPad-1));
110 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(kPad, kPad));
111 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(kSmallerSize+kPad-1,
112 kSmallerSize+kPad-1));
113 REPORTER_ASSERT(reporter, SK_ColorBLUE == bm.getColor(kSmallerSize+kPad,
114 kSmallerSize+kPad));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700115
116 //--------------
Robert Phillipsa5fdc972017-02-18 16:58:09 -0500117 // Test that asImage & makeTightSurface return appropriately sized objects
robertphillipsb4bd11e2016-03-21 13:44:18 -0700118 // of the correct backing type
119 SkIRect newSubset = SkIRect::MakeWH(subset.width(), subset.height());
120 {
Robert Phillipsa5fdc972017-02-18 16:58:09 -0500121 sk_sp<SkImage> tightImg(img->asImage(&newSubset));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700122
123 REPORTER_ASSERT(reporter, tightImg->width() == subset.width());
124 REPORTER_ASSERT(reporter, tightImg->height() == subset.height());
Robert Phillips0ae6faa2017-03-21 16:22:00 -0400125 REPORTER_ASSERT(reporter, isGPUBacked == tightImg->isTextureBacked());
robertphillipsb4bd11e2016-03-21 13:44:18 -0700126 SkPixmap tmpPixmap;
Robert Phillips6de99042017-01-31 11:31:39 -0500127 REPORTER_ASSERT(reporter, isGPUBacked != !!tightImg->peekPixels(&tmpPixmap));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700128 }
129 {
brianosmaneed6b0e2016-09-23 13:04:05 -0700130 SkImageFilter::OutputProperties outProps(img->getColorSpace());
131 sk_sp<SkSurface> tightSurf(img->makeTightSurface(outProps, subset.size()));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700132
133 REPORTER_ASSERT(reporter, tightSurf->width() == subset.width());
134 REPORTER_ASSERT(reporter, tightSurf->height() == subset.height());
Robert Phillips6de99042017-01-31 11:31:39 -0500135 REPORTER_ASSERT(reporter, isGPUBacked ==
robertphillipsb4bd11e2016-03-21 13:44:18 -0700136 !!tightSurf->getTextureHandle(SkSurface::kDiscardWrite_BackendHandleAccess));
137 SkPixmap tmpPixmap;
Robert Phillips6de99042017-01-31 11:31:39 -0500138 REPORTER_ASSERT(reporter, isGPUBacked != !!tightSurf->peekPixels(&tmpPixmap));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700139 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800140}
141
142DEF_TEST(SpecialImage_Raster, reporter) {
143 SkBitmap bm = create_bm();
144
robertphillips37bd7c32016-03-17 14:31:39 -0700145 sk_sp<SkSpecialImage> fullSImage(SkSpecialImage::MakeFromRaster(
robertphillipsc5035e72016-03-17 06:58:39 -0700146 SkIRect::MakeWH(kFullSize, kFullSize),
147 bm));
148
robertphillipsb6c65e92016-02-04 10:52:42 -0800149 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
150
robertphillipsc5035e72016-03-17 06:58:39 -0700151 {
robertphillips3e302272016-04-20 11:48:36 -0700152 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeFromRaster(subset, bm));
robertphillips64612512016-04-08 12:10:42 -0700153 test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700154 }
155
156 {
robertphillips37bd7c32016-03-17 14:31:39 -0700157 sk_sp<SkSpecialImage> subSImg2(fullSImage->makeSubset(subset));
robertphillips64612512016-04-08 12:10:42 -0700158 test_image(subSImg2, reporter, nullptr, false, 0, kSmallerSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700159 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800160}
161
Brian Osman61624f02016-12-09 14:51:59 -0500162static void test_specialimage_image(skiatest::Reporter* reporter, SkColorSpace* dstColorSpace) {
robertphillipsb6c65e92016-02-04 10:52:42 -0800163 SkBitmap bm = create_bm();
164
reed9ce9d672016-03-17 10:51:11 -0700165 sk_sp<SkImage> fullImage(SkImage::MakeFromBitmap(bm));
robertphillipsb6c65e92016-02-04 10:52:42 -0800166
robertphillips37bd7c32016-03-17 14:31:39 -0700167 sk_sp<SkSpecialImage> fullSImage(SkSpecialImage::MakeFromImage(
robertphillipsc5035e72016-03-17 06:58:39 -0700168 SkIRect::MakeWH(kFullSize, kFullSize),
Brian Osman61624f02016-12-09 14:51:59 -0500169 fullImage, dstColorSpace));
robertphillipsc5035e72016-03-17 06:58:39 -0700170
robertphillipsb6c65e92016-02-04 10:52:42 -0800171 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
172
robertphillipsc5035e72016-03-17 06:58:39 -0700173 {
Brian Osman61624f02016-12-09 14:51:59 -0500174 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeFromImage(subset, fullImage,
175 dstColorSpace));
robertphillipsed086ca2016-04-26 15:02:25 -0700176 test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700177 }
178
179 {
robertphillips37bd7c32016-03-17 14:31:39 -0700180 sk_sp<SkSpecialImage> subSImg2(fullSImage->makeSubset(subset));
robertphillipsed086ca2016-04-26 15:02:25 -0700181 test_image(subSImg2, reporter, nullptr, false, 0, kSmallerSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700182 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800183}
184
Brian Osman7992da32016-11-18 11:28:24 -0500185DEF_TEST(SpecialImage_Image_Legacy, reporter) {
Brian Osman61624f02016-12-09 14:51:59 -0500186 SkColorSpace* legacyColorSpace = nullptr;
187 test_specialimage_image(reporter, legacyColorSpace);
Brian Osman7992da32016-11-18 11:28:24 -0500188}
189
190DEF_TEST(SpecialImage_Image_ColorSpaceAware, reporter) {
Matt Sarett77a7a1b2017-02-07 13:56:11 -0500191 sk_sp<SkColorSpace> srgbColorSpace = SkColorSpace::MakeSRGB();
Brian Osman61624f02016-12-09 14:51:59 -0500192 test_specialimage_image(reporter, srgbColorSpace.get());
Brian Osman7992da32016-11-18 11:28:24 -0500193}
194
robertphillipsb6c65e92016-02-04 10:52:42 -0800195#if SK_SUPPORT_GPU
robertphillips83c17fa2016-03-18 08:14:27 -0700196
197static void test_texture_backed(skiatest::Reporter* reporter,
198 const sk_sp<SkSpecialImage>& orig,
199 const sk_sp<SkSpecialImage>& gpuBacked) {
200 REPORTER_ASSERT(reporter, gpuBacked);
robertphillips64612512016-04-08 12:10:42 -0700201 REPORTER_ASSERT(reporter, gpuBacked->isTextureBacked());
robertphillips83c17fa2016-03-18 08:14:27 -0700202 REPORTER_ASSERT(reporter, gpuBacked->uniqueID() == orig->uniqueID());
203 REPORTER_ASSERT(reporter, gpuBacked->subset().width() == orig->subset().width() &&
204 gpuBacked->subset().height() == orig->subset().height());
brianosmanafbf71d2016-07-21 07:15:37 -0700205 REPORTER_ASSERT(reporter, gpuBacked->getColorSpace() == orig->getColorSpace());
robertphillips83c17fa2016-03-18 08:14:27 -0700206}
207
208// Test out the SkSpecialImage::makeTextureImage entry point
bsalomon68d91342016-04-12 09:59:58 -0700209DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_MakeTexture, reporter, ctxInfo) {
bsalomon8b7451a2016-05-11 06:33:06 -0700210 GrContext* context = ctxInfo.grContext();
Robert Phillips0bd24dc2018-01-16 08:06:32 -0500211 GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
robertphillips83c17fa2016-03-18 08:14:27 -0700212 SkBitmap bm = create_bm();
213
214 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
215
216 {
217 // raster
218 sk_sp<SkSpecialImage> rasterImage(SkSpecialImage::MakeFromRaster(
robertphillips83c17fa2016-03-18 08:14:27 -0700219 SkIRect::MakeWH(kFullSize,
220 kFullSize),
221 bm));
222
223 {
robertphillips3e302272016-04-20 11:48:36 -0700224 sk_sp<SkSpecialImage> fromRaster(rasterImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700225 test_texture_backed(reporter, rasterImage, fromRaster);
226 }
227
228 {
229 sk_sp<SkSpecialImage> subRasterImage(rasterImage->makeSubset(subset));
230
robertphillips3e302272016-04-20 11:48:36 -0700231 sk_sp<SkSpecialImage> fromSubRaster(subRasterImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700232 test_texture_backed(reporter, subRasterImage, fromSubRaster);
233 }
234 }
235
236 {
237 // gpu
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500238 const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
robertphillips83c17fa2016-03-18 08:14:27 -0700239
Robert Phillips0bd24dc2018-01-16 08:06:32 -0500240 sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(
Brian Salomon58389b92018-03-07 13:01:25 -0500241 desc, SkBudgeted::kNo, bm.getPixels(), bm.rowBytes());
Robert Phillips2f493142017-03-02 18:18:38 -0500242 if (!proxy) {
robertphillips83c17fa2016-03-18 08:14:27 -0700243 return;
244 }
245
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500246 sk_sp<SkSpecialImage> gpuImage(SkSpecialImage::MakeDeferredFromGpu(
Robert Phillips2f493142017-03-02 18:18:38 -0500247 context,
248 SkIRect::MakeWH(kFullSize, kFullSize),
249 kNeedNewImageUniqueID_SpecialImage,
250 std::move(proxy), nullptr));
robertphillips83c17fa2016-03-18 08:14:27 -0700251
252 {
robertphillips3e302272016-04-20 11:48:36 -0700253 sk_sp<SkSpecialImage> fromGPU(gpuImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700254 test_texture_backed(reporter, gpuImage, fromGPU);
255 }
256
257 {
258 sk_sp<SkSpecialImage> subGPUImage(gpuImage->makeSubset(subset));
259
robertphillips3e302272016-04-20 11:48:36 -0700260 sk_sp<SkSpecialImage> fromSubGPU(subGPUImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700261 test_texture_backed(reporter, subGPUImage, fromSubGPU);
262 }
263 }
264}
265
bsalomon68d91342016-04-12 09:59:58 -0700266DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_Gpu, reporter, ctxInfo) {
bsalomon8b7451a2016-05-11 06:33:06 -0700267 GrContext* context = ctxInfo.grContext();
Robert Phillips0bd24dc2018-01-16 08:06:32 -0500268 GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
robertphillipsb6c65e92016-02-04 10:52:42 -0800269 SkBitmap bm = create_bm();
270
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500271 const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
robertphillipsb6c65e92016-02-04 10:52:42 -0800272
Brian Salomon58389b92018-03-07 13:01:25 -0500273 sk_sp<GrTextureProxy> proxy =
274 proxyProvider->createTextureProxy(desc, SkBudgeted::kNo, bm.getPixels(), bm.rowBytes());
Robert Phillips2f493142017-03-02 18:18:38 -0500275 if (!proxy) {
robertphillipsb6c65e92016-02-04 10:52:42 -0800276 return;
277 }
278
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500279 sk_sp<SkSpecialImage> fullSImg(SkSpecialImage::MakeDeferredFromGpu(
280 context,
robertphillipsc5035e72016-03-17 06:58:39 -0700281 SkIRect::MakeWH(kFullSize, kFullSize),
282 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500283 proxy, nullptr));
robertphillipsc5035e72016-03-17 06:58:39 -0700284
robertphillipsb6c65e92016-02-04 10:52:42 -0800285 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
286
robertphillipsc5035e72016-03-17 06:58:39 -0700287 {
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500288 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu(
Robert Phillips2f493142017-03-02 18:18:38 -0500289 context, subset,
robertphillipsc5035e72016-03-17 06:58:39 -0700290 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500291 std::move(proxy), nullptr));
robertphillipsed086ca2016-04-26 15:02:25 -0700292 test_image(subSImg1, reporter, context, true, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700293 }
294
295 {
robertphillips37bd7c32016-03-17 14:31:39 -0700296 sk_sp<SkSpecialImage> subSImg2(fullSImg->makeSubset(subset));
robertphillipsed086ca2016-04-26 15:02:25 -0700297 test_image(subSImg2, reporter, context, true, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700298 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800299}
300
Robert Phillips8bc06d02016-11-01 17:28:40 -0400301DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo) {
302 GrContext* context = ctxInfo.grContext();
Robert Phillips0bd24dc2018-01-16 08:06:32 -0500303 GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
Robert Phillips8bc06d02016-11-01 17:28:40 -0400304 SkBitmap bm = create_bm();
305
306 GrSurfaceDesc desc;
Robert Phillips96be9df2017-07-21 14:17:45 +0000307 desc.fFlags = kNone_GrSurfaceFlags;
Robert Phillips8bc06d02016-11-01 17:28:40 -0400308 desc.fWidth = kFullSize;
309 desc.fHeight = kFullSize;
Robert Phillips16d8ec62017-07-27 16:16:25 -0400310 desc.fConfig = kSkia8888_GrPixelConfig;
Robert Phillips8bc06d02016-11-01 17:28:40 -0400311
Brian Salomon58389b92018-03-07 13:01:25 -0500312 sk_sp<GrTextureProxy> proxy =
313 proxyProvider->createTextureProxy(desc, SkBudgeted::kNo, bm.getPixels(), bm.rowBytes());
Robert Phillips8bc06d02016-11-01 17:28:40 -0400314 if (!proxy) {
315 return;
316 }
317
318 sk_sp<SkSpecialImage> fullSImg(SkSpecialImage::MakeDeferredFromGpu(
319 context,
320 SkIRect::MakeWH(kFullSize, kFullSize),
321 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500322 proxy, nullptr));
Robert Phillips8bc06d02016-11-01 17:28:40 -0400323
324 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
325
326 {
327 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu(
Robert Phillips2f493142017-03-02 18:18:38 -0500328 context, subset,
Robert Phillips8bc06d02016-11-01 17:28:40 -0400329 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500330 std::move(proxy), nullptr));
Robert Phillips8bc06d02016-11-01 17:28:40 -0400331 test_image(subSImg1, reporter, context, true, kPad, kFullSize);
332 }
333
334 {
335 sk_sp<SkSpecialImage> subSImg2(fullSImg->makeSubset(subset));
336 test_image(subSImg2, reporter, context, true, kPad, kFullSize);
337 }
338}
339
robertphillipsb6c65e92016-02-04 10:52:42 -0800340#endif