Prefer fullscreen clears on Qualcomm/GL

Adds Qualcomm to the set of GL devices on which we prefer fullscreen
clears.

Renames fullscreenClearIsFree in GrCaps to preferFullscreenClears.

Replaces 'bool canIgnoreClip' on GrRenderTargetContext::clear with an
enum.

Bug: skia:
Change-Id: I5b30298c4d0b092c398b9fea6060f3e2bea91e46
Reviewed-on: https://skia-review.googlesource.com/83060
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2017-12-11 15:42:09 -07:00 committed by Skia Commit-Bot
parent 6e64f30891
commit 344e9037e1
22 changed files with 78 additions and 60 deletions

View File

@ -210,7 +210,7 @@ void WindowRectanglesMaskGM::visualizeAlphaMask(GrContext* ctx, GrRenderTargetCo
// Draw a checker pattern into the alpha mask so we can visualize the regions left untouched by
// the clip mask generation.
this->stencilCheckerboard(maskRTC.get(), true);
maskRTC->clear(nullptr, GrColorPackA4(0xff), true);
maskRTC->clear(nullptr, GrColorPackA4(0xff), GrRenderTargetContext::CanClearFullscreen::kYes);
maskRTC->priv().drawAndStencilRect(make_stencil_only_clip(), &GrUserStencilSettings::kUnused,
SkRegion::kDifference_Op, false, GrAA::kNo, SkMatrix::I(),
SkRect::MakeIWH(maskRTC->width(), maskRTC->height()));

View File

@ -55,6 +55,10 @@ public:
bool usesMixedSamples() const { return fUsesMixedSamples; }
bool preferClientSideDynamicBuffers() const { return fPreferClientSideDynamicBuffers; }
// On tilers, an initial fullscreen clear is an OPTIMIZATION. It allows the hardware to
// initialize each tile with a constant value rather than loading each pixel from memory.
bool preferFullscreenClears() const { return fPreferFullscreenClears; }
bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; }
bool blacklistCoverageCounting() const { return fBlacklistCoverageCounting; }
@ -144,8 +148,6 @@ public:
return fBufferMapThreshold;
}
bool fullClearIsFree() const { return fFullClearIsFree; }
/** True in environments that will issue errors if memory uploaded to buffers
is not initialized (even if not read by draw calls). */
bool mustClearUploadedBufferData() const { return fMustClearUploadedBufferData; }
@ -192,7 +194,7 @@ protected:
bool fInstanceAttribSupport : 1;
bool fUsesMixedSamples : 1;
bool fPreferClientSideDynamicBuffers : 1;
bool fFullClearIsFree : 1;
bool fPreferFullscreenClears : 1;
bool fMustClearUploadedBufferData : 1;
// Driver workaround

View File

@ -162,11 +162,11 @@ static void convolve_gaussian(GrRenderTargetContext* renderTargetContext,
dstRect.fRight = midRect.right();
}
if (!topRect.isEmpty()) {
renderTargetContext->clear(&topRect, 0, false);
renderTargetContext->clear(&topRect, 0, GrRenderTargetContext::CanClearFullscreen::kNo);
}
if (!bottomRect.isEmpty()) {
renderTargetContext->clear(&bottomRect, 0, false);
renderTargetContext->clear(&bottomRect, 0, GrRenderTargetContext::CanClearFullscreen::kNo);
}
if (midRect.isEmpty()) {

View File

@ -115,7 +115,7 @@ sk_sp<GrTextureProxy> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* c
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
SkRegion::Iterator iter(fRegion);
rtContext->clear(nullptr, 0x0, true);
rtContext->clear(nullptr, 0x0, GrRenderTargetContext::CanClearFullscreen::kYes);
GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height()));
while (!iter.done()) {

View File

@ -882,7 +882,7 @@ static sk_sp<GrTextureProxy> find_or_create_rrect_blur_mask(GrContext* context,
GrPaint paint;
rtc->clear(nullptr, 0x0, true);
rtc->clear(nullptr, 0x0, GrRenderTargetContext::CanClearFullscreen::kYes);
rtc->drawRRect(GrNoClip(), std::move(paint), GrAA::kYes, SkMatrix::I(), rrectToDraw,
GrStyle::SimpleFill());

View File

@ -509,7 +509,7 @@ static sk_sp<SkSpecialImage> apply_morphology(
dstRect.width(), radius.fHeight);
GrColor clearColor =
GrMorphologyEffect::Type::kErode == morphType ? SK_ColorWHITE : SK_ColorTRANSPARENT;
dstRTContext->clear(&clearRect, clearColor, false);
dstRTContext->clear(&clearRect, clearColor, GrRenderTargetContext::CanClearFullscreen::kNo);
srcTexture = dstRTContext->asTextureProxyRef();
srcRect = dstRect;

View File

@ -53,7 +53,7 @@ GrCaps::GrCaps(const GrContextOptions& options) {
fInstanceAttribSupport = false;
fUsesMixedSamples = false;
fPreferClientSideDynamicBuffers = false;
fFullClearIsFree = false;
fPreferFullscreenClears = false;
fMustClearUploadedBufferData = false;
fSampleShadingSupport = false;
fFenceSyncSupport = false;
@ -150,7 +150,7 @@ void GrCaps::dumpJSON(SkJSONWriter* writer) const {
writer->appendBool("Instance Attrib Support", fInstanceAttribSupport);
writer->appendBool("Uses Mixed Samples", fUsesMixedSamples);
writer->appendBool("Prefer client-side dynamic buffers", fPreferClientSideDynamicBuffers);
writer->appendBool("Full screen clear is free", fFullClearIsFree);
writer->appendBool("Prefer fullscreen clears", fPreferFullscreenClears);
writer->appendBool("Must clear buffer memory", fMustClearUploadedBufferData);
writer->appendBool("Sample shading support", fSampleShadingSupport);
writer->appendBool("Fence sync support", fFenceSyncSupport);

View File

@ -746,7 +746,7 @@ bool GrReducedClip::drawAlphaClipMask(GrRenderTargetContext* rtc) const {
// The scratch texture that we are drawing into can be substantially larger than the mask. Only
// clear the part that we care about.
GrColor initialCoverage = InitialState::kAllIn == this->initialState() ? -1 : 0;
rtc->priv().clear(clip, initialCoverage, true);
rtc->priv().clear(clip, initialCoverage, GrRenderTargetContext::CanClearFullscreen::kYes);
// Set the matrix so that rendered clip elements are transformed to mask space from clip space.
SkMatrix translate;

View File

@ -272,14 +272,15 @@ void GrRenderTargetContext::discard() {
void GrRenderTargetContext::clear(const SkIRect* rect,
const GrColor color,
bool canIgnoreRect) {
CanClearFullscreen canClearFullscreen) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "clear", fContext);
AutoCheckFlush acf(this->drawingManager());
this->internalClear(rect ? GrFixedClip(*rect) : GrFixedClip::Disabled(), color, canIgnoreRect);
this->internalClear(rect ? GrFixedClip(*rect) : GrFixedClip::Disabled(), color,
canClearFullscreen);
}
void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const GrColor color) {
@ -319,7 +320,7 @@ void GrRenderTargetContextPriv::absClear(const SkIRect* clearRect, const GrColor
void GrRenderTargetContextPriv::clear(const GrFixedClip& clip,
const GrColor color,
bool canIgnoreClip) {
CanClearFullscreen canClearFullscreen) {
ASSERT_SINGLE_OWNER_PRIV
RETURN_IF_ABANDONED_PRIV
SkDEBUGCODE(fRenderTargetContext->validate();)
@ -327,16 +328,17 @@ void GrRenderTargetContextPriv::clear(const GrFixedClip& clip,
fRenderTargetContext->fContext);
AutoCheckFlush acf(fRenderTargetContext->drawingManager());
fRenderTargetContext->internalClear(clip, color, canIgnoreClip);
fRenderTargetContext->internalClear(clip, color, canClearFullscreen);
}
void GrRenderTargetContext::internalClear(const GrFixedClip& clip,
const GrColor color,
bool canIgnoreClip) {
CanClearFullscreen canClearFullscreen) {
bool isFull = false;
if (!clip.hasWindowRectangles()) {
isFull = !clip.scissorEnabled() ||
(canIgnoreClip && fContext->caps()->fullClearIsFree()) ||
(CanClearFullscreen::kYes == canClearFullscreen &&
fContext->caps()->preferFullscreenClears()) ||
clip.scissorRect().contains(SkIRect::MakeWH(this->width(), this->height()));
}
@ -519,7 +521,8 @@ void GrRenderTargetContext::drawRect(const GrClip& clip,
// Will it blend?
GrColor clearColor;
if (paint.isConstantBlendedColor(&clearColor)) {
this->clear(nullptr, clearColor, true);
this->clear(nullptr, clearColor,
GrRenderTargetContext::CanClearFullscreen::kYes);
return;
}
}

View File

@ -79,14 +79,19 @@ public:
*/
void discard();
enum class CanClearFullscreen : bool {
kNo = false,
kYes = true
};
/**
* Clear the entire or rect of the render target, ignoring any clips.
* @param rect the rect to clear or the whole thing if rect is NULL.
* @param color the color to clear to.
* @param canIgnoreRect allows partial clears to be converted to whole
* clears on platforms for which that is cheap
* @param CanClearFullscreen allows partial clears to be converted to fullscreen clears on
* tiling platforms where that is an optimization.
*/
void clear(const SkIRect* rect, GrColor color, bool canIgnoreRect);
void clear(const SkIRect* rect, GrColor color, CanClearFullscreen);
/**
* Draw everywhere (respecting the clip) with the paint.
@ -409,7 +414,7 @@ private:
friend void test_draw_op(GrRenderTargetContext*, std::unique_ptr<GrFragmentProcessor>,
sk_sp<GrTextureProxy>);
void internalClear(const GrFixedClip&, const GrColor, bool canIgnoreClip);
void internalClear(const GrFixedClip&, const GrColor, CanClearFullscreen);
// Only consumes the GrPaint if successful.
bool drawFilledDRRect(const GrClip& clip,

View File

@ -43,7 +43,9 @@ public:
opList->fLastClipNumAnalyticFPs != numClipAnalyticFPs;
}
void clear(const GrFixedClip&, const GrColor, bool canIgnoreClip);
using CanClearFullscreen = GrRenderTargetContext::CanClearFullscreen;
void clear(const GrFixedClip&, const GrColor, CanClearFullscreen);
void clearStencilClip(const GrFixedClip&, bool insideStencilMask);

View File

@ -232,7 +232,7 @@ void SkGpuDevice::clearAll() {
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "clearAll", fContext.get());
SkIRect rect = SkIRect::MakeWH(this->width(), this->height());
fRenderTargetContext->clear(&rect, 0x0, true);
fRenderTargetContext->clear(&rect, 0x0, GrRenderTargetContext::CanClearFullscreen::kYes);
}
void SkGpuDevice::replaceRenderTargetContext(bool shouldRetainContent) {

View File

@ -116,7 +116,7 @@ sk_sp<GrRenderTargetContext> GrCCPRAtlas::finalize(GrOnFlushResourceProvider* on
}
SkIRect clearRect = SkIRect::MakeSize(fDrawBounds);
rtc->clear(&clearRect, 0, true);
rtc->clear(&clearRect, 0, GrRenderTargetContext::CanClearFullscreen::kYes);
rtc->addDrawOp(GrNoClip(), std::move(atlasOp));
fTextureProxy = sk_ref_sp(rtc->asTextureProxy());

View File

@ -152,8 +152,10 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fInvalidateFBType = kDiscard_InvalidateFBType;
}
if (kARM_GrGLVendor == ctxInfo.vendor() || kImagination_GrGLVendor == ctxInfo.vendor()) {
fFullClearIsFree = true;
if (kARM_GrGLVendor == ctxInfo.vendor() ||
kImagination_GrGLVendor == ctxInfo.vendor() ||
kQualcomm_GrGLVendor == ctxInfo.vendor() ) {
fPreferFullscreenClears = true;
}
if (kGL_GrGLStandard == standard) {

View File

@ -79,7 +79,7 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Check a full clear
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -89,8 +89,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Check two full clears, same color
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -100,8 +100,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Check two full clears, different colors
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&fullRect, kColor2, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&fullRect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor2, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
failX, failY);
@ -111,8 +111,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Test a full clear followed by a same color inset clear
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid1Rect, kColor1, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid1Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -122,8 +122,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Test a inset clear followed by same color full clear
rtContext->clear(&mid1Rect, kColor1, false);
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid1Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -133,8 +133,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Test a full clear followed by a different color inset clear
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid1Rect, kColor2, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
failX, failY);
@ -151,8 +151,8 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Test a inset clear followed by a different full clear
rtContext->clear(&mid1Rect, kColor2, false);
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), fullRect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -163,9 +163,9 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
// Check three nested clears from largest to smallest where outermost and innermost are same
// color.
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid1Rect, kColor2, false);
rtContext->clear(&mid2Rect, kColor1, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid2Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), mid2Rect, kColor1, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor1, actualValue,
failX, failY);
@ -189,9 +189,9 @@ static void clear_op_test(skiatest::Reporter* reporter, GrContext* context) {
SkASSERT(rtContext);
// Swap the order of the second two clears in the above test.
rtContext->clear(&fullRect, kColor1, false);
rtContext->clear(&mid2Rect, kColor1, false);
rtContext->clear(&mid1Rect, kColor2, false);
rtContext->clear(&fullRect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid2Rect, kColor1, GrRenderTargetContext::CanClearFullscreen::kNo);
rtContext->clear(&mid1Rect, kColor2, GrRenderTargetContext::CanClearFullscreen::kNo);
if (!check_rect(rtContext.get(), mid1Rect, kColor2, &actualValue, &failX, &failY)) {
ERRORF(reporter, "Expected 0x%08x but got 0x%08x at (%d, %d).", kColor2, actualValue,
failX, failY);

View File

@ -71,7 +71,8 @@ static void run_test(GrContext* ctx, skiatest::Reporter* reporter) {
kBigSize/2+1, kBigSize/2+1,
kRGBA_8888_GrPixelConfig, nullptr);
rtc->clear(nullptr, GrColorPackRGBA(0x0, 0x0, 0x0, 0xFF), true);
rtc->clear(nullptr, GrColorPackRGBA(0x0, 0x0, 0x0, 0xFF),
GrRenderTargetContext::CanClearFullscreen::kYes);
GrPaint paint;
@ -89,7 +90,8 @@ static void run_test(GrContext* ctx, skiatest::Reporter* reporter) {
auto rtc = ctx->makeDeferredRenderTargetContext(SkBackingFit::kExact, kBigSize, kBigSize,
kRGBA_8888_GrPixelConfig, nullptr);
rtc->clear(nullptr, GrColorPackRGBA(0x0, 0x0, 0x0, 0xFF), true);
rtc->clear(nullptr, GrColorPackRGBA(0x0, 0x0, 0x0, 0xFF),
GrRenderTargetContext::CanClearFullscreen::kYes);
GrPaint paint;

View File

@ -69,7 +69,7 @@ public:
}
bool valid() const { return fCCPR && fRTC; }
void clear() const { fRTC->clear(nullptr, 0, true); }
void clear() const { fRTC->clear(nullptr, 0, GrRenderTargetContext::CanClearFullscreen::kYes); }
void abandonGrContext() { fCtx = nullptr; fCCPR = nullptr; fRTC = nullptr; }
void drawPath(SkPath path, GrColor4f color = GrColor4f(0, 1, 0, 1)) const {

View File

@ -389,7 +389,7 @@ static void run_test(const char* testName, skiatest::Reporter* reporter,
}
SkAutoSTMalloc<kImageHeight * kImageWidth, uint32_t> resultPx(h * rowBytes);
rtc->clear(nullptr, 0xbaaaaaad, true);
rtc->clear(nullptr, 0xbaaaaaad, GrRenderTargetContext::CanClearFullscreen::kYes);
rtc->priv().testingOnly_addDrawOp(skstd::make_unique<GrMeshTestOp>(testFn));
rtc->readPixels(gold.info(), resultPx, rowBytes, 0, 0, 0);
for (int y = 0; y < h; ++y) {

View File

@ -192,7 +192,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrPipelineDynamicStateTest, reporter, ctxInfo
uint32_t resultPx[kScreenSize * kScreenSize];
for (ScissorState scissorState : {ScissorState::kEnabled, ScissorState::kDisabled}) {
rtc->clear(nullptr, 0xbaaaaaad, true);
rtc->clear(nullptr, 0xbaaaaaad, GrRenderTargetContext::CanClearFullscreen::kYes);
rtc->priv().testingOnly_addDrawOp(
skstd::make_unique<GrPipelineDynamicStateTestOp>(scissorState, vbuff));
rtc->readPixels(SkImageInfo::Make(kScreenSize, kScreenSize,

View File

@ -262,7 +262,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) {
if (!fp) {
return;
}
rtContext->clear(nullptr, 0xDDAABBCC, true);
rtContext->clear(nullptr, 0xDDAABBCC, GrRenderTargetContext::CanClearFullscreen::kYes);
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
paint.addColorFragmentProcessor(std::move(fp));

View File

@ -329,7 +329,8 @@ public:
nullptr, nullptr);
#endif
rtc->clear(nullptr, 0xFFFFFFFF, true); // clear the atlas
// clear the atlas
rtc->clear(nullptr, 0xFFFFFFFF, GrRenderTargetContext::CanClearFullscreen::kYes);
int blocksInAtlas = 0;
for (int i = 0; i < lists.count(); ++i) {
@ -339,7 +340,7 @@ public:
// For now, we avoid the resource buffer issues and just use clears
#if 1
rtc->clear(&r, op->color(), false);
rtc->clear(&r, op->color(), GrRenderTargetContext::CanClearFullscreen::kNo);
#else
GrPaint paint;
paint.setColor4f(GrColor4f::FromGrColor(op->color()));
@ -410,7 +411,8 @@ static sk_sp<GrTextureProxy> make_upstream_image(GrContext* context, AtlasObject
kRGBA_8888_GrPixelConfig,
nullptr));
rtc->clear(nullptr, GrColorPackRGBA(255, 0, 0, 255), true);
rtc->clear(nullptr, GrColorPackRGBA(255, 0, 0, 255),
GrRenderTargetContext::CanClearFullscreen::kYes);
for (int i = 0; i < 3; ++i) {
SkRect r = SkRect::MakeXYWH(i*kDrawnTileSize, 0, kDrawnTileSize, kDrawnTileSize);
@ -539,7 +541,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(OnFlushCallbackTest, reporter, ctxInfo) {
kRGBA_8888_GrPixelConfig,
nullptr));
rtc->clear(nullptr, 0xFFFFFFFF, true);
rtc->clear(nullptr, 0xFFFFFFFF, GrRenderTargetContext::CanClearFullscreen::kYes);
// Note that this doesn't include the third texture proxy
for (int i = 0; i < kNumProxies-1; ++i) {

View File

@ -28,7 +28,7 @@ static void test_basic_draw_as_src(skiatest::Reporter* reporter, GrContext* cont
for (auto filter : {GrSamplerState::Filter::kNearest,
GrSamplerState::Filter::kBilerp,
GrSamplerState::Filter::kMipMap}) {
rtContext->clear(nullptr, 0xDDCCBBAA, true);
rtContext->clear(nullptr, 0xDDCCBBAA, GrRenderTargetContext::CanClearFullscreen::kYes);
auto fp = GrSimpleTextureEffect::Make(rectProxy, SkMatrix::I(), filter);
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
@ -43,7 +43,7 @@ static void test_clear(skiatest::Reporter* reporter, GrSurfaceContext* rectConte
if (GrRenderTargetContext* rtc = rectContext->asRenderTargetContext()) {
// Clear the whole thing.
GrColor color0 = GrColorPackRGBA(0xA, 0xB, 0xC, 0xD);
rtc->clear(nullptr, color0, false);
rtc->clear(nullptr, color0, GrRenderTargetContext::CanClearFullscreen::kNo);
int w = rtc->width();
int h = rtc->height();
@ -64,7 +64,7 @@ static void test_clear(skiatest::Reporter* reporter, GrSurfaceContext* rectConte
// Clear the the top to a different color.
GrColor color1 = GrColorPackRGBA(0x1, 0x2, 0x3, 0x4);
SkIRect rect = SkIRect::MakeWH(w, h/2);
rtc->clear(&rect, color1, false);
rtc->clear(&rect, color1, GrRenderTargetContext::CanClearFullscreen::kNo);
uint32_t expectedColor1 = 0;
uint8_t* expectedBytes1 = SkTCast<uint8_t*>(&expectedColor1);