blob: 6dfcfc4bd32546176b94c7b46704371921813a9b [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 Phillips37430132016-11-09 06:50:43 -050021#include "GrSurfaceProxy.h"
Mike Reed84dd8572017-03-08 22:21:00 -050022#include "GrTextureProxy.h"
Brian Osman3b655982017-03-07 16:58:08 -050023#include "SkGr.h"
robertphillipsb6c65e92016-02-04 10:52:42 -080024#endif
25
robertphillipsb6c65e92016-02-04 10:52:42 -080026
27// This test creates backing resources exactly sized to [kFullSize x kFullSize].
28// It then wraps them in an SkSpecialImage with only the center (red) region being active.
29// It then draws the SkSpecialImage to a full sized (all blue) canvas and checks that none
30// of the inactive (green) region leaked out.
31
32static const int kSmallerSize = 10;
33static const int kPad = 3;
34static const int kFullSize = kSmallerSize + 2 * kPad;
35
36// Create a bitmap with red in the center and green around it
37static SkBitmap create_bm() {
38 SkBitmap bm;
39 bm.allocN32Pixels(kFullSize, kFullSize, true);
40
41 SkCanvas temp(bm);
42
43 temp.clear(SK_ColorGREEN);
44 SkPaint p;
45 p.setColor(SK_ColorRED);
46 p.setAntiAlias(false);
47
48 temp.drawRect(SkRect::MakeXYWH(SkIntToScalar(kPad), SkIntToScalar(kPad),
halcanary9d524f22016-03-29 09:03:52 -070049 SkIntToScalar(kSmallerSize), SkIntToScalar(kSmallerSize)),
robertphillipsb6c65e92016-02-04 10:52:42 -080050 p);
51
52 return bm;
53}
54
55// Basic test of the SkSpecialImage public API (e.g., peekTexture, peekPixels & draw)
robertphillips37bd7c32016-03-17 14:31:39 -070056static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* reporter,
Robert Phillips6de99042017-01-31 11:31:39 -050057 GrContext* context, bool isGPUBacked,
robertphillipsc5035e72016-03-17 06:58:39 -070058 int offset, int size) {
robertphillips3e302272016-04-20 11:48:36 -070059 const SkIRect subset = img->subset();
robertphillipsc5035e72016-03-17 06:58:39 -070060 REPORTER_ASSERT(reporter, offset == subset.left());
61 REPORTER_ASSERT(reporter, offset == subset.top());
robertphillipsb6c65e92016-02-04 10:52:42 -080062 REPORTER_ASSERT(reporter, kSmallerSize == subset.width());
63 REPORTER_ASSERT(reporter, kSmallerSize == subset.height());
64
65 //--------------
Robert Phillips2c6d2bf2017-02-21 10:19:29 -050066 // Test that isTextureBacked reports the correct backing type
Robert Phillips6de99042017-01-31 11:31:39 -050067 REPORTER_ASSERT(reporter, isGPUBacked == img->isTextureBacked());
robertphillips64612512016-04-08 12:10:42 -070068
69#if SK_SUPPORT_GPU
70 //--------------
Robert Phillips8e1c4e62017-02-19 12:27:01 -050071 // Test asTextureProxyRef - as long as there is a context this should succeed
robertphillips64612512016-04-08 12:10:42 -070072 if (context) {
Robert Phillips8e1c4e62017-02-19 12:27:01 -050073 sk_sp<GrTextureProxy> proxy(img->asTextureProxyRef(context));
74 REPORTER_ASSERT(reporter, proxy);
robertphillips64612512016-04-08 12:10:42 -070075 }
76#endif
robertphillipsb6c65e92016-02-04 10:52:42 -080077
78 //--------------
robertphillips64612512016-04-08 12:10:42 -070079 // Test getROPixels - this should always succeed regardless of backing store
80 SkBitmap bitmap;
81 REPORTER_ASSERT(reporter, img->getROPixels(&bitmap));
robertphillipsed086ca2016-04-26 15:02:25 -070082 if (context) {
83 REPORTER_ASSERT(reporter, kSmallerSize == bitmap.width());
84 REPORTER_ASSERT(reporter, kSmallerSize == bitmap.height());
85 } else {
86 REPORTER_ASSERT(reporter, size == bitmap.width());
87 REPORTER_ASSERT(reporter, size == bitmap.height());
88 }
robertphillipsb6c65e92016-02-04 10:52:42 -080089
90 //--------------
robertphillipsb4bd11e2016-03-21 13:44:18 -070091 // Test that draw restricts itself to the subset
brianosmaneed6b0e2016-09-23 13:04:05 -070092 SkImageFilter::OutputProperties outProps(img->getColorSpace());
93 sk_sp<SkSpecialSurface> surf(img->makeSurface(outProps, SkISize::Make(kFullSize, kFullSize),
Matt Sarettcb6266b2017-01-17 10:48:53 -050094 kPremul_SkAlphaType));
robertphillipsb6c65e92016-02-04 10:52:42 -080095
96 SkCanvas* canvas = surf->getCanvas();
97
98 canvas->clear(SK_ColorBLUE);
robertphillipse8c34972016-02-16 12:09:36 -080099 img->draw(canvas, SkIntToScalar(kPad), SkIntToScalar(kPad), nullptr);
robertphillipsb6c65e92016-02-04 10:52:42 -0800100
101 SkBitmap bm;
Matt Sarettcb6266b2017-01-17 10:48:53 -0500102 bm.allocN32Pixels(kFullSize, kFullSize, false);
robertphillipsb6c65e92016-02-04 10:52:42 -0800103
104 bool result = canvas->readPixels(bm.info(), bm.getPixels(), bm.rowBytes(), 0, 0);
105 SkASSERT_RELEASE(result);
106
107 // Only the center (red) portion should've been drawn into the canvas
108 REPORTER_ASSERT(reporter, SK_ColorBLUE == bm.getColor(kPad-1, kPad-1));
109 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(kPad, kPad));
110 REPORTER_ASSERT(reporter, SK_ColorRED == bm.getColor(kSmallerSize+kPad-1,
111 kSmallerSize+kPad-1));
112 REPORTER_ASSERT(reporter, SK_ColorBLUE == bm.getColor(kSmallerSize+kPad,
113 kSmallerSize+kPad));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700114
115 //--------------
Robert Phillipsa5fdc972017-02-18 16:58:09 -0500116 // Test that asImage & makeTightSurface return appropriately sized objects
robertphillipsb4bd11e2016-03-21 13:44:18 -0700117 // of the correct backing type
118 SkIRect newSubset = SkIRect::MakeWH(subset.width(), subset.height());
119 {
Robert Phillipsa5fdc972017-02-18 16:58:09 -0500120 sk_sp<SkImage> tightImg(img->asImage(&newSubset));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700121
122 REPORTER_ASSERT(reporter, tightImg->width() == subset.width());
123 REPORTER_ASSERT(reporter, tightImg->height() == subset.height());
Robert Phillips0ae6faa2017-03-21 16:22:00 -0400124 REPORTER_ASSERT(reporter, isGPUBacked == tightImg->isTextureBacked());
robertphillipsb4bd11e2016-03-21 13:44:18 -0700125 SkPixmap tmpPixmap;
Robert Phillips6de99042017-01-31 11:31:39 -0500126 REPORTER_ASSERT(reporter, isGPUBacked != !!tightImg->peekPixels(&tmpPixmap));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700127 }
128 {
brianosmaneed6b0e2016-09-23 13:04:05 -0700129 SkImageFilter::OutputProperties outProps(img->getColorSpace());
130 sk_sp<SkSurface> tightSurf(img->makeTightSurface(outProps, subset.size()));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700131
132 REPORTER_ASSERT(reporter, tightSurf->width() == subset.width());
133 REPORTER_ASSERT(reporter, tightSurf->height() == subset.height());
Robert Phillips6de99042017-01-31 11:31:39 -0500134 REPORTER_ASSERT(reporter, isGPUBacked ==
robertphillipsb4bd11e2016-03-21 13:44:18 -0700135 !!tightSurf->getTextureHandle(SkSurface::kDiscardWrite_BackendHandleAccess));
136 SkPixmap tmpPixmap;
Robert Phillips6de99042017-01-31 11:31:39 -0500137 REPORTER_ASSERT(reporter, isGPUBacked != !!tightSurf->peekPixels(&tmpPixmap));
robertphillipsb4bd11e2016-03-21 13:44:18 -0700138 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800139}
140
141DEF_TEST(SpecialImage_Raster, reporter) {
142 SkBitmap bm = create_bm();
143
robertphillips37bd7c32016-03-17 14:31:39 -0700144 sk_sp<SkSpecialImage> fullSImage(SkSpecialImage::MakeFromRaster(
robertphillipsc5035e72016-03-17 06:58:39 -0700145 SkIRect::MakeWH(kFullSize, kFullSize),
146 bm));
147
robertphillipsb6c65e92016-02-04 10:52:42 -0800148 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
149
robertphillipsc5035e72016-03-17 06:58:39 -0700150 {
robertphillips3e302272016-04-20 11:48:36 -0700151 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeFromRaster(subset, bm));
robertphillips64612512016-04-08 12:10:42 -0700152 test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700153 }
154
155 {
robertphillips37bd7c32016-03-17 14:31:39 -0700156 sk_sp<SkSpecialImage> subSImg2(fullSImage->makeSubset(subset));
robertphillips64612512016-04-08 12:10:42 -0700157 test_image(subSImg2, reporter, nullptr, false, 0, kSmallerSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700158 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800159}
160
Brian Osman61624f02016-12-09 14:51:59 -0500161static void test_specialimage_image(skiatest::Reporter* reporter, SkColorSpace* dstColorSpace) {
robertphillipsb6c65e92016-02-04 10:52:42 -0800162 SkBitmap bm = create_bm();
163
reed9ce9d672016-03-17 10:51:11 -0700164 sk_sp<SkImage> fullImage(SkImage::MakeFromBitmap(bm));
robertphillipsb6c65e92016-02-04 10:52:42 -0800165
robertphillips37bd7c32016-03-17 14:31:39 -0700166 sk_sp<SkSpecialImage> fullSImage(SkSpecialImage::MakeFromImage(
robertphillipsc5035e72016-03-17 06:58:39 -0700167 SkIRect::MakeWH(kFullSize, kFullSize),
Brian Osman61624f02016-12-09 14:51:59 -0500168 fullImage, dstColorSpace));
robertphillipsc5035e72016-03-17 06:58:39 -0700169
robertphillipsb6c65e92016-02-04 10:52:42 -0800170 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
171
robertphillipsc5035e72016-03-17 06:58:39 -0700172 {
Brian Osman61624f02016-12-09 14:51:59 -0500173 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeFromImage(subset, fullImage,
174 dstColorSpace));
robertphillipsed086ca2016-04-26 15:02:25 -0700175 test_image(subSImg1, reporter, nullptr, false, kPad, kFullSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700176 }
177
178 {
robertphillips37bd7c32016-03-17 14:31:39 -0700179 sk_sp<SkSpecialImage> subSImg2(fullSImage->makeSubset(subset));
robertphillipsed086ca2016-04-26 15:02:25 -0700180 test_image(subSImg2, reporter, nullptr, false, 0, kSmallerSize);
robertphillipsc5035e72016-03-17 06:58:39 -0700181 }
robertphillipsb6c65e92016-02-04 10:52:42 -0800182}
183
Brian Osman7992da32016-11-18 11:28:24 -0500184DEF_TEST(SpecialImage_Image_Legacy, reporter) {
Brian Osman61624f02016-12-09 14:51:59 -0500185 SkColorSpace* legacyColorSpace = nullptr;
186 test_specialimage_image(reporter, legacyColorSpace);
Brian Osman7992da32016-11-18 11:28:24 -0500187}
188
189DEF_TEST(SpecialImage_Image_ColorSpaceAware, reporter) {
Matt Sarett77a7a1b2017-02-07 13:56:11 -0500190 sk_sp<SkColorSpace> srgbColorSpace = SkColorSpace::MakeSRGB();
Brian Osman61624f02016-12-09 14:51:59 -0500191 test_specialimage_image(reporter, srgbColorSpace.get());
Brian Osman7992da32016-11-18 11:28:24 -0500192}
193
robertphillipsb6c65e92016-02-04 10:52:42 -0800194#if SK_SUPPORT_GPU
robertphillips83c17fa2016-03-18 08:14:27 -0700195
196static void test_texture_backed(skiatest::Reporter* reporter,
197 const sk_sp<SkSpecialImage>& orig,
198 const sk_sp<SkSpecialImage>& gpuBacked) {
199 REPORTER_ASSERT(reporter, gpuBacked);
robertphillips64612512016-04-08 12:10:42 -0700200 REPORTER_ASSERT(reporter, gpuBacked->isTextureBacked());
robertphillips83c17fa2016-03-18 08:14:27 -0700201 REPORTER_ASSERT(reporter, gpuBacked->uniqueID() == orig->uniqueID());
202 REPORTER_ASSERT(reporter, gpuBacked->subset().width() == orig->subset().width() &&
203 gpuBacked->subset().height() == orig->subset().height());
brianosmanafbf71d2016-07-21 07:15:37 -0700204 REPORTER_ASSERT(reporter, gpuBacked->getColorSpace() == orig->getColorSpace());
robertphillips83c17fa2016-03-18 08:14:27 -0700205}
206
207// Test out the SkSpecialImage::makeTextureImage entry point
bsalomon68d91342016-04-12 09:59:58 -0700208DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_MakeTexture, reporter, ctxInfo) {
bsalomon8b7451a2016-05-11 06:33:06 -0700209 GrContext* context = ctxInfo.grContext();
robertphillips83c17fa2016-03-18 08:14:27 -0700210 SkBitmap bm = create_bm();
211
212 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
213
214 {
215 // raster
216 sk_sp<SkSpecialImage> rasterImage(SkSpecialImage::MakeFromRaster(
robertphillips83c17fa2016-03-18 08:14:27 -0700217 SkIRect::MakeWH(kFullSize,
218 kFullSize),
219 bm));
220
221 {
robertphillips3e302272016-04-20 11:48:36 -0700222 sk_sp<SkSpecialImage> fromRaster(rasterImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700223 test_texture_backed(reporter, rasterImage, fromRaster);
224 }
225
226 {
227 sk_sp<SkSpecialImage> subRasterImage(rasterImage->makeSubset(subset));
228
robertphillips3e302272016-04-20 11:48:36 -0700229 sk_sp<SkSpecialImage> fromSubRaster(subRasterImage->makeTextureImage(context));
robertphillips83c17fa2016-03-18 08:14:27 -0700230 test_texture_backed(reporter, subRasterImage, fromSubRaster);
231 }
232 }
233
234 {
235 // gpu
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500236 const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
robertphillips83c17fa2016-03-18 08:14:27 -0700237
Robert Phillips1afd4cd2018-01-08 13:40:32 -0500238 sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(
239 context->contextPriv().proxyProvider(),
240 desc, SkBudgeted::kNo,
241 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();
robertphillipsb6c65e92016-02-04 10:52:42 -0800268 SkBitmap bm = create_bm();
269
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500270 const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bm.info(), *context->caps());
robertphillipsb6c65e92016-02-04 10:52:42 -0800271
Robert Phillips1afd4cd2018-01-08 13:40:32 -0500272 sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(context->contextPriv().proxyProvider(),
Robert Phillips2c6d2bf2017-02-21 10:19:29 -0500273 desc, SkBudgeted::kNo,
274 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();
303 SkBitmap bm = create_bm();
304
305 GrSurfaceDesc desc;
Robert Phillips96be9df2017-07-21 14:17:45 +0000306 desc.fFlags = kNone_GrSurfaceFlags;
Robert Phillipse44ef102017-07-21 15:37:19 -0400307 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
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
Robert Phillips1afd4cd2018-01-08 13:40:32 -0500312 sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(context->contextPriv().proxyProvider(),
Robert Phillips37430132016-11-09 06:50:43 -0500313 desc, SkBudgeted::kNo,
314 bm.getPixels(), 0));
Robert Phillips8bc06d02016-11-01 17:28:40 -0400315 if (!proxy) {
316 return;
317 }
318
319 sk_sp<SkSpecialImage> fullSImg(SkSpecialImage::MakeDeferredFromGpu(
320 context,
321 SkIRect::MakeWH(kFullSize, kFullSize),
322 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500323 proxy, nullptr));
Robert Phillips8bc06d02016-11-01 17:28:40 -0400324
325 const SkIRect& subset = SkIRect::MakeXYWH(kPad, kPad, kSmallerSize, kSmallerSize);
326
327 {
328 sk_sp<SkSpecialImage> subSImg1(SkSpecialImage::MakeDeferredFromGpu(
Robert Phillips2f493142017-03-02 18:18:38 -0500329 context, subset,
Robert Phillips8bc06d02016-11-01 17:28:40 -0400330 kNeedNewImageUniqueID_SpecialImage,
Robert Phillips2f493142017-03-02 18:18:38 -0500331 std::move(proxy), nullptr));
Robert Phillips8bc06d02016-11-01 17:28:40 -0400332 test_image(subSImg1, reporter, context, true, kPad, kFullSize);
333 }
334
335 {
336 sk_sp<SkSpecialImage> subSImg2(fullSImg->makeSubset(subset));
337 test_image(subSImg2, reporter, context, true, kPad, kFullSize);
338 }
339}
340
robertphillipsb6c65e92016-02-04 10:52:42 -0800341#endif