whole-word replace renderTargetContext with surfaceDrawContext
TBR:egdaniel@google.com
Change-Id: Ia471dfc1278bcbeb2b485e4deeb3e932060c50a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343576
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index d22b90b..cc76998 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -39,7 +39,7 @@
// Draw a mask using the supplied paint. Since the coverage/geometry
// is already burnt into the mask this boils down to a rect draw.
// Return true if the mask was successfully drawn.
-static bool draw_mask(GrSurfaceDrawContext* renderTargetContext,
+static bool draw_mask(GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
const SkMatrix& viewMatrix,
const SkIRect& maskRect,
@@ -56,8 +56,8 @@
paint.setCoverageFragmentProcessor(
GrTextureEffect::Make(std::move(mask), kUnknown_SkAlphaType, matrix));
- renderTargetContext->fillRectWithLocalMatrix(clip, std::move(paint), GrAA::kNo, SkMatrix::I(),
- SkRect::Make(maskRect), inverse);
+ surfaceDrawContext->fillRectWithLocalMatrix(clip, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(maskRect), inverse);
return true;
}
@@ -177,7 +177,7 @@
return filteredMaskView;
}
-// Create a mask of 'shape' and return the resulting renderTargetContext
+// Create a mask of 'shape' and return the resulting surfaceDrawContext
static std::unique_ptr<GrSurfaceDrawContext> create_mask_GPU(GrRecordingContext* context,
const SkIRect& maskRect,
const SkMatrix& origViewMatrix,
@@ -243,7 +243,7 @@
// Gets the shape bounds, the clip bounds, and the intersection (if any). Returns false if there
// is no intersection.
-static bool get_shape_and_clip_bounds(GrSurfaceDrawContext* renderTargetContext,
+static bool get_shape_and_clip_bounds(GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
const GrStyledShape& shape,
const SkMatrix& matrix,
@@ -251,8 +251,8 @@
SkIRect* devClipBounds) {
// compute bounds as intersection of rt size, clip, and path
*devClipBounds = clip ? clip->getConservativeBounds()
- : SkIRect::MakeWH(renderTargetContext->width(),
- renderTargetContext->height());
+ : SkIRect::MakeWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
if (!get_unclipped_shape_dev_bounds(shape, matrix, unclippedDevShapeBounds)) {
*unclippedDevShapeBounds = SkIRect::MakeEmpty();
@@ -350,7 +350,7 @@
}
static GrSurfaceProxyView hw_create_filtered_mask(GrDirectContext* dContext,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const SkMatrix& viewMatrix,
const GrStyledShape& shape,
const SkMaskFilterBase* filter,
@@ -404,7 +404,7 @@
*maskRect,
viewMatrix,
shape,
- renderTargetContext->numSamples()));
+ surfaceDrawContext->numSamples()));
if (!maskRTC) {
if (key->isValid()) {
// It is very unlikely that 'create_mask_GPU' will fail after 'CreateLazyView'
@@ -445,7 +445,7 @@
}
static void draw_shape_with_mask_filter(GrRecordingContext* rContext,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
GrPaint&& paint,
const SkMatrix& viewMatrix,
@@ -470,7 +470,7 @@
shape = tmpShape.get();
}
- if (maskFilter->directFilterMaskGPU(rContext, renderTargetContext, std::move(paint), clip,
+ if (maskFilter->directFilterMaskGPU(rContext, surfaceDrawContext, std::move(paint), clip,
viewMatrix, *shape)) {
// the mask filter was able to draw itself directly, so there's nothing
// left to do.
@@ -484,7 +484,7 @@
viewMatrix, nullptr);
SkIRect unclippedDevShapeBounds, devClipBounds;
- if (!get_shape_and_clip_bounds(renderTargetContext, clip, *shape, viewMatrix,
+ if (!get_shape_and_clip_bounds(surfaceDrawContext, clip, *shape, viewMatrix,
&unclippedDevShapeBounds, &devClipBounds)) {
// TODO: just cons up an opaque mask here
if (!inverseFilled) {
@@ -495,7 +495,7 @@
GrUniqueKey maskKey;
SkIRect boundsForClip;
if (!compute_key_and_clip_bounds(&maskKey, &boundsForClip,
- renderTargetContext->caps(),
+ surfaceDrawContext->caps(),
viewMatrix, inverseFilled,
maskFilter, *shape,
unclippedDevShapeBounds,
@@ -507,12 +507,12 @@
SkIRect maskRect;
if (auto dContext = rContext->asDirectContext()) {
- filteredMaskView = hw_create_filtered_mask(dContext, renderTargetContext,
+ filteredMaskView = hw_create_filtered_mask(dContext, surfaceDrawContext,
viewMatrix, *shape, maskFilter,
unclippedDevShapeBounds, boundsForClip,
&maskRect, &maskKey);
if (filteredMaskView) {
- if (draw_mask(renderTargetContext, clip, viewMatrix, maskRect, std::move(paint),
+ if (draw_mask(surfaceDrawContext, clip, viewMatrix, maskRect, std::move(paint),
std::move(filteredMaskView))) {
// This path is completely drawn
return;
@@ -527,7 +527,7 @@
unclippedDevShapeBounds, boundsForClip,
&maskRect, &maskKey);
if (filteredMaskView) {
- if (draw_mask(renderTargetContext, clip, viewMatrix, maskRect, std::move(paint),
+ if (draw_mask(surfaceDrawContext, clip, viewMatrix, maskRect, std::move(paint),
std::move(filteredMaskView))) {
return;
}
@@ -536,18 +536,18 @@
}
void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
const GrStyledShape& shape,
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkMaskFilter* mf) {
- draw_shape_with_mask_filter(context, renderTargetContext, clip, std::move(paint),
+ draw_shape_with_mask_filter(context, surfaceDrawContext, clip, std::move(paint),
viewMatrix, as_MFB(mf), shape);
}
void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
const SkPaint& paint,
const SkMatrixProvider& matrixProvider,
@@ -557,7 +557,7 @@
}
GrPaint grPaint;
- if (!SkPaintToGrPaint(context, renderTargetContext->colorInfo(), paint, matrixProvider,
+ if (!SkPaintToGrPaint(context, surfaceDrawContext->colorInfo(), paint, matrixProvider,
&grPaint)) {
return;
}
@@ -566,10 +566,10 @@
SkMaskFilterBase* mf = as_MFB(paint.getMaskFilter());
if (mf && !mf->hasFragmentProcessor()) {
// The MaskFilter wasn't already handled in SkPaintToGrPaint
- draw_shape_with_mask_filter(context, renderTargetContext, clip, std::move(grPaint),
+ draw_shape_with_mask_filter(context, surfaceDrawContext, clip, std::move(grPaint),
viewMatrix, mf, shape);
} else {
GrAA aa = GrAA(paint.isAntiAlias());
- renderTargetContext->drawShape(clip, std::move(grPaint), aa, viewMatrix, shape);
+ surfaceDrawContext->drawShape(clip, std::move(grPaint), aa, viewMatrix, shape);
}
}
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 911c2d4..d682410 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -90,7 +90,7 @@
bool GrClipStackClip::PathNeedsSWRenderer(GrRecordingContext* context,
const SkIRect& scissorRect,
bool hasUserStencilSettings,
- const GrSurfaceDrawContext* renderTargetContext,
+ const GrSurfaceDrawContext* surfaceDrawContext,
const SkMatrix& viewMatrix,
const Element* element,
bool needsStencil) {
@@ -110,7 +110,7 @@
}
// We only use this method when rendering coverage clip masks.
- SkASSERT(renderTargetContext->numSamples() <= 1);
+ SkASSERT(surfaceDrawContext->numSamples() <= 1);
auto aaType = (element->isAA()) ? GrAAType::kCoverage : GrAAType::kNone;
GrPathRendererChain::DrawType type =
@@ -120,13 +120,13 @@
GrStyledShape shape(path, GrStyle::SimpleFill());
GrPathRenderer::CanDrawPathArgs canDrawArgs;
canDrawArgs.fCaps = context->priv().caps();
- canDrawArgs.fProxy = renderTargetContext->asRenderTargetProxy();
+ canDrawArgs.fProxy = surfaceDrawContext->asRenderTargetProxy();
canDrawArgs.fClipConservativeBounds = &scissorRect;
canDrawArgs.fViewMatrix = &viewMatrix;
canDrawArgs.fShape = &shape;
canDrawArgs.fPaint = nullptr;
canDrawArgs.fAAType = aaType;
- SkASSERT(!renderTargetContext->wrapsVkSecondaryCB());
+ SkASSERT(!surfaceDrawContext->wrapsVkSecondaryCB());
canDrawArgs.fTargetIsWrappedVkSecondaryCB = false;
canDrawArgs.fHasUserStencilSettings = hasUserStencilSettings;
@@ -144,7 +144,7 @@
*/
bool GrClipStackClip::UseSWOnlyPath(GrRecordingContext* context,
bool hasUserStencilSettings,
- const GrSurfaceDrawContext* renderTargetContext,
+ const GrSurfaceDrawContext* surfaceDrawContext,
const GrReducedClip& reducedClip) {
// TODO: right now it appears that GPU clip masks are strictly slower than software. We may
// want to revisit this assumption once we can test with render target sorting.
@@ -157,7 +157,7 @@
// If we're avoiding stencils, always use SW. This includes drawing into a wrapped vulkan
// secondary command buffer which can't handle stencils.
if (context->priv().caps()->avoidStencilBuffers() ||
- renderTargetContext->wrapsVkSecondaryCB()) {
+ surfaceDrawContext->wrapsVkSecondaryCB()) {
return true;
}
@@ -175,7 +175,7 @@
kIntersect_SkClipOp == op || kReverseDifference_SkClipOp == op;
if (PathNeedsSWRenderer(context, reducedClip.scissor(), hasUserStencilSettings,
- renderTargetContext, translate, element, needsStencil)) {
+ surfaceDrawContext, translate, element, needsStencil)) {
return true;
}
}
@@ -186,11 +186,11 @@
// sort out what kind of clip mask needs to be created: alpha, stencil,
// scissor, or entirely software
GrClip::Effect GrClipStackClip::apply(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
GrAAType aa, bool hasUserStencilSettings,
GrAppliedClip* out, SkRect* bounds) const {
- SkASSERT(renderTargetContext->width() == fDeviceSize.fWidth &&
- renderTargetContext->height() == fDeviceSize.fHeight);
+ SkASSERT(surfaceDrawContext->width() == fDeviceSize.fWidth &&
+ surfaceDrawContext->height() == fDeviceSize.fHeight);
SkRect devBounds = SkRect::MakeIWH(fDeviceSize.fWidth, fDeviceSize.fHeight);
if (!devBounds.intersect(*bounds)) {
return Effect::kClippedOut;
@@ -208,9 +208,9 @@
// when drawing rounded div borders.
constexpr int kMaxAnalyticElements = 4;
- int maxWindowRectangles = renderTargetContext->maxWindowRectangles();
+ int maxWindowRectangles = surfaceDrawContext->maxWindowRectangles();
int maxAnalyticElements = kMaxAnalyticElements;
- if (renderTargetContext->numSamples() > 1 || aa == GrAAType::kMSAA || hasUserStencilSettings) {
+ if (surfaceDrawContext->numSamples() > 1 || aa == GrAAType::kMSAA || hasUserStencilSettings) {
// Disable analytic clips when we have MSAA. In MSAA we never conflate coverage and opacity.
maxAnalyticElements = 0;
// We disable MSAA when avoiding stencil.
@@ -238,7 +238,7 @@
}
if (!reducedClip.maskElements().isEmpty()) {
- if (!this->applyClipMask(context, renderTargetContext, reducedClip, hasUserStencilSettings,
+ if (!this->applyClipMask(context, surfaceDrawContext, reducedClip, hasUserStencilSettings,
out)) {
return Effect::kClippedOut;
}
@@ -247,7 +247,7 @@
// The opsTask ID must not be looked up until AFTER producing the clip mask (if any). That step
// can cause a flush or otherwise change which opstask our draw is going into.
- uint32_t opsTaskID = renderTargetContext->getOpsTask()->uniqueID();
+ uint32_t opsTaskID = surfaceDrawContext->getOpsTask()->uniqueID();
if (auto clipFPs = reducedClip.finishAndDetachAnalyticElements(context, *fMatrixProvider, ccpr,
opsTaskID)) {
out->addCoverageFP(std::move(clipFPs));
@@ -258,26 +258,26 @@
}
bool GrClipStackClip::applyClipMask(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const GrReducedClip& reducedClip, bool hasUserStencilSettings,
GrAppliedClip* out) const {
#ifdef SK_DEBUG
SkASSERT(reducedClip.hasScissor());
- SkIRect rtIBounds = SkIRect::MakeWH(renderTargetContext->width(),
- renderTargetContext->height());
+ SkIRect rtIBounds = SkIRect::MakeWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
const SkIRect& scissor = reducedClip.scissor();
SkASSERT(rtIBounds.contains(scissor)); // Mask shouldn't be larger than the RT.
#endif
// MIXED SAMPLES TODO: We may want to explore using the stencil buffer for AA clipping.
- if ((renderTargetContext->numSamples() <= 1 && reducedClip.maskRequiresAA()) ||
+ if ((surfaceDrawContext->numSamples() <= 1 && reducedClip.maskRequiresAA()) ||
context->priv().caps()->avoidStencilBuffers() ||
- renderTargetContext->wrapsVkSecondaryCB()) {
+ surfaceDrawContext->wrapsVkSecondaryCB()) {
GrSurfaceProxyView result;
- if (UseSWOnlyPath(context, hasUserStencilSettings, renderTargetContext, reducedClip)) {
+ if (UseSWOnlyPath(context, hasUserStencilSettings, surfaceDrawContext, reducedClip)) {
// The clip geometry is complex enough that it will be more efficient to create it
// entirely in software
- result = this->createSoftwareClipMask(context, reducedClip, renderTargetContext);
+ result = this->createSoftwareClipMask(context, reducedClip, surfaceDrawContext);
} else {
result = this->createAlphaClipMask(context, reducedClip);
}
@@ -293,14 +293,14 @@
// If alpha or software clip mask creation fails, fall through to the stencil code paths,
// unless stencils are disallowed.
if (context->priv().caps()->avoidStencilBuffers() ||
- renderTargetContext->wrapsVkSecondaryCB()) {
+ surfaceDrawContext->wrapsVkSecondaryCB()) {
SkDebugf("WARNING: Clip mask requires stencil, but stencil unavailable. "
"Clip will be ignored.\n");
return false;
}
}
- reducedClip.drawStencilClipMask(context, renderTargetContext);
+ reducedClip.drawStencilClipMask(context, surfaceDrawContext);
out->hardClip().addStencilClip(reducedClip.maskGenID());
return true;
}
@@ -453,7 +453,7 @@
GrSurfaceProxyView GrClipStackClip::createSoftwareClipMask(
GrRecordingContext* context, const GrReducedClip& reducedClip,
- GrSurfaceDrawContext* renderTargetContext) const {
+ GrSurfaceDrawContext* surfaceDrawContext) const {
GrUniqueKey key;
create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(),
reducedClip.numAnalyticElements(), &key);
@@ -474,7 +474,7 @@
}
GrSurfaceProxyView view;
- if (taskGroup && renderTargetContext) {
+ if (taskGroup && surfaceDrawContext) {
const GrCaps* caps = context->priv().caps();
// Create our texture proxy
GrBackendFormat format = caps->getDefaultBackendFormat(GrColorType::kAlpha_8,
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp
index 42c8ba8..14fc516 100644
--- a/src/gpu/GrOnFlushResourceProvider.cpp
+++ b/src/gpu/GrOnFlushResourceProvider.cpp
@@ -32,17 +32,17 @@
return nullptr;
}
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, colorType, std::move(colorSpace), std::move(proxy),
origin, props, true);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
- renderTargetContext->discard();
+ surfaceDrawContext->discard();
- return renderTargetContext;
+ return surfaceDrawContext;
}
void GrOnFlushResourceProvider::addTextureResolveTask(sk_sp<GrTextureProxy> textureProxy,
diff --git a/src/gpu/GrOpsTask.cpp b/src/gpu/GrOpsTask.cpp
index e89d3aa..59a66b2 100644
--- a/src/gpu/GrOpsTask.cpp
+++ b/src/gpu/GrOpsTask.cpp
@@ -603,7 +603,7 @@
break;
}
- // NOTE: If fMustPreserveStencil is set, then we are executing a renderTargetContext that split
+ // NOTE: If fMustPreserveStencil is set, then we are executing a surfaceDrawContext that split
// its opsTask.
//
// FIXME: We don't currently flag render passes that don't use stencil at all. In that case
diff --git a/src/gpu/GrOpsTask.h b/src/gpu/GrOpsTask.h
index 2fe6fe1..9a9dbf7 100644
--- a/src/gpu/GrOpsTask.h
+++ b/src/gpu/GrOpsTask.h
@@ -120,7 +120,7 @@
fInitialStencilContent = initialContent;
}
- // If a renderTargetContext splits its opsTask, it uses this method to guarantee stencil values
+ // If a surfaceDrawContext splits its opsTask, it uses this method to guarantee stencil values
// get preserved across its split tasks.
void setMustPreserveStencil() { fMustPreserveStencil = true; }
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index b97cc77..9bb84e8 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -865,8 +865,8 @@
// Create a 1-bit clip mask in the stencil buffer.
bool GrReducedClip::drawStencilClipMask(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext) const {
- GrStencilMaskHelper helper(context, renderTargetContext);
+ GrSurfaceDrawContext* surfaceDrawContext) const {
+ GrStencilMaskHelper helper(context, surfaceDrawContext);
if (!helper.init(fScissor, this->maskGenID(), fWindowRects, this->numAnalyticElements())) {
// The stencil mask doesn't need updating
return true;
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index c757db4..27652b9 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -66,7 +66,7 @@
// Gets the shape bounds, the clip bounds, and the intersection (if any). Returns false if there
// is no intersection.
-bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrSurfaceDrawContext* renderTargetContext,
+bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrSurfaceDrawContext* surfaceDrawContext,
const GrClip* clip,
const GrStyledShape& shape,
const SkMatrix& matrix,
@@ -75,8 +75,8 @@
SkIRect* devClipBounds) {
// compute bounds as intersection of rt size, clip, and path
*devClipBounds = clip ? clip->getConservativeBounds()
- : SkIRect::MakeWH(renderTargetContext->width(),
- renderTargetContext->height());
+ : SkIRect::MakeWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
if (!get_unclipped_shape_dev_bounds(shape, matrix, unclippedDevShapeBounds)) {
*unclippedDevShapeBounds = SkIRect::MakeEmpty();
@@ -92,18 +92,18 @@
////////////////////////////////////////////////////////////////////////////////
-void GrSoftwarePathRenderer::DrawNonAARect(GrSurfaceDrawContext* renderTargetContext,
+void GrSoftwarePathRenderer::DrawNonAARect(GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix) {
- renderTargetContext->stencilRect(clip, &userStencilSettings, std::move(paint), GrAA::kNo,
- viewMatrix, rect, &localMatrix);
+ surfaceDrawContext->stencilRect(clip, &userStencilSettings, std::move(paint), GrAA::kNo,
+ viewMatrix, rect, &localMatrix);
}
-void GrSoftwarePathRenderer::DrawAroundInvPath(GrSurfaceDrawContext* renderTargetContext,
+void GrSoftwarePathRenderer::DrawAroundInvPath(GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
@@ -119,32 +119,32 @@
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.setLTRB(SkIntToScalar(devClipBounds.fLeft), SkIntToScalar(devClipBounds.fTop),
SkIntToScalar(devClipBounds.fRight), SkIntToScalar(devPathBounds.fTop));
- DrawNonAARect(renderTargetContext, GrPaint::Clone(paint), userStencilSettings, clip,
+ DrawNonAARect(surfaceDrawContext, GrPaint::Clone(paint), userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fLeft < devPathBounds.fLeft) {
rect.setLTRB(SkIntToScalar(devClipBounds.fLeft), SkIntToScalar(devPathBounds.fTop),
SkIntToScalar(devPathBounds.fLeft), SkIntToScalar(devPathBounds.fBottom));
- DrawNonAARect(renderTargetContext, GrPaint::Clone(paint), userStencilSettings, clip,
+ DrawNonAARect(surfaceDrawContext, GrPaint::Clone(paint), userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fRight > devPathBounds.fRight) {
rect.setLTRB(SkIntToScalar(devPathBounds.fRight), SkIntToScalar(devPathBounds.fTop),
SkIntToScalar(devClipBounds.fRight), SkIntToScalar(devPathBounds.fBottom));
- DrawNonAARect(renderTargetContext, GrPaint::Clone(paint), userStencilSettings, clip,
+ DrawNonAARect(surfaceDrawContext, GrPaint::Clone(paint), userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
if (devClipBounds.fBottom > devPathBounds.fBottom) {
rect.setLTRB(SkIntToScalar(devClipBounds.fLeft), SkIntToScalar(devPathBounds.fBottom),
SkIntToScalar(devClipBounds.fRight), SkIntToScalar(devClipBounds.fBottom));
- DrawNonAARect(renderTargetContext, std::move(paint), userStencilSettings, clip,
+ DrawNonAARect(surfaceDrawContext, std::move(paint), userStencilSettings, clip,
SkMatrix::I(), rect, invert);
}
}
void GrSoftwarePathRenderer::DrawToTargetWithShapeMask(
GrSurfaceProxyView view,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
@@ -167,7 +167,7 @@
paint.setCoverageFragmentProcessor(GrTextureEffect::Make(
std::move(view), kPremul_SkAlphaType, maskMatrix, GrSamplerState::Filter::kNearest));
- DrawNonAARect(renderTargetContext, std::move(paint), userStencilSettings, clip, SkMatrix::I(),
+ DrawNonAARect(surfaceDrawContext, std::move(paint), userStencilSettings, clip, SkMatrix::I(),
dstRect, invert);
}
diff --git a/src/gpu/GrSoftwarePathRenderer.h b/src/gpu/GrSoftwarePathRenderer.h
index ad4b2b5..4f55048 100644
--- a/src/gpu/GrSoftwarePathRenderer.h
+++ b/src/gpu/GrSoftwarePathRenderer.h
@@ -35,14 +35,14 @@
SkIRect* devClipBounds);
private:
- static void DrawNonAARect(GrSurfaceDrawContext* renderTargetContext,
+ static void DrawNonAARect(GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
const SkMatrix& viewMatrix,
const SkRect& rect,
const SkMatrix& localMatrix);
- static void DrawAroundInvPath(GrSurfaceDrawContext* renderTargetContext,
+ static void DrawAroundInvPath(GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
@@ -54,7 +54,7 @@
// space. The 'viewMatrix' will be used to ensure the correct local coords are provided to
// any fragment processors in the paint.
static void DrawToTargetWithShapeMask(GrSurfaceProxyView,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrUserStencilSettings& userStencilSettings,
const GrClip* clip,
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 1a8ca89..b5b4d26 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -131,7 +131,7 @@
// In MDB mode the reffing of the 'getLastOpsTask' call's result allows in-progress
// GrOpsTasks to be picked up and added to by renderTargetContexts lower in the call
// stack. When this occurs with a closed GrOpsTask, a new one will be allocated
-// when the renderTargetContext attempts to use it (via getOpsTask).
+// when the surfaceDrawContext attempts to use it (via getOpsTask).
GrSurfaceContext::GrSurfaceContext(GrRecordingContext* context,
GrSurfaceProxyView readView,
const GrColorInfo& info)
diff --git a/src/gpu/GrSurfaceContext.h b/src/gpu/GrSurfaceContext.h
index 5096d2c..9e1b3c6 100644
--- a/src/gpu/GrSurfaceContext.h
+++ b/src/gpu/GrSurfaceContext.h
@@ -129,7 +129,7 @@
/**
* Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the
- * renderTargetContext at the specified position.
+ * surfaceDrawContext at the specified position.
* @param dContext The direct context to use
* @param srcInfo image info for the source pixels
* @param src source for the write
diff --git a/src/gpu/GrSurfaceDrawContext.cpp b/src/gpu/GrSurfaceDrawContext.cpp
index 96ba62a..31c5d34 100644
--- a/src/gpu/GrSurfaceDrawContext.cpp
+++ b/src/gpu/GrSurfaceDrawContext.cpp
@@ -318,7 +318,7 @@
// In MDB mode the reffing of the 'getLastOpsTask' call's result allows in-progress
// GrOpsTask to be picked up and added to by renderTargetContexts lower in the call
// stack. When this occurs with a closed GrOpsTask, a new one will be allocated
-// when the renderTargetContext attempts to use it (via getOpsTask).
+// when the surfaceDrawContext attempts to use it (via getOpsTask).
GrSurfaceDrawContext::GrSurfaceDrawContext(GrRecordingContext* context,
GrSurfaceProxyView readView,
GrSurfaceProxyView writeView,
diff --git a/src/gpu/GrSurfaceDrawContext.h b/src/gpu/GrSurfaceDrawContext.h
index 87638d2..36498dc 100644
--- a/src/gpu/GrSurfaceDrawContext.h
+++ b/src/gpu/GrSurfaceDrawContext.h
@@ -774,7 +774,7 @@
GrSurfaceProxyView fWriteView;
- // In MDB-mode the GrOpsTask can be closed by some other renderTargetContext that has picked
+ // In MDB-mode the GrOpsTask can be closed by some other surfaceDrawContext that has picked
// it up. For this reason, the GrOpsTask should only ever be accessed via 'getOpsTask'.
sk_sp<GrOpsTask> fOpsTask;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c7ee305..0dedef8 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -76,20 +76,20 @@
}
sk_sp<SkGpuDevice> SkGpuDevice::Make(GrRecordingContext* context,
- std::unique_ptr<GrSurfaceDrawContext> renderTargetContext,
+ std::unique_ptr<GrSurfaceDrawContext> surfaceDrawContext,
InitContents init) {
- if (!renderTargetContext || context->abandoned()) {
+ if (!surfaceDrawContext || context->abandoned()) {
return nullptr;
}
- SkColorType ct = GrColorTypeToSkColorType(renderTargetContext->colorInfo().colorType());
+ SkColorType ct = GrColorTypeToSkColorType(surfaceDrawContext->colorInfo().colorType());
unsigned flags;
if (!context->colorTypeSupportedAsSurface(ct) ||
!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) {
return nullptr;
}
- return sk_sp<SkGpuDevice>(new SkGpuDevice(context, std::move(renderTargetContext), flags));
+ return sk_sp<SkGpuDevice>(new SkGpuDevice(context, std::move(surfaceDrawContext), flags));
}
sk_sp<SkGpuDevice> SkGpuDevice::Make(GrRecordingContext* context, SkBudgeted budgeted,
@@ -102,13 +102,13 @@
return nullptr;
}
- auto renderTargetContext =
+ auto surfaceDrawContext =
MakeRenderTargetContext(context, budgeted, info, sampleCount, origin, props, mipMapped);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
- return sk_sp<SkGpuDevice>(new SkGpuDevice(context, std::move(renderTargetContext), flags));
+ return sk_sp<SkGpuDevice>(new SkGpuDevice(context, std::move(surfaceDrawContext), flags));
}
static SkImageInfo make_info(GrSurfaceDrawContext* context, bool opaque) {
@@ -119,12 +119,12 @@
}
SkGpuDevice::SkGpuDevice(GrRecordingContext* context,
- std::unique_ptr<GrSurfaceDrawContext> renderTargetContext,
+ std::unique_ptr<GrSurfaceDrawContext> surfaceDrawContext,
unsigned flags)
- : INHERITED(make_info(renderTargetContext.get(), SkToBool(flags & kIsOpaque_Flag)),
- renderTargetContext->surfaceProps())
+ : INHERITED(make_info(surfaceDrawContext.get(), SkToBool(flags & kIsOpaque_Flag)),
+ surfaceDrawContext->surfaceProps())
, fContext(SkRef(context))
- , fRenderTargetContext(std::move(renderTargetContext))
+ , fRenderTargetContext(std::move(surfaceDrawContext))
#if !defined(SK_DISABLE_NEW_GR_CLIP_STACK)
, fClip(SkIRect::MakeWH(fRenderTargetContext->width(),
fRenderTargetContext->height()),
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index b61b015..938fbbe 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -533,7 +533,7 @@
} // anonymous namespace
-bool GrDefaultPathRenderer::internalDrawPath(GrSurfaceDrawContext* renderTargetContext,
+bool GrDefaultPathRenderer::internalDrawPath(GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
GrAAType aaType,
const GrUserStencilSettings& userStencilSettings,
@@ -541,7 +541,7 @@
const SkMatrix& viewMatrix,
const GrStyledShape& shape,
bool stencilOnly) {
- auto context = renderTargetContext->recordingContext();
+ auto context = surfaceDrawContext->recordingContext();
SkASSERT(GrAAType::kCoverage != aaType);
SkPath path;
@@ -629,7 +629,7 @@
SkScalar srcSpaceTol = GrPathUtils::scaleToleranceToSrc(tol, viewMatrix, path.getBounds());
SkRect devBounds;
- GetPathDevBounds(path, renderTargetContext->asRenderTargetProxy()->backingStoreDimensions(),
+ GetPathDevBounds(path, surfaceDrawContext->asRenderTargetProxy()->backingStoreDimensions(),
viewMatrix, &devBounds);
for (int p = 0; p < passCount; ++p) {
@@ -655,9 +655,9 @@
viewMatrix;
// This is a non-coverage aa rect op since we assert aaType != kCoverage at the start
assert_alive(paint);
- renderTargetContext->stencilRect(clip, passes[p], std::move(paint),
- GrAA(aaType == GrAAType::kMSAA), viewM, bounds,
- &localMatrix);
+ surfaceDrawContext->stencilRect(clip, passes[p], std::move(paint),
+ GrAA(aaType == GrAAType::kMSAA), viewM, bounds,
+ &localMatrix);
} else {
bool stencilPass = stencilOnly || passCount > 1;
GrOp::Owner op;
@@ -672,7 +672,7 @@
op = DefaultPathOp::Make(context, std::move(paint), path, srcSpaceTol, newCoverage,
viewMatrix, isHairline, aaType, devBounds, passes[p]);
}
- renderTargetContext->addDrawOp(clip, std::move(op));
+ surfaceDrawContext->addDrawOp(clip, std::move(op));
}
}
return true;
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.cpp b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
index 4ee7e93..9bc12f5 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.cpp
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
@@ -177,7 +177,7 @@
}
bool GrTessellationPathRenderer::onDrawPath(const DrawPathArgs& args) {
- GrSurfaceDrawContext* renderTargetContext = args.fRenderTargetContext;
+ GrSurfaceDrawContext* surfaceDrawContext = args.fRenderTargetContext;
const GrShaderCaps& shaderCaps = *args.fContext->priv().caps()->shaderCaps();
SkPath path;
@@ -211,10 +211,10 @@
}
#endif
auto op = GrOp::Make<GrDrawAtlasPathOp>(args.fContext,
- renderTargetContext->numSamples(), sk_ref_sp(fAtlas.textureProxy()),
+ surfaceDrawContext->numSamples(), sk_ref_sp(fAtlas.textureProxy()),
devIBounds, locationInAtlas, transposedInAtlas, *args.fViewMatrix,
std::move(args.fPaint));
- renderTargetContext->addDrawOp(args.fClip, std::move(op));
+ surfaceDrawContext->addDrawOp(args.fClip, std::move(op));
return true;
}
@@ -225,8 +225,8 @@
devBounds.height());
if (worstCaseResolveLevel > kMaxResolveLevel) {
// The path is too large for our internal indirect draw shaders. Crop it to the viewport.
- auto viewport = SkRect::MakeIWH(renderTargetContext->width(),
- renderTargetContext->height());
+ auto viewport = SkRect::MakeIWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
float inflationRadius = 1;
const SkStrokeRec& stroke = args.fShape->style().strokeRec();
if (stroke.getStyle() == SkStrokeRec::kHairline_Style) {
@@ -274,7 +274,7 @@
devStroke.setStrokeStyle(1);
auto op = make_stroke_op(args.fContext, args.fAAType, SkMatrix::I(), devStroke, devPath,
std::move(args.fPaint), shaderCaps);
- renderTargetContext->addDrawOp(args.fClip, std::move(op));
+ surfaceDrawContext->addDrawOp(args.fClip, std::move(op));
return true;
}
@@ -283,7 +283,7 @@
SkASSERT(stroke.getStyle() == SkStrokeRec::kStroke_Style);
auto op = make_stroke_op(args.fContext, args.fAAType, *args.fViewMatrix, stroke, path,
std::move(args.fPaint), shaderCaps);
- renderTargetContext->addDrawOp(args.fClip, std::move(op));
+ surfaceDrawContext->addDrawOp(args.fClip, std::move(op));
return true;
}
@@ -298,7 +298,7 @@
auto op = GrOp::Make<GrPathTessellateOp>(
args.fContext, *args.fViewMatrix, path, std::move(args.fPaint),
args.fAAType, drawPathFlags);
- renderTargetContext->addDrawOp(args.fClip, std::move(op));
+ surfaceDrawContext->addDrawOp(args.fClip, std::move(op));
return true;
}
@@ -426,7 +426,7 @@
auto aaType = GrAAType::kMSAA;
auto fillRectFlags = GrFillRectOp::InputFlags::kNone;
- // This will be the final op in the renderTargetContext. So if Ganesh is planning to discard the
+ // This will be the final op in the surfaceDrawContext. So if Ganesh is planning to discard the
// stencil values anyway, then we might not actually need to reset the stencil values back to 0.
bool mustResetStencil = !onFlushRP->caps()->discardStencilValuesAfterRenderPass();