Rename renderTargetContextPriv to priv, and some more leftover DCs
API change is for non-public API. TBR=bsalomon@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4060 Change-Id: I5011d753c3c6d1145ff242eab6baff2ae0647ba3 Reviewed-on: https://skia-review.googlesource.com/4060 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
130863ef51
commit
693a540272
@ -195,8 +195,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
new BezierCubicOrConicTestBatch(gp, bounds, color, klmEqs, klmSigns[c]));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
++col;
|
||||
if (numCols == col) {
|
||||
@ -328,8 +327,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
new BezierCubicOrConicTestBatch(gp, bounds, color, klmEqs, 1.f));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
++col;
|
||||
if (numCols == col) {
|
||||
@ -541,8 +539,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
new BezierQuadTestBatch(gp, bounds, color, DevToUV));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
++col;
|
||||
if (numCols == col) {
|
||||
|
@ -90,8 +90,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(), bounds,
|
||||
nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
canvas->restore();
|
||||
x = x + fTestOffsetX;
|
||||
|
@ -112,8 +112,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
GrRectBatchFactory::CreateNonAAFill(grPaint.getColor(), viewMatrix,
|
||||
renderRect, nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
|
||||
// Draw labels for the input to the processor and the processor to the right of
|
||||
// the test rect. The input label appears above the processor label.
|
||||
|
@ -185,8 +185,7 @@ protected:
|
||||
|
||||
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(p.getBounds(), 0xff000000));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
|
||||
x += SkScalarCeilToScalar(path->getBounds().width() + kDX);
|
||||
}
|
||||
@ -225,8 +224,7 @@ protected:
|
||||
|
||||
SkAutoTUnref<GrDrawBatch> batch(new PolyBoundsBatch(rect, 0xff000000));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
|
||||
x += SkScalarCeilToScalar(rect.width() + kDX);
|
||||
}
|
||||
|
@ -118,8 +118,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMatrix::I(),
|
||||
bounds, nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(
|
||||
grPaint, batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
} else {
|
||||
drew = false;
|
||||
}
|
||||
|
@ -130,8 +130,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
|
||||
renderRect, nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
x += renderRect.width() + kTestPad;
|
||||
}
|
||||
y += renderRect.height() + kTestPad;
|
||||
|
@ -204,27 +204,24 @@ void WindowRectanglesMaskGM::onCoverClipStack(const SkClipStack& stack, SkCanvas
|
||||
void WindowRectanglesMaskGM::visualizeAlphaMask(GrContext* ctx, GrRenderTargetContext* rtc,
|
||||
const GrReducedClip& reducedClip,
|
||||
const GrPaint& paint) {
|
||||
sk_sp<GrRenderTargetContext> maskDC(
|
||||
sk_sp<GrRenderTargetContext> maskRTC(
|
||||
ctx->makeRenderTargetContextWithFallback(SkBackingFit::kExact, kLayerRect.width(),
|
||||
kLayerRect.height(), kAlpha_8_GrPixelConfig,
|
||||
nullptr));
|
||||
if (!maskDC ||
|
||||
!ctx->resourceProvider()->attachStencilAttachment(maskDC->accessRenderTarget())) {
|
||||
if (!maskRTC ||
|
||||
!ctx->resourceProvider()->attachStencilAttachment(maskRTC->accessRenderTarget())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw a checker pattern into the alpha mask so we can visualize the regions left untouched by
|
||||
// the clip mask generation.
|
||||
this->stencilCheckerboard(maskDC.get(), true);
|
||||
maskDC->clear(nullptr, GrColorPackA4(0xff), true);
|
||||
maskDC->renderTargetContextPriv().drawAndStencilRect(StencilOnlyClip(),
|
||||
&GrUserStencilSettings::kUnused,
|
||||
SkRegion::kDifference_Op, false, false,
|
||||
SkMatrix::I(),
|
||||
SkRect::MakeIWH(maskDC->width(),
|
||||
maskDC->height()));
|
||||
reducedClip.drawAlphaClipMask(maskDC.get());
|
||||
sk_sp<GrTexture> mask(maskDC->asTexture());
|
||||
this->stencilCheckerboard(maskRTC.get(), true);
|
||||
maskRTC->clear(nullptr, GrColorPackA4(0xff), true);
|
||||
maskRTC->priv().drawAndStencilRect(StencilOnlyClip(), &GrUserStencilSettings::kUnused,
|
||||
SkRegion::kDifference_Op, false, false, SkMatrix::I(),
|
||||
SkRect::MakeIWH(maskRTC->width(), maskRTC->height()));
|
||||
reducedClip.drawAlphaClipMask(maskRTC.get());
|
||||
sk_sp<GrTexture> mask(maskRTC->asTexture());
|
||||
|
||||
int x = kCoverRect.x() - kLayerRect.x(),
|
||||
y = kCoverRect.y() - kLayerRect.y();
|
||||
@ -266,14 +263,14 @@ void WindowRectanglesMaskGM::stencilCheckerboard(GrRenderTargetContext* rtc, boo
|
||||
0>()
|
||||
);
|
||||
|
||||
rtc->renderTargetContextPriv().clearStencilClip(GrFixedClip::Disabled(), false);
|
||||
rtc->priv().clearStencilClip(GrFixedClip::Disabled(), false);
|
||||
|
||||
for (int y = 0; y < kLayerRect.height(); y += kMaskCheckerSize) {
|
||||
for (int x = (y & 1) == flip ? 0 : kMaskCheckerSize;
|
||||
x < kLayerRect.width(); x += 2 * kMaskCheckerSize) {
|
||||
SkIRect checker = SkIRect::MakeXYWH(x, y, kMaskCheckerSize, kMaskCheckerSize);
|
||||
rtc->renderTargetContextPriv().stencilRect(GrNoClip(), &kSetClip, false, SkMatrix::I(),
|
||||
SkRect::Make(checker));
|
||||
rtc->priv().stencilRect(GrNoClip(), &kSetClip, false, SkMatrix::I(),
|
||||
SkRect::Make(checker));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,8 +125,7 @@ protected:
|
||||
SkAutoTUnref<GrDrawBatch> batch(
|
||||
GrRectBatchFactory::CreateNonAAFill(GrColor_WHITE, viewMatrix,
|
||||
renderRect, nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
x += renderRect.width() + kTestPad;
|
||||
}
|
||||
@ -238,8 +237,7 @@ protected:
|
||||
grPaint.addColorFragmentProcessor(fp);
|
||||
SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(
|
||||
GrColor_WHITE, viewMatrix, renderRect, nullptr, nullptr));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
|
||||
batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -346,8 +346,8 @@ public:
|
||||
sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); }
|
||||
|
||||
// Provides access to functions that aren't part of the public API.
|
||||
GrRenderTargetContextPriv renderTargetContextPriv();
|
||||
const GrRenderTargetContextPriv renderTargetContextPriv() const;
|
||||
GrRenderTargetContextPriv priv();
|
||||
const GrRenderTargetContextPriv priv() const;
|
||||
|
||||
GrAuditTrail* auditTrail() { return fAuditTrail; }
|
||||
|
||||
|
@ -441,7 +441,7 @@ bool GrContext::readSurfacePixels(GrSurface* src,
|
||||
// TODO: Need to decide the semantics of this function for color spaces. Do we support
|
||||
// conversion to a passed-in color space? For now, specifying nullptr means that this
|
||||
// path will do no conversion, so it will match the behavior of the non-draw path.
|
||||
sk_sp<GrRenderTargetContext> tempDC = this->makeRenderTargetContext(
|
||||
sk_sp<GrRenderTargetContext> tempRTC = this->makeRenderTargetContext(
|
||||
tempDrawInfo.fTempSurfaceFit,
|
||||
tempDrawInfo.fTempSurfaceDesc.fWidth,
|
||||
tempDrawInfo.fTempSurfaceDesc.fHeight,
|
||||
@ -449,7 +449,7 @@ bool GrContext::readSurfacePixels(GrSurface* src,
|
||||
nullptr,
|
||||
tempDrawInfo.fTempSurfaceDesc.fSampleCnt,
|
||||
tempDrawInfo.fTempSurfaceDesc.fOrigin);
|
||||
if (tempDC) {
|
||||
if (tempRTC) {
|
||||
SkMatrix textureMatrix;
|
||||
textureMatrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
|
||||
textureMatrix.postIDiv(src->width(), src->height());
|
||||
@ -462,10 +462,10 @@ bool GrContext::readSurfacePixels(GrSurface* src,
|
||||
} else if (GrGpu::kCallerPrefersDraw_DrawPreference == drawPreference) {
|
||||
// We only wanted to do the draw in order to perform the unpremul so don't
|
||||
// bother.
|
||||
tempDC.reset(nullptr);
|
||||
tempRTC.reset(nullptr);
|
||||
}
|
||||
}
|
||||
if (!fp && tempDC) {
|
||||
if (!fp && tempRTC) {
|
||||
fp = GrConfigConversionEffect::Make(src->asTexture(), tempDrawInfo.fSwizzle,
|
||||
GrConfigConversionEffect::kNone_PMConversion,
|
||||
textureMatrix);
|
||||
@ -476,8 +476,8 @@ bool GrContext::readSurfacePixels(GrSurface* src,
|
||||
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
paint.setAllowSRGBInputs(true);
|
||||
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
|
||||
tempDC->drawRect(GrNoClip(), paint, SkMatrix::I(), rect, nullptr);
|
||||
surfaceToRead.reset(tempDC->asTexture().release());
|
||||
tempRTC->drawRect(GrNoClip(), paint, SkMatrix::I(), rect, nullptr);
|
||||
surfaceToRead.reset(tempRTC->asTexture().release());
|
||||
left = 0;
|
||||
top = 0;
|
||||
didTempDraw = true;
|
||||
|
@ -535,12 +535,12 @@ static bool stencil_element(GrRenderTargetContext* rtc,
|
||||
SkDEBUGFAIL("Should never get here with an empty element.");
|
||||
break;
|
||||
case Element::kRect_Type:
|
||||
return rtc->renderTargetContextPriv().drawAndStencilRect(clip, ss,
|
||||
(SkRegion::Op)element->getOp(),
|
||||
element->isInverseFilled(),
|
||||
element->isAA(),
|
||||
viewMatrix,
|
||||
element->getRect());
|
||||
return rtc->priv().drawAndStencilRect(clip, ss,
|
||||
(SkRegion::Op)element->getOp(),
|
||||
element->isInverseFilled(),
|
||||
element->isAA(),
|
||||
viewMatrix,
|
||||
element->getRect());
|
||||
break;
|
||||
default: {
|
||||
SkPath path;
|
||||
@ -549,11 +549,11 @@ static bool stencil_element(GrRenderTargetContext* rtc,
|
||||
path.toggleInverseFillType();
|
||||
}
|
||||
|
||||
return rtc->renderTargetContextPriv().drawAndStencilPath(clip, ss,
|
||||
(SkRegion::Op)element->getOp(),
|
||||
element->isInverseFilled(),
|
||||
element->isAA(), viewMatrix,
|
||||
path);
|
||||
return rtc->priv().drawAndStencilPath(clip, ss,
|
||||
(SkRegion::Op)element->getOp(),
|
||||
element->isInverseFilled(),
|
||||
element->isAA(), viewMatrix,
|
||||
path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -601,7 +601,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->renderTargetContextPriv().clear(clip, initialCoverage, true);
|
||||
rtc->priv().clear(clip, initialCoverage, true);
|
||||
|
||||
// Set the matrix so that rendered clip elements are transformed to mask space from clip space.
|
||||
SkMatrix translate;
|
||||
@ -638,10 +638,8 @@ bool GrReducedClip::drawAlphaClipMask(GrRenderTargetContext* rtc) const {
|
||||
GrUserStencilOp::kZero,
|
||||
0xffff>()
|
||||
);
|
||||
if (!rtc->renderTargetContextPriv().drawAndStencilRect(clip, &kDrawOutsideElement,
|
||||
op, !invert, false,
|
||||
translate,
|
||||
SkRect::Make(fIBounds))) {
|
||||
if (!rtc->priv().drawAndStencilRect(clip, &kDrawOutsideElement, op, !invert, false,
|
||||
translate, SkRect::Make(fIBounds))) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
@ -706,8 +704,7 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
|
||||
}
|
||||
|
||||
bool initialState = InitialState::kAllIn == this->initialState();
|
||||
renderTargetContext->renderTargetContextPriv().clearStencilClip(stencilClip.fixedClip(),
|
||||
initialState);
|
||||
renderTargetContext->priv().clearStencilClip(stencilClip.fixedClip(), initialState);
|
||||
|
||||
// Set the matrix so that rendered clip elements are transformed from clip to stencil space.
|
||||
SkMatrix viewMatrix;
|
||||
@ -779,10 +776,8 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
|
||||
0xffff>()
|
||||
);
|
||||
if (Element::kRect_Type == element->getType()) {
|
||||
renderTargetContext->renderTargetContextPriv().stencilRect(stencilClip.fixedClip(),
|
||||
&kDrawToStencil, useHWAA,
|
||||
viewMatrix,
|
||||
element->getRect());
|
||||
renderTargetContext->priv().stencilRect(stencilClip.fixedClip(), &kDrawToStencil,
|
||||
useHWAA, viewMatrix, element->getRect());
|
||||
} else {
|
||||
if (!clipPath.isEmpty()) {
|
||||
GrShape shape(clipPath, GrStyle::SimpleFill());
|
||||
@ -821,9 +816,8 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
|
||||
for (GrUserStencilSettings const* const* pass = stencilPasses; *pass; ++pass) {
|
||||
if (drawDirectToClip) {
|
||||
if (Element::kRect_Type == element->getType()) {
|
||||
renderTargetContext->renderTargetContextPriv().stencilRect(stencilClip, *pass,
|
||||
useHWAA, viewMatrix,
|
||||
element->getRect());
|
||||
renderTargetContext->priv().stencilRect(stencilClip, *pass, useHWAA, viewMatrix,
|
||||
element->getRect());
|
||||
} else {
|
||||
GrShape shape(clipPath, GrStyle::SimpleFill());
|
||||
GrPaint paint;
|
||||
@ -844,9 +838,8 @@ bool GrReducedClip::drawStencilClipMask(GrContext* context,
|
||||
} else {
|
||||
// The view matrix is setup to do clip space -> stencil space translation, so
|
||||
// draw rect in clip space.
|
||||
renderTargetContext->renderTargetContextPriv().stencilRect(stencilClip, *pass,
|
||||
false, viewMatrix,
|
||||
SkRect::Make(fIBounds));
|
||||
renderTargetContext->priv().stencilRect(stencilClip, *pass, false, viewMatrix,
|
||||
SkRect::Make(fIBounds));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,11 +78,11 @@ private:
|
||||
friend class GrRenderTargetContext; // to construct/copy this type.
|
||||
};
|
||||
|
||||
inline GrRenderTargetContextPriv GrRenderTargetContext::renderTargetContextPriv() {
|
||||
inline GrRenderTargetContextPriv GrRenderTargetContext::priv() {
|
||||
return GrRenderTargetContextPriv(this);
|
||||
}
|
||||
|
||||
inline const GrRenderTargetContextPriv GrRenderTargetContext::renderTargetContextPriv () const {
|
||||
inline const GrRenderTargetContextPriv GrRenderTargetContext::priv() const {
|
||||
return GrRenderTargetContextPriv(const_cast<GrRenderTargetContext*>(this));
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ private:
|
||||
GrXferProcessor::DstTexture*,
|
||||
const SkRect& batchBounds);
|
||||
|
||||
// Used only by renderTargetContextPriv.
|
||||
// Used only via GrRenderTargetContextPriv.
|
||||
void clearStencilClip(const GrFixedClip&, bool insideStencilMask, GrRenderTarget*);
|
||||
|
||||
struct RecordedBatch {
|
||||
|
@ -36,9 +36,9 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
|
||||
|
||||
GrPixelConfig config = GrMakePixelConfigUncompressed(inputTexture->config());
|
||||
|
||||
sk_sp<GrRenderTargetContext> copyDC = context->makeRenderTargetContextWithFallback(
|
||||
sk_sp<GrRenderTargetContext> copyRTC = context->makeRenderTargetContextWithFallback(
|
||||
SkBackingFit::kExact, copyParams.fWidth, copyParams.fHeight, config, nullptr);
|
||||
if (!copyDC) {
|
||||
if (!copyRTC) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -84,8 +84,8 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
|
||||
}
|
||||
|
||||
SkRect dstRect = SkRect::MakeIWH(copyParams.fWidth, copyParams.fHeight);
|
||||
copyDC->fillRectToRect(GrNoClip(), paint, SkMatrix::I(), dstRect, localRect);
|
||||
return copyDC->asTexture().release();
|
||||
copyRTC->fillRectToRect(GrNoClip(), paint, SkMatrix::I(), dstRect, localRect);
|
||||
return copyRTC->asTexture().release();
|
||||
}
|
||||
|
||||
GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, SkAlphaType alphaType,
|
||||
|
@ -243,16 +243,16 @@ void SkGpuDevice::clearAll() {
|
||||
void SkGpuDevice::replaceRenderTargetContext(bool shouldRetainContent) {
|
||||
ASSERT_SINGLE_OWNER
|
||||
|
||||
SkBudgeted budgeted = fRenderTargetContext->renderTargetContextPriv().isBudgeted();
|
||||
SkBudgeted budgeted = fRenderTargetContext->priv().isBudgeted();
|
||||
|
||||
sk_sp<GrRenderTargetContext> newDC(MakeRenderTargetContext(
|
||||
sk_sp<GrRenderTargetContext> newRTC(MakeRenderTargetContext(
|
||||
this->context(),
|
||||
budgeted,
|
||||
this->imageInfo(),
|
||||
fRenderTargetContext->numColorSamples(),
|
||||
fRenderTargetContext->origin(),
|
||||
&this->surfaceProps()));
|
||||
if (!newDC) {
|
||||
if (!newRTC) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -260,12 +260,12 @@ void SkGpuDevice::replaceRenderTargetContext(bool shouldRetainContent) {
|
||||
if (fRenderTargetContext->wasAbandoned()) {
|
||||
return;
|
||||
}
|
||||
newDC->copySurface(fRenderTargetContext->asTexture().get(),
|
||||
SkIRect::MakeWH(this->width(), this->height()),
|
||||
SkIPoint::Make(0, 0));
|
||||
newRTC->copySurface(fRenderTargetContext->asTexture().get(),
|
||||
SkIRect::MakeWH(this->width(), this->height()),
|
||||
SkIPoint::Make(0, 0));
|
||||
}
|
||||
|
||||
fRenderTargetContext = newDC;
|
||||
fRenderTargetContext = newRTC;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -83,8 +83,7 @@ void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
|
||||
SkASSERT(!args.fIsAA || args.fRenderTargetContext->isStencilBufferMultisampled());
|
||||
|
||||
SkAutoTUnref<GrPath> p(get_gr_path(fResourceProvider, *args.fShape));
|
||||
args.fRenderTargetContext->renderTargetContextPriv().stencilPath(*args.fClip, args.fIsAA,
|
||||
*args.fViewMatrix, p);
|
||||
args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fIsAA, *args.fViewMatrix, p);
|
||||
}
|
||||
|
||||
bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||
@ -125,9 +124,8 @@ bool GrStencilAndCoverPathRenderer::onDrawPath(const DrawPathArgs& args) {
|
||||
nullptr, &invert));
|
||||
|
||||
// fake inverse with a stencil and cover
|
||||
args.fRenderTargetContext->renderTargetContextPriv().stencilPath(*args.fClip,
|
||||
args.fPaint->isAntiAlias(),
|
||||
viewMatrix, path);
|
||||
args.fRenderTargetContext->priv().stencilPath(*args.fClip, args.fPaint->isAntiAlias(),
|
||||
viewMatrix, path);
|
||||
|
||||
{
|
||||
static constexpr GrUserStencilSettings kInvertedCoverPass(
|
||||
|
@ -184,13 +184,13 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
|
||||
}
|
||||
}
|
||||
|
||||
sk_sp<GrRenderTargetContext> readDC(context->makeRenderTargetContext(SkBackingFit::kExact,
|
||||
kSize, kSize,
|
||||
kConfig, nullptr));
|
||||
sk_sp<GrRenderTargetContext> tempDC(context->makeRenderTargetContext(SkBackingFit::kExact,
|
||||
kSize, kSize,
|
||||
kConfig, nullptr));
|
||||
if (!readDC || !tempDC) {
|
||||
sk_sp<GrRenderTargetContext> readRTC(context->makeRenderTargetContext(SkBackingFit::kExact,
|
||||
kSize, kSize,
|
||||
kConfig, nullptr));
|
||||
sk_sp<GrRenderTargetContext> tempRTC(context->makeRenderTargetContext(SkBackingFit::kExact,
|
||||
kSize, kSize,
|
||||
kConfig, nullptr));
|
||||
if (!readRTC || !tempRTC) {
|
||||
return;
|
||||
}
|
||||
GrSurfaceDesc desc;
|
||||
@ -226,28 +226,28 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context
|
||||
sk_sp<GrFragmentProcessor> pmToUPM1(new GrConfigConversionEffect(
|
||||
dataTex, GrSwizzle::RGBA(), *pmToUPMRule, SkMatrix::I()));
|
||||
sk_sp<GrFragmentProcessor> upmToPM(new GrConfigConversionEffect(
|
||||
readDC->asTexture().get(), GrSwizzle::RGBA(), *upmToPMRule, SkMatrix::I()));
|
||||
readRTC->asTexture().get(), GrSwizzle::RGBA(), *upmToPMRule, SkMatrix::I()));
|
||||
sk_sp<GrFragmentProcessor> pmToUPM2(new GrConfigConversionEffect(
|
||||
tempDC->asTexture().get(), GrSwizzle::RGBA(), *pmToUPMRule, SkMatrix::I()));
|
||||
tempRTC->asTexture().get(), GrSwizzle::RGBA(), *pmToUPMRule, SkMatrix::I()));
|
||||
|
||||
paint1.addColorFragmentProcessor(std::move(pmToUPM1));
|
||||
paint1.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
readDC->fillRectToRect(GrNoClip(), paint1, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
readRTC->fillRectToRect(GrNoClip(), paint1, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
|
||||
readDC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, firstRead);
|
||||
readRTC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, firstRead);
|
||||
|
||||
paint2.addColorFragmentProcessor(std::move(upmToPM));
|
||||
paint2.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
tempDC->fillRectToRect(GrNoClip(), paint2, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
tempRTC->fillRectToRect(GrNoClip(), paint2, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
|
||||
paint3.addColorFragmentProcessor(std::move(pmToUPM2));
|
||||
paint3.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
readDC->fillRectToRect(GrNoClip(), paint3, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
readRTC->fillRectToRect(GrNoClip(), paint3, SkMatrix::I(), kDstRect, kSrcRect);
|
||||
|
||||
readDC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, secondRead);
|
||||
readRTC->asTexture()->readPixels(0, 0, kSize, kSize, kConfig, secondRead);
|
||||
|
||||
failed = false;
|
||||
for (int y = 0; y < kSize && !failed; ++y) {
|
||||
|
@ -340,8 +340,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
|
||||
bool snapToCenters = set_random_state(&grPaint, &random);
|
||||
const GrUserStencilSettings* uss = get_random_stencil(&random);
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint, batch, uss,
|
||||
snapToCenters);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch, uss, snapToCenters);
|
||||
}
|
||||
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
|
||||
drawingManager->flush();
|
||||
@ -375,7 +374,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
|
||||
BlockInputFragmentProcessor::Make(std::move(fp)));
|
||||
grPaint.addColorFragmentProcessor(std::move(blockFP));
|
||||
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint, batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
drawingManager->flush();
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
|
||||
GrPaint grPaint;
|
||||
// This one should succeed.
|
||||
batch.reset(new Batch(attribCnt));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint, batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
context->flush();
|
||||
#if GR_GPU_STATS
|
||||
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 1);
|
||||
@ -136,7 +136,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
|
||||
context->resetGpuStats();
|
||||
// This one should fail.
|
||||
batch.reset(new Batch(attribCnt+1));
|
||||
renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint, batch);
|
||||
renderTargetContext->priv().testingOnly_drawBatch(grPaint, batch);
|
||||
context->flush();
|
||||
#if GR_GPU_STATS
|
||||
REPORTER_ASSERT(reporter, context->getGpu()->stats()->numDraws() == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user