blob: a72e13ab19f3af07eb502b345a50a242a521354f [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"
Brian Salomoneebe7352020-12-09 16:37:04 -050026#include "src/gpu/GrSurfaceDrawContext.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
Brian Salomoneebe7352020-12-09 16:37:04 -050034static bool check_rect(GrDirectContext* dContext, GrSurfaceDrawContext* rtc, const SkIRect& rect,
Adlai Hollerc95b5892020-08-11 12:02:22 -040035 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);
Brian Salomondd4087d2020-12-23 20:36:44 -050045 if (!rtc->readPixels(dContext, readback, {rect.fLeft, rect.fTop})) {
Robert Phillips301431d2017-03-29 12:08:49 -040046 return false;
47 }
48
bsalomone63ffef2016-02-05 07:17:34 -080049 for (int y = 0; y < h; ++y) {
50 for (int x = 0; x < w; ++x) {
Robert Phillipsd3442842019-08-02 12:26:22 -040051 uint32_t pixel = readback.addr32()[y * w + x];
bsalomone63ffef2016-02-05 07:17:34 -080052 if (pixel != expectedValue) {
53 *actualValue = pixel;
54 *failX = x + rect.fLeft;
55 *failY = y + rect.fTop;
56 return false;
57 }
58 }
59 }
60 return true;
61}
62
Brian Salomoneebe7352020-12-09 16:37:04 -050063std::unique_ptr<GrSurfaceDrawContext> newRTC(GrRecordingContext* rContext, int w, int h) {
64 return GrSurfaceDrawContext::Make(
Robert Phillipsfe4b4812020-07-17 14:15:51 -040065 rContext, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact, {w, h});
bsalomone63ffef2016-02-05 07:17:34 -080066}
67
Adlai Hollerc95b5892020-08-11 12:02:22 -040068static void clear_op_test(skiatest::Reporter* reporter, GrDirectContext* dContext) {
bsalomone63ffef2016-02-05 07:17:34 -080069 static const int kW = 10;
70 static const int kH = 10;
71
72 SkIRect fullRect = SkIRect::MakeWH(kW, kH);
Brian Salomoneebe7352020-12-09 16:37:04 -050073 std::unique_ptr<GrSurfaceDrawContext> rtContext;
bsalomone63ffef2016-02-05 07:17:34 -080074
75 // A rectangle that is inset by one on all sides and the 1-pixel wide rectangles that surround
76 // it.
77 SkIRect mid1Rect = SkIRect::MakeXYWH(1, 1, kW-2, kH-2);
78 SkIRect outerLeftEdge = SkIRect::MakeXYWH(0, 0, 1, kH);
79 SkIRect outerTopEdge = SkIRect::MakeXYWH(0, 0, kW, 1);
80 SkIRect outerRightEdge = SkIRect::MakeXYWH(kW-1, 0, 1, kH);
81 SkIRect outerBottomEdge = SkIRect::MakeXYWH(0, kH-1, kW, 1);
82
83 // A rectangle that is inset by two on all sides and the 1-pixel wide rectangles that surround
84 // it.
85 SkIRect mid2Rect = SkIRect::MakeXYWH(2, 2, kW-4, kH-4);
86 SkIRect innerLeftEdge = SkIRect::MakeXYWH(1, 1, 1, kH-2);
87 SkIRect innerTopEdge = SkIRect::MakeXYWH(1, 1, kW-2, 1);
88 SkIRect innerRightEdge = SkIRect::MakeXYWH(kW-2, 1, 1, kH-2);
89 SkIRect innerBottomEdge = SkIRect::MakeXYWH(1, kH-2, kW-2, 1);
90
91 uint32_t actualValue;
92 int failX, failY;
93
94 static const GrColor kColor1 = 0xABCDEF01;
95 static const GrColor kColor2 = ~kColor1;
Brian Osman9a9baae2018-11-05 15:06:26 -050096 static const SkPMColor4f kColor1f = SkPMColor4f::FromBytes_RGBA(kColor1);
97 static const SkPMColor4f kColor2f = SkPMColor4f::FromBytes_RGBA(kColor2);
bsalomone63ffef2016-02-05 07:17:34 -080098
Adlai Hollerc95b5892020-08-11 12:02:22 -040099 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400100 SkASSERT(rtContext);
101
bsalomone63ffef2016-02-05 07:17:34 -0800102 // Check a full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400103 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400104 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800105 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
106 failX, failY);
107 }
108
Adlai Hollerc95b5892020-08-11 12:02:22 -0400109 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400110 SkASSERT(rtContext);
111
bsalomone63ffef2016-02-05 07:17:34 -0800112 // Check two full clears, same color
Michael Ludwig81d41722020-05-26 16:57:38 -0400113 rtContext->clear(fullRect, kColor1f);
114 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400115 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800116 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
117 failX, failY);
118 }
119
Adlai Hollerc95b5892020-08-11 12:02:22 -0400120 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400121 SkASSERT(rtContext);
122
bsalomone63ffef2016-02-05 07:17:34 -0800123 // Check two full clears, different colors
Michael Ludwig81d41722020-05-26 16:57:38 -0400124 rtContext->clear(fullRect, kColor1f);
125 rtContext->clear(fullRect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400126 if (!check_rect(dContext, rtContext.get(), fullRect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800127 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
128 failX, failY);
129 }
130
Adlai Hollerc95b5892020-08-11 12:02:22 -0400131 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400132 SkASSERT(rtContext);
133
bsalomone63ffef2016-02-05 07:17:34 -0800134 // Test a full clear followed by a same color inset clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400135 rtContext->clear(fullRect, kColor1f);
136 rtContext->clear(mid1Rect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400137 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800138 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
139 failX, failY);
140 }
141
Adlai Hollerc95b5892020-08-11 12:02:22 -0400142 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400143 SkASSERT(rtContext);
144
bsalomone63ffef2016-02-05 07:17:34 -0800145 // Test a inset clear followed by same color full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400146 rtContext->clear(mid1Rect, kColor1f);
147 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400148 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800149 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
150 failX, failY);
151 }
152
Adlai Hollerc95b5892020-08-11 12:02:22 -0400153 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400154 SkASSERT(rtContext);
155
bsalomone63ffef2016-02-05 07:17:34 -0800156 // Test a full clear followed by a different color inset clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400157 rtContext->clear(fullRect, kColor1f);
158 rtContext->clear(mid1Rect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400159 if (!check_rect(dContext, rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800160 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
161 failX, failY);
162 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400163 if (!check_rect(
164 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
165 !check_rect(
166 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
167 !check_rect(
168 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
169 !check_rect(
170 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800171 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
172 failX, failY);
173 }
174
Adlai Hollerc95b5892020-08-11 12:02:22 -0400175 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400176 SkASSERT(rtContext);
177
bsalomone63ffef2016-02-05 07:17:34 -0800178 // Test a inset clear followed by a different full clear
Michael Ludwig81d41722020-05-26 16:57:38 -0400179 rtContext->clear(mid1Rect, kColor2f);
180 rtContext->clear(fullRect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400181 if (!check_rect(dContext, rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800182 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
183 failX, failY);
184 }
185
Adlai Hollerc95b5892020-08-11 12:02:22 -0400186 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400187 SkASSERT(rtContext);
188
bsalomone63ffef2016-02-05 07:17:34 -0800189 // Check three nested clears from largest to smallest where outermost and innermost are same
190 // color.
Michael Ludwig81d41722020-05-26 16:57:38 -0400191 rtContext->clear(fullRect, kColor1f);
192 rtContext->clear(mid1Rect, kColor2f);
193 rtContext->clear(mid2Rect, kColor1f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400194 if (!check_rect(dContext, rtContext.get(), mid2Rect, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800195 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
196 failX, failY);
197 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400198 if (!check_rect(
199 dContext, rtContext.get(), innerLeftEdge, kColor2, &actualValue, &failX, &failY) ||
200 !check_rect(
201 dContext, rtContext.get(), innerTopEdge, kColor2, &actualValue, &failX, &failY) ||
202 !check_rect(
203 dContext, rtContext.get(), innerRightEdge, kColor2, &actualValue, &failX, &failY) ||
204 !check_rect(
205 dContext, rtContext.get(), innerBottomEdge, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800206 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
207 failX, failY);
208 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400209 if (!check_rect(
210 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
211 !check_rect(
212 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
213 !check_rect(
214 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
215 !check_rect(
216 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800217 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
218 failX, failY);
219 }
220
Adlai Hollerc95b5892020-08-11 12:02:22 -0400221 rtContext = newRTC(dContext, kW, kH);
Robert Phillipse4d45bf2017-06-02 14:53:40 -0400222 SkASSERT(rtContext);
223
bsalomone63ffef2016-02-05 07:17:34 -0800224 // Swap the order of the second two clears in the above test.
Michael Ludwig81d41722020-05-26 16:57:38 -0400225 rtContext->clear(fullRect, kColor1f);
226 rtContext->clear(mid2Rect, kColor1f);
227 rtContext->clear(mid1Rect, kColor2f);
Adlai Hollerc95b5892020-08-11 12:02:22 -0400228 if (!check_rect(dContext, rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800229 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
230 failX, failY);
231 }
Adlai Hollerc95b5892020-08-11 12:02:22 -0400232 if (!check_rect(
233 dContext, rtContext.get(), outerLeftEdge, kColor1, &actualValue, &failX, &failY) ||
234 !check_rect(
235 dContext, rtContext.get(), outerTopEdge, kColor1, &actualValue, &failX, &failY) ||
236 !check_rect(
237 dContext, rtContext.get(), outerRightEdge, kColor1, &actualValue, &failX, &failY) ||
238 !check_rect(
239 dContext, rtContext.get(), outerBottomEdge, kColor1, &actualValue, &failX, &failY)) {
bsalomone63ffef2016-02-05 07:17:34 -0800240 ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
241 failX, failY);
242 }
Robert Phillips4b10d582020-12-02 18:27:18 -0500243
244 // Clear calls need to remain ClearOps for the following combining-tests to work as expected
245 if (!dContext->priv().caps()->performColorClearsAsDraws() &&
246 !dContext->priv().caps()->performStencilClearsAsDraws() &&
247 !dContext->priv().caps()->performPartialClearsAsDraws()) {
248 static constexpr SkIRect kScissorRect = SkIRect::MakeXYWH(1, 1, kW-1, kH-1);
249
250 // Try combining a pure-color clear w/ a combined stencil & color clear
251 // (re skbug.com/10963)
252 {
253 rtContext = newRTC(dContext, kW, kH);
254 SkASSERT(rtContext);
255
256 rtContext->clearStencilClip(kScissorRect, true);
257 // This color clear can combine w/ the preceding stencil clear
258 rtContext->clear(kScissorRect, SK_PMColor4fWHITE);
259
260 // This should combine w/ the prior combined clear and overwrite the color
261 rtContext->clear(kScissorRect, SK_PMColor4fBLACK);
262
263 GrOpsTask* ops = rtContext->getOpsTask();
264 REPORTER_ASSERT(reporter, ops->numOpChains() == 1);
265
266 const GrClearOp& clearOp = ops->getChain(0)->cast<GrClearOp>();
267
268 constexpr std::array<float, 4> kExpected { 0, 0, 0, 1 };
269 REPORTER_ASSERT(reporter, clearOp.color() == kExpected);
270 REPORTER_ASSERT(reporter, clearOp.stencilInsideMask());
271
272 dContext->flushAndSubmit();
273 }
274
275 // Try combining a pure-stencil clear w/ a combined stencil & color clear
276 // (re skbug.com/10963)
277 {
278 rtContext = newRTC(dContext, kW, kH);
279 SkASSERT(rtContext);
280
281 rtContext->clearStencilClip(kScissorRect, true);
282 // This color clear can combine w/ the preceding stencil clear
283 rtContext->clear(kScissorRect, SK_PMColor4fWHITE);
284
285 // This should combine w/ the prior combined clear and overwrite the 'insideStencilMask'
286 // field
287 rtContext->clearStencilClip(kScissorRect, false);
288
289 GrOpsTask* ops = rtContext->getOpsTask();
290 REPORTER_ASSERT(reporter, ops->numOpChains() == 1);
291
292 const GrClearOp& clearOp = ops->getChain(0)->cast<GrClearOp>();
293
294 constexpr std::array<float, 4> kExpected { 1, 1, 1, 1 };
295 REPORTER_ASSERT(reporter, clearOp.color() == kExpected);
296 REPORTER_ASSERT(reporter, !clearOp.stencilInsideMask());
297
298 dContext->flushAndSubmit();
299 }
300 }
bsalomone63ffef2016-02-05 07:17:34 -0800301}
Brian Salomon43f8bf02017-10-18 08:33:29 -0400302
303DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ClearOp, reporter, ctxInfo) {
Michael Ludwiga21d1962019-01-11 15:26:22 -0500304 // Regular clear
Robert Phillips6d344c32020-07-06 10:56:46 -0400305 clear_op_test(reporter, ctxInfo.directContext());
Michael Ludwiga21d1962019-01-11 15:26:22 -0500306
307 // Force drawing for clears
308 GrContextOptions options(ctxInfo.options());
309 options.fUseDrawInsteadOfClear = GrContextOptions::Enable::kYes;
310 sk_gpu_test::GrContextFactory workaroundFactory(options);
311 clear_op_test(reporter, workaroundFactory.get(ctxInfo.type()));
Brian Salomon43f8bf02017-10-18 08:33:29 -0400312}
313
Robert Phillipsfe4b4812020-07-17 14:15:51 -0400314void fullscreen_clear_with_layer_test(skiatest::Reporter* reporter, GrRecordingContext* rContext) {
Brian Salomon43f8bf02017-10-18 08:33:29 -0400315 const SkImageInfo ii = SkImageInfo::Make(400, 77, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
316
Robert Phillipsfe4b4812020-07-17 14:15:51 -0400317 sk_sp<SkSurface> surf = SkSurface::MakeRenderTarget(rContext, SkBudgeted::kYes, ii);
Brian Salomon43f8bf02017-10-18 08:33:29 -0400318 SkCanvas* canvas = surf->getCanvas();
319
320 SkPaint paints[2];
321 paints[0].setColor(SK_ColorGREEN);
322 paints[1].setColor(SK_ColorGRAY);
323
324 static const int kLeftX = 158;
325 static const int kMidX = 258;
326 static const int kRightX = 383;
327 static const int kTopY = 26;
328 static const int kBotY = 51;
329
330 const SkRect rects[2] = {
331 { kLeftX, kTopY, kMidX, kBotY },
332 { kMidX, kTopY, kRightX, kBotY },
333 };
334
335 for (int i = 0; i < 2; ++i) {
336 // the bounds parameter is required to cause a full screen clear
337 canvas->saveLayer(&rects[i], nullptr);
338 canvas->drawRect(rects[i], paints[i]);
339 canvas->restore();
340 }
341
342 SkBitmap bm;
343 bm.allocPixels(ii, 0);
344
345 SkAssertResult(surf->readPixels(bm, 0, 0));
346
347 bool isCorrect = true;
348 for (int y = kTopY; isCorrect && y < kBotY; ++y) {
349 const uint32_t* sl = bm.getAddr32(0, y);
350
351 for (int x = kLeftX; x < kMidX; ++x) {
352 if (SK_ColorGREEN != sl[x]) {
353 isCorrect = false;
354 break;
355 }
356 }
357
358 for (int x = kMidX; x < kRightX; ++x) {
359 if (SK_ColorGRAY != sl[x]) {
360 isCorrect = false;
361 break;
362 }
363 }
364 }
365
366 REPORTER_ASSERT(reporter, isCorrect);
367}
368// From crbug.com/768134
369DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FullScreenClearWithLayers, reporter, ctxInfo) {
Michael Ludwiga21d1962019-01-11 15:26:22 -0500370 // Regular clear
Robert Phillips6d344c32020-07-06 10:56:46 -0400371 fullscreen_clear_with_layer_test(reporter, ctxInfo.directContext());
Michael Ludwiga21d1962019-01-11 15:26:22 -0500372
373 // Use draws for clears
374 GrContextOptions options(ctxInfo.options());
375 options.fUseDrawInsteadOfClear = GrContextOptions::Enable::kYes;
376 sk_gpu_test::GrContextFactory workaroundFactory(options);
377 fullscreen_clear_with_layer_test(reporter, workaroundFactory.get(ctxInfo.type()));
Brian Salomon43f8bf02017-10-18 08:33:29 -0400378}