blob: be121e3fdfb4cf7ac341f18ba9cd58f1e3b147fa [file] [log] [blame]
bsalomone63ffef2016-02-05 07:17:34 -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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "include/core/SkBitmap.h"
9#include "include/core/SkCanvas.h"
10#include "include/core/SkColor.h"
11#include "include/core/SkColorSpace.h"
12#include "include/core/SkImageInfo.h"
13#include "include/core/SkPaint.h"
14#include "include/core/SkRect.h"
15#include "include/core/SkRefCnt.h"
16#include "include/core/SkSurface.h"
Ben Wagner9707a7e2019-05-06 17:17:19 -040017#include "include/core/SkTypes.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050018#include "include/gpu/GrContextOptions.h"
Robert Phillips6d344c32020-07-06 10:56:46 -040019#include "include/gpu/GrDirectContext.h"
Ben Wagner9707a7e2019-05-06 17:17:19 -040020#include "include/private/GrTypesPriv.h"
21#include "include/private/SkColorData.h"
Robert Phillipsd3442842019-08-02 12:26:22 -040022#include "src/core/SkAutoPixmapStorage.h"
Greg Danielf91aeb22019-06-18 09:58:02 -040023#include "src/gpu/GrColor.h"
Robert Phillips4b10d582020-12-02 18:27:18 -050024#include "src/gpu/GrDirectContextPriv.h"
Brian Salomonf2ebdd92019-09-30 12:15:30 -040025#include "src/gpu/GrImageInfo.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050026#include "src/gpu/GrRenderTargetContext.h"
Robert Phillips4b10d582020-12-02 18:27:18 -050027#include "src/gpu/ops/GrClearOp.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050028#include "tests/Test.h"
29#include "tools/gpu/GrContextFactory.h"
Ben Wagnerb607a8f2018-03-12 13:46:21 -040030
Ben Wagner9707a7e2019-05-06 17:17:19 -040031#include <cstdint>
Ben Wagnerb607a8f2018-03-12 13:46:21 -040032#include <memory>
Robert Phillipsdbfecd02017-10-18 15:44:08 -040033
Adlai Hollerc95b5892020-08-11 12:02:22 -040034static bool check_rect(GrDirectContext* dContext, GrRenderTargetContext* rtc, const SkIRect& rect,
35 uint32_t expectedValue, uint32_t* actualValue, int* failX, int* failY) {
bsalomone63ffef2016-02-05 07:17:34 -080036 int w = rect.width();
37 int h = rect.height();
Robert Phillips301431d2017-03-29 12:08:49 -040038
39 SkImageInfo dstInfo = SkImageInfo::Make(w, h, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
40
Robert Phillipsd3442842019-08-02 12:26:22 -040041 SkAutoPixmapStorage readback;
42 readback.alloc(dstInfo);
43
44 readback.erase(~expectedValue);
Adlai Hollerc95b5892020-08-11 12:02:22 -040045 if (!rtc->readPixels(dContext, readback.info(), readback.writable_addr(), readback.rowBytes(),
Robert Phillipsd3442842019-08-02 12:26:22 -040046 {rect.fLeft, rect.fTop})) {
Robert Phillips301431d2017-03-29 12:08:49 -040047 return false;
48 }
49
bsalomone63ffef2016-02-05 07:17:34 -080050 for (int y = 0; y < h; ++y) {
51 for (int x = 0; x < w; ++x) {
Robert Phillipsd3442842019-08-02 12:26:22 -040052 uint32_t pixel = readback.addr32()[y * w + x];
bsalomone63ffef2016-02-05 07:17:34 -080053 if (pixel != expectedValue) {
54 *actualValue = pixel;
55 *failX = x + rect.fLeft;
56 *failY = y + rect.fTop;
57 return false;
58 }
59 }
60 }
61 return true;
62}
63
Robert Phillipsfe4b4812020-07-17 14:15:51 -040064std::unique_ptr<GrRenderTargetContext> newRTC(GrRecordingContext* rContext, int w, int h) {
Greg Daniele20fcad2020-01-08 11:52:34 -050065 return GrRenderTargetContext::Make(
Robert Phillipsfe4b4812020-07-17 14:15:51 -040066 rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {w, h});
bsalomone63ffef2016-02-05 07:17:34 -080067}
68
Adlai Hollerc95b5892020-08-11 12:02:22 -040069static void clear_op_test(skiatest::Reporter* reporter, GrDirectContext* dContext) {
bsalomone63ffef2016-02-05 07:17:34 -080070 static const int kW = 10;
71 static const int kH = 10;
72
73 SkIRect fullRect = SkIRect::MakeWH(kW, kH);
Brian Salomonbf6b9792019-08-21 09:38:10 -040074 std::unique_ptr<GrRenderTargetContext> rtContext;
bsalomone63ffef2016-02-05 07:17:34 -080075
76 // A rectangle that is inset by one on all sides and the 1-pixel wide rectangles that surround
77 // it.
78 SkIRect mid1Rect = SkIRect::MakeXYWH(1, 1, kW-2, kH-2);
79 SkIRect outerLeftEdge = SkIRect::MakeXYWH(0, 0, 1, kH);
80 SkIRect outerTopEdge = SkIRect::MakeXYWH(0, 0, kW, 1);
81 SkIRect outerRightEdge = SkIRect::MakeXYWH(kW-1, 0, 1, kH);
82 SkIRect outerBottomEdge = SkIRect::MakeXYWH(0, kH-1, kW, 1);
83
84 // A rectangle that is inset by two on all sides and the 1-pixel wide rectangles that surround
85 // it.
86 SkIRect mid2Rect = SkIRect::MakeXYWH(2, 2, kW-4, kH-4);
87 SkIRect innerLeftEdge = SkIRect::MakeXYWH(1, 1, 1, kH-2);
88 SkIRect innerTopEdge = SkIRect::MakeXYWH(1, 1, kW-2, 1);
89 SkIRect innerRightEdge = SkIRect::MakeXYWH(kW-2, 1, 1, kH-2);
90 SkIRect innerBottomEdge = SkIRect::MakeXYWH(1, kH-2, kW-2, 1);
91
92 uint32_t actualValue;
93 int failX, failY;
94
95 static const GrColor kColor1 = 0xABCDEF01;
96 static const GrColor kColor2 = ~kColor1;
Brian Osman9a9baae2018-11-05 15:06:26 -050097 static const SkPMColor4f kColor1f = SkPMColor4f::FromBytes_RGBA(kColor1);
98 static const SkPMColor4f kColor2f = SkPMColor4f::FromBytes_RGBA(kColor2);
bsalomone63ffef2016-02-05 07:17:34 -080099
Adlai Hollerc95b5892020-08-11 12:02:22 -0400100 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400101 SkASSERT(rtContext);
102
bsalomone63ffef2016-02-05 07:17:34 -0800103 // Check a full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400104 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400105 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800106 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
107 failX, failY);
108 }
109
Adlai Hollerc95b5892020-08-11 12:02:22 -0400110 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400111 SkASSERT(rtContext);
112
bsalomone63ffef2016-02-05 07:17:34 -0800113 // Check two full clears, same color
Michael Ludwig81d41722020-05-26 16:57:38 -0400114 rtContext->clear(fullRect, kColor1f);
115 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400116 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800117 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
118 failX, failY);
119 }
120
Adlai Hollerc95b5892020-08-11 12:02:22 -0400121 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400122 SkASSERT(rtContext);
123
bsalomone63ffef2016-02-05 07:17:34 -0800124 // Check two full clears, different colors
Michael Ludwig81d41722020-05-26 16:57:38 -0400125 rtContext->clear(fullRect, kColor1f);
126 rtContext->clear(fullRect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400127 if (!check_rect(dContext, rtContext.get(), fullRect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800128 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
129 failX, failY);
130 }
131
Adlai Hollerc95b5892020-08-11 12:02:22 -0400132 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400133 SkASSERT(rtContext);
134
bsalomone63ffef2016-02-05 07:17:34 -0800135 // Test a full clear followed by a same color inset clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400136 rtContext->clear(fullRect, kColor1f);
137 rtContext->clear(mid1Rect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400138 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800139 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
140 failX, failY);
141 }
142
Adlai Hollerc95b5892020-08-11 12:02:22 -0400143 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400144 SkASSERT(rtContext);
145
bsalomone63ffef2016-02-05 07:17:34 -0800146 // Test a inset clear followed by same color full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400147 rtContext->clear(mid1Rect, kColor1f);
148 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400149 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800150 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
151 failX, failY);
152 }
153
Adlai Hollerc95b5892020-08-11 12:02:22 -0400154 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400155 SkASSERT(rtContext);
156
bsalomone63ffef2016-02-05 07:17:34 -0800157 // Test a full clear followed by a different color inset clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400158 rtContext->clear(fullRect, kColor1f);
159 rtContext->clear(mid1Rect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400160 if (!check_rect(dContext, rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800161 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
162 failX, failY);
163 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400164 if (!check_rect(
165 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
166 !check_rect(
167 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
168 !check_rect(
169 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
170 !check_rect(
171 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800172 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
173 failX, failY);
174 }
175
Adlai Hollerc95b5892020-08-11 12:02:22 -0400176 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400177 SkASSERT(rtContext);
178
bsalomone63ffef2016-02-05 07:17:34 -0800179 // Test a inset clear followed by a different full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400180 rtContext->clear(mid1Rect, kColor2f);
181 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400182 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800183 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
184 failX, failY);
185 }
186
Adlai Hollerc95b5892020-08-11 12:02:22 -0400187 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400188 SkASSERT(rtContext);
189
bsalomone63ffef2016-02-05 07:17:34 -0800190 // Check three nested clears from largest to smallest where outermost and innermost are same
191 // color.
Michael Ludwig81d41722020-05-26 16:57:38 -0400192 rtContext->clear(fullRect, kColor1f);
193 rtContext->clear(mid1Rect, kColor2f);
194 rtContext->clear(mid2Rect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400195 if (!check_rect(dContext, rtContext.get(), mid2Rect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800196 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
197 failX, failY);
198 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400199 if (!check_rect(
200 dContext, rtContext.get(), innerLeftEdge, kColor2, &actualValue, &failX, &failY) ||
201 !check_rect(
202 dContext, rtContext.get(), innerTopEdge, kColor2, &actualValue, &failX, &failY) ||
203 !check_rect(
204 dContext, rtContext.get(), innerRightEdge, kColor2, &actualValue, &failX, &failY) ||
205 !check_rect(
206 dContext, rtContext.get(), innerBottomEdge, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800207 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
208 failX, failY);
209 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400210 if (!check_rect(
211 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
212 !check_rect(
213 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
214 !check_rect(
215 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
216 !check_rect(
217 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800218 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
219 failX, failY);
220 }
221
Adlai Hollerc95b5892020-08-11 12:02:22 -0400222 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400223 SkASSERT(rtContext);
224
bsalomone63ffef2016-02-05 07:17:34 -0800225 // Swap the order of the second two clears in the above test.
Michael Ludwig81d41722020-05-26 16:57:38 -0400226 rtContext->clear(fullRect, kColor1f);
227 rtContext->clear(mid2Rect, kColor1f);
228 rtContext->clear(mid1Rect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400229 if (!check_rect(dContext, rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800230 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
231 failX, failY);
232 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400233 if (!check_rect(
234 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
235 !check_rect(
236 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
237 !check_rect(
238 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
239 !check_rect(
240 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800241 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
242 failX, failY);
243 }
Robert Phillips4b10d582020-12-02 18:27:18 -0500244
245 // Clear calls need to remain ClearOps for the following combining-tests to work as expected
246 if (!dContext->priv().caps()->performColorClearsAsDraws() &&
247 !dContext->priv().caps()->performStencilClearsAsDraws() &&
248 !dContext->priv().caps()->performPartialClearsAsDraws()) {
249 static constexpr SkIRect kScissorRect = SkIRect::MakeXYWH(1, 1, kW-1, kH-1);
250
251 // Try combining a pure-color clear w/ a combined stencil & color clear
252 // (re skbug.com/10963)
253 {
254 rtContext = newRTC(dContext, kW, kH);
255 SkASSERT(rtContext);
256
257 rtContext->clearStencilClip(kScissorRect, true);
258 // This color clear can combine w/ the preceding stencil clear
259 rtContext->clear(kScissorRect, SK_PMColor4fWHITE);
260
261 // This should combine w/ the prior combined clear and overwrite the color
262 rtContext->clear(kScissorRect, SK_PMColor4fBLACK);
263
264 GrOpsTask* ops = rtContext->getOpsTask();
265 REPORTER_ASSERT(reporter, ops->numOpChains() == 1);
266
267 const GrClearOp& clearOp = ops->getChain(0)->cast<GrClearOp>();
268
269 constexpr std::array<float, 4> kExpected { 0, 0, 0, 1 };
270 REPORTER_ASSERT(reporter, clearOp.color() == kExpected);
271 REPORTER_ASSERT(reporter, clearOp.stencilInsideMask());
272
273 dContext->flushAndSubmit();
274 }
275
276 // Try combining a pure-stencil clear w/ a combined stencil & color clear
277 // (re skbug.com/10963)
278 {
279 rtContext = newRTC(dContext, kW, kH);
280 SkASSERT(rtContext);
281
282 rtContext->clearStencilClip(kScissorRect, true);
283 // This color clear can combine w/ the preceding stencil clear
284 rtContext->clear(kScissorRect, SK_PMColor4fWHITE);
285
286 // This should combine w/ the prior combined clear and overwrite the 'insideStencilMask'
287 // field
288 rtContext->clearStencilClip(kScissorRect, false);
289
290 GrOpsTask* ops = rtContext->getOpsTask();
291 REPORTER_ASSERT(reporter, ops->numOpChains() == 1);
292
293 const GrClearOp& clearOp = ops->getChain(0)->cast<GrClearOp>();
294
295 constexpr std::array<float, 4> kExpected { 1, 1, 1, 1 };
296 REPORTER_ASSERT(reporter, clearOp.color() == kExpected);
297 REPORTER_ASSERT(reporter, !clearOp.stencilInsideMask());
298
299 dContext->flushAndSubmit();
300 }
301 }
bsalomone63ffef2016-02-05 07:17:34 -0800302}
Brian Salomon43f8bf02017-10-18 08:33:29 -0400303
304DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearOp, reporter, ctxInfo) {
Michael Ludwiga21d1962019-01-11 15:26:22 -0500305 // Regular clear
Robert Phillips6d344c32020-07-06 10:56:46 -0400306 clear_op_test(reporter, ctxInfo.directContext());
Michael Ludwiga21d1962019-01-11 15:26:22 -0500307
308 // Force drawing for clears
309 GrContextOptions options(ctxInfo.options());
310 options.fUseDrawInsteadOfClear = GrContextOptions::Enable::kYes;
311 sk_gpu_test::GrContextFactory workaroundFactory(options);
312 clear_op_test(reporter, workaroundFactory.get(ctxInfo.type()));
Brian Salomon43f8bf02017-10-18 08:33:29 -0400313}
314
Robert Phillipsfe4b4812020-07-17 14:15:51 -0400315void fullscreen_clear_with_layer_test(skiatest::Reporter* reporter, GrRecordingContext* rContext) {
Brian Salomon43f8bf02017-10-18 08:33:29 -0400316 const SkImageInfo ii = SkImageInfo::Make(400, 77, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
317
Robert Phillipsfe4b4812020-07-17 14:15:51 -0400318 sk_sp<SkSurface> surf = SkSurface::MakeRenderTarget(rContext, SkBudgeted::kYes, ii);
Brian Salomon43f8bf02017-10-18 08:33:29 -0400319 SkCanvas* canvas = surf->getCanvas();
320
321 SkPaint paints[2];
322 paints[0].setColor(SK_ColorGREEN);
323 paints[1].setColor(SK_ColorGRAY);
324
325 static const int kLeftX = 158;
326 static const int kMidX = 258;
327 static const int kRightX = 383;
328 static const int kTopY = 26;
329 static const int kBotY = 51;
330
331 const SkRect rects[2] = {
332 { kLeftX, kTopY, kMidX, kBotY },
333 { kMidX, kTopY, kRightX, kBotY },
334 };
335
336 for (int i = 0; i < 2; ++i) {
337 // the bounds parameter is required to cause a full screen clear
338 canvas->saveLayer(&rects[i], nullptr);
339 canvas->drawRect(rects[i], paints[i]);
340 canvas->restore();
341 }
342
343 SkBitmap bm;
344 bm.allocPixels(ii, 0);
345
346 SkAssertResult(surf->readPixels(bm, 0, 0));
347
348 bool isCorrect = true;
349 for (int y = kTopY; isCorrect && y < kBotY; ++y) {
350 const uint32_t* sl = bm.getAddr32(0, y);
351
352 for (int x = kLeftX; x < kMidX; ++x) {
353 if (SK_ColorGREEN != sl[x]) {
354 isCorrect = false;
355 break;
356 }
357 }
358
359 for (int x = kMidX; x < kRightX; ++x) {
360 if (SK_ColorGRAY != sl[x]) {
361 isCorrect = false;
362 break;
363 }
364 }
365 }
366
367 REPORTER_ASSERT(reporter, isCorrect);
368}
369// From crbug.com/768134
370DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FullScreenClearWithLayers, reporter, ctxInfo) {
Michael Ludwiga21d1962019-01-11 15:26:22 -0500371 // Regular clear
Robert Phillips6d344c32020-07-06 10:56:46 -0400372 fullscreen_clear_with_layer_test(reporter, ctxInfo.directContext());
Michael Ludwiga21d1962019-01-11 15:26:22 -0500373
374 // Use draws for clears
375 GrContextOptions options(ctxInfo.options());
376 options.fUseDrawInsteadOfClear = GrContextOptions::Enable::kYes;
377 sk_gpu_test::GrContextFactory workaroundFactory(options);
378 fullscreen_clear_with_layer_test(reporter, workaroundFactory.get(ctxInfo.type()));
Brian Salomon43f8bf02017-10-18 08:33:29 -0400379}