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/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 11ca05e..8d1ae84 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -226,7 +226,7 @@
return SkISize::Make(kCellWidth, kNumConics*kCellHeight);
}
- void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas) override {
const SkScalar w = kCellWidth, h = kCellHeight;
@@ -297,7 +297,7 @@
GrOp::Owner op = BezierConicTestOp::Make(context, bounds,
kOpaqueBlack, klm);
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
}
}
@@ -426,7 +426,7 @@
return SkISize::Make(kCellWidth, kNumQuads*kCellHeight);
}
- void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas) override {
const SkScalar w = kCellWidth, h = kCellHeight;
@@ -490,7 +490,7 @@
GrOp::Owner op = BezierQuadTestOp::Make(context, bounds,
kOpaqueBlack, DevToUV);
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
}
}
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index 134dbe1..aeae279 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -65,7 +65,7 @@
SkISize onISize() override { return SkISize::Make(fWidth, fHeight); }
- void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas) override {
SkPaint paint;
@@ -88,7 +88,7 @@
SkRRect rrect = fRRect;
rrect.offset(SkIntToScalar(x + kGap), SkIntToScalar(y + kGap));
- const auto& caps = *renderTargetContext->caps()->shaderCaps();
+ const auto& caps = *surfaceDrawContext->caps()->shaderCaps();
auto [success, fp] = GrRRectEffect::Make(/*inputFP=*/nullptr, edgeType, rrect,
caps);
SkASSERT(success);
@@ -102,7 +102,7 @@
SkRect bounds = testBounds;
bounds.offset(SkIntToScalar(x), SkIntToScalar(y));
- renderTargetContext->addDrawOp(GrFillRectOp::MakeNonAARect(
+ surfaceDrawContext->addDrawOp(GrFillRectOp::MakeNonAARect(
context, std::move(grPaint), SkMatrix::I(), bounds));
}
canvas->restore();
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index 2136bbd..00b8cd8 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -79,7 +79,7 @@
SkTileMode::kClamp);
}
- void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas) override {
constexpr GrColor kColors[] = {
0xFFFFFFFF,
@@ -144,7 +144,7 @@
renderRect.makeOffset(x, y),
renderRect,
SkMatrix::I())) {
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
// Draw labels for the input to the processor and the processor to the right of
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 9320234..62d760a 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -106,7 +106,7 @@
fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f));
}
- void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas) override {
SkScalar y = 0;
static constexpr SkScalar kDX = 12.f;
@@ -136,7 +136,7 @@
auto rect = p.getBounds().makeOutset(kOutset, kOutset);
auto op = sk_gpu_test::test_ops::MakeRect(context, std::move(grPaint), rect);
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
x += SkScalarCeilToScalar(path->getBounds().width() + kDX);
}
@@ -176,7 +176,7 @@
auto drawRect = rect.makeOutset(kOutset, kOutset);
auto op = sk_gpu_test::test_ops::MakeRect(context, std::move(grPaint), drawRect);
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
x += SkScalarCeilToScalar(rect.width() + kDX);
}
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 261140e..e9757c5 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -78,10 +78,10 @@
SkISize onISize() override { return SkISize::Make(kImageWidth, kImageHeight); }
DrawResult onDraw(SkCanvas* canvas, SkString* errorMsg) override {
- GrSurfaceDrawContext* renderTargetContext =
+ GrSurfaceDrawContext* surfaceDrawContext =
canvas->internal_private_accessTopLayerRenderTargetContext();
auto context = canvas->recordingContext();
- if (kEffect_Type == fType && (!renderTargetContext || !context)) {
+ if (kEffect_Type == fType && (!surfaceDrawContext || !context)) {
*errorMsg = kErrorMsg_DrawSkippedGpuOnly;
return DrawResult::kSkip;
}
@@ -117,7 +117,7 @@
SkRRect rrect = fRRects[curRRect];
rrect.offset(SkIntToScalar(x), SkIntToScalar(y));
GrClipEdgeType edgeType = (GrClipEdgeType) et;
- const auto& caps = *renderTargetContext->caps()->shaderCaps();
+ const auto& caps = *surfaceDrawContext->caps()->shaderCaps();
auto [success, fp] = GrRRectEffect::Make(/*inputFP=*/nullptr,
edgeType, rrect, caps);
if (success) {
@@ -129,7 +129,7 @@
SkRect bounds = rrect.getBounds();
bounds.outset(2.f, 2.f);
- renderTargetContext->addDrawOp(GrFillRectOp::MakeNonAARect(
+ surfaceDrawContext->addDrawOp(GrFillRectOp::MakeNonAARect(
context, std::move(grPaint), SkMatrix::I(), bounds));
} else {
drew = false;
diff --git a/gm/texelsubset.cpp b/gm/texelsubset.cpp
index b591f86..616d81d 100644
--- a/gm/texelsubset.cpp
+++ b/gm/texelsubset.cpp
@@ -86,7 +86,7 @@
SkASSERT(fBitmap.dimensions() == kImageSize);
}
- DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas, SkString* errorMsg) override {
GrMipmapped mipmapped = (fMipmapMode != MipmapMode::kNone) ? GrMipmapped::kYes
: GrMipmapped::kNo;
@@ -168,7 +168,7 @@
drawRect,
localRect.makeOffset(kT),
SkMatrix::Translate(-kT))) {
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
x += localRect.width() + kTestPad;
@@ -186,7 +186,7 @@
caps);
if (auto op = sk_gpu_test::test_ops::MakeRect(context, std::move(fp2), drawRect,
localRect)) {
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
if (mx < GrSamplerState::kWrapModeCount - 1) {
diff --git a/gm/yuvtorgbsubset.cpp b/gm/yuvtorgbsubset.cpp
index 59ef117..e934d4d 100644
--- a/gm/yuvtorgbsubset.cpp
+++ b/gm/yuvtorgbsubset.cpp
@@ -84,7 +84,7 @@
}
}
- DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
+ DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* surfaceDrawContext,
SkCanvas* canvas, SkString* errorMsg) override {
GrSurfaceProxyView views[3];
@@ -135,7 +135,7 @@
if (fp) {
GrPaint grPaint;
grPaint.setColorFragmentProcessor(std::move(fp));
- renderTargetContext->drawRect(
+ surfaceDrawContext->drawRect(
nullptr, std::move(grPaint), GrAA::kYes, ctm, rect);
}
x += rect.width() + kTestPad;
diff --git a/src/core/SkBlurMF.cpp b/src/core/SkBlurMF.cpp
index d283802..471573e 100644
--- a/src/core/SkBlurMF.cpp
+++ b/src/core/SkBlurMF.cpp
@@ -56,7 +56,7 @@
const SkMatrix& ctm,
SkIRect* maskRect) const override;
bool directFilterMaskGPU(GrRecordingContext*,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&&,
const GrClip*,
const SkMatrix& viewMatrix,
@@ -572,12 +572,12 @@
#if SK_SUPPORT_GPU
bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrRecordingContext* context,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
GrPaint&& paint,
const GrClip* clip,
const SkMatrix& viewMatrix,
const GrStyledShape& shape) const {
- SkASSERT(renderTargetContext);
+ SkASSERT(surfaceDrawContext);
if (fBlurStyle != kNormal_SkBlurStyle) {
return false;
@@ -590,7 +590,7 @@
SkScalar xformedSigma = this->computeXformedSigma(viewMatrix);
if (SkGpuBlurUtils::IsEffectivelyZeroSigma(xformedSigma)) {
- renderTargetContext->drawShape(clip, std::move(paint), GrAA::kYes, viewMatrix, shape);
+ surfaceDrawContext->drawShape(clip, std::move(paint), GrAA::kYes, viewMatrix, shape);
return true;
}
@@ -655,7 +655,7 @@
}
srcProxyRect.outset(outsetX, outsetY);
- renderTargetContext->drawRect(clip, std::move(paint), GrAA::kNo, viewMatrix, srcProxyRect);
+ surfaceDrawContext->drawRect(clip, std::move(paint), GrAA::kNo, viewMatrix, srcProxyRect);
return true;
}
if (!viewMatrix.isScaleTranslate()) {
@@ -684,8 +684,8 @@
paint.setCoverageFragmentProcessor(std::move(fp));
SkSimpleMatrixProvider matrixProvider(viewMatrix);
- renderTargetContext->drawVertices(clip, std::move(paint), matrixProvider,
- std::move(vertices));
+ surfaceDrawContext->drawVertices(clip, std::move(paint), matrixProvider,
+ std::move(vertices));
} else {
SkMatrix inverse;
if (!viewMatrix.invert(&inverse)) {
@@ -697,8 +697,8 @@
proxyRect.outset(extra, extra);
paint.setCoverageFragmentProcessor(std::move(fp));
- renderTargetContext->fillRectWithLocalMatrix(clip, std::move(paint), GrAA::kNo,
- SkMatrix::I(), proxyRect, inverse);
+ surfaceDrawContext->fillRectWithLocalMatrix(clip, std::move(paint), GrAA::kNo,
+ SkMatrix::I(), proxyRect, inverse);
}
return true;
@@ -756,7 +756,7 @@
// gaussianBlur. Otherwise, we need to save it for later compositing.
bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle);
auto srcBounds = SkIRect::MakeSize(srcView.proxy()->dimensions());
- auto renderTargetContext = SkGpuBlurUtils::GaussianBlur(context,
+ auto surfaceDrawContext = SkGpuBlurUtils::GaussianBlur(context,
srcView,
srcColorType,
srcAlphaType,
@@ -766,7 +766,7 @@
xformedSigma,
xformedSigma,
SkTileMode::kClamp);
- if (!renderTargetContext || !renderTargetContext->asTextureProxy()) {
+ if (!surfaceDrawContext || !surfaceDrawContext->asTextureProxy()) {
return {};
}
@@ -789,11 +789,11 @@
paint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
}
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- SkRect::Make(clipRect));
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(clipRect));
}
- return renderTargetContext->readSurfaceView();
+ return surfaceDrawContext->readSurfaceView();
}
#endif // SK_SUPPORT_GPU
diff --git a/src/core/SkGlyphRunPainter.h b/src/core/SkGlyphRunPainter.h
index cdf0393..cd12c63 100644
--- a/src/core/SkGlyphRunPainter.h
+++ b/src/core/SkGlyphRunPainter.h
@@ -62,7 +62,7 @@
// The following two ctors are used exclusively by the GPU, and will always use the global
// strike cache.
SkGlyphRunListPainter(const SkSurfaceProps&, const GrColorInfo&);
- explicit SkGlyphRunListPainter(const GrSurfaceDrawContext& renderTargetContext);
+ explicit SkGlyphRunListPainter(const GrSurfaceDrawContext& surfaceDrawContext);
#endif // SK_SUPPORT_GPU
class BitmapDevicePainter {
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 52036dc..e5f7b10 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -59,10 +59,10 @@
}
/**
- * Draws 'rtcRect' into 'renderTargetContext' evaluating a 1D Gaussian over 'srcView'. The src rect
+ * Draws 'rtcRect' into 'surfaceDrawContext' evaluating a 1D Gaussian over 'srcView'. The src rect
* is 'rtcRect' offset by 'rtcToSrcOffset'. 'mode' and 'bounds' are applied to the src coords.
*/
-static void convolve_gaussian_1d(GrSurfaceDrawContext* renderTargetContext,
+static void convolve_gaussian_1d(GrSurfaceDrawContext* surfaceDrawContext,
GrSurfaceProxyView srcView,
const SkIRect srcSubset,
SkIVector rtcToSrcOffset,
@@ -83,11 +83,11 @@
// two convolution effects?
std::unique_ptr<GrFragmentProcessor> conv(GrGaussianConvolutionFragmentProcessor::Make(
std::move(srcView), srcAlphaType, direction, radius, sigma, wm, srcSubset, &srcRect,
- *renderTargetContext->caps()));
+ *surfaceDrawContext->caps()));
paint.setColorFragmentProcessor(std::move(conv));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- SkRect::Make(rtcRect), SkRect::Make(srcRect));
+ surfaceDrawContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(rtcRect), SkRect::Make(srcRect));
}
static std::unique_ptr<GrSurfaceDrawContext> convolve_gaussian_2d(GrRecordingContext* context,
@@ -105,10 +105,10 @@
SkASSERT(radiusX && radiusY);
SkASSERT(!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaX) &&
!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaY));
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, srcColorType, std::move(finalCS), dstFit, dstBounds.size(), 1,
GrMipmapped::kNo, srcView.proxy()->isProtected(), srcView.origin());
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
@@ -125,7 +125,7 @@
fill_in_2D_gaussian_kernel(kernel, size.width(), size.height(), sigmaX, sigmaY);
auto conv = GrMatrixConvolutionEffect::Make(context, std::move(srcView), srcBounds,
size, kernel, 1.0f, 0.0f, kernelOffset, wm, true,
- *renderTargetContext->caps());
+ *surfaceDrawContext->caps());
paint.setColorFragmentProcessor(std::move(conv));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
@@ -133,10 +133,10 @@
// 'dstBounds' is actually in 'srcView' proxy space. It represents the blurred area from src
// space that we want to capture in the new RTC at {0, 0}. Hence, we use its size as the rect to
// draw and it directly as the local rect.
- renderTargetContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- SkRect::Make(dstBounds.size()), SkRect::Make(dstBounds));
+ surfaceDrawContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ SkRect::Make(dstBounds.size()), SkRect::Make(dstBounds));
- return renderTargetContext;
+ return surfaceDrawContext;
}
static std::unique_ptr<GrSurfaceDrawContext> convolve_gaussian(GrRecordingContext* context,
diff --git a/src/core/SkGpuBlurUtils.h b/src/core/SkGpuBlurUtils.h
index e9f61da..83f018a 100644
--- a/src/core/SkGpuBlurUtils.h
+++ b/src/core/SkGpuBlurUtils.h
@@ -22,7 +22,7 @@
/**
* Applies a 2D Gaussian blur to a given texture. The blurred result is returned
- * as a renderTargetContext in case the caller wishes to draw into the result.
+ * as a surfaceDrawContext in case the caller wishes to draw into the result.
* The GrSurfaceOrigin of the result will watch the GrSurfaceOrigin of srcView. The output
* color type, color space, and alpha type will be the same as the src.
*
@@ -39,7 +39,7 @@
* @param sigmaY The blur's standard deviation in Y.
* @param tileMode The mode to handle samples outside bounds.
* @param fit backing fit for the returned render target context
- * @return The renderTargetContext containing the blurred result.
+ * @return The surfaceDrawContext containing the blurred result.
*/
std::unique_ptr<GrSurfaceDrawContext> GaussianBlur(GrRecordingContext* context,
GrSurfaceProxyView srcView,
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 1b90d26..143fbdb 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -595,24 +595,24 @@
paint.setColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, SkColorTypeToGrColorType(colorType), sk_ref_sp(colorSpace),
SkBackingFit::kApprox, bounds.size(), 1, GrMipmapped::kNo, isProtected,
kBottomLeft_GrSurfaceOrigin);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
SkIRect dstIRect = SkIRect::MakeWH(bounds.width(), bounds.height());
SkRect srcRect = SkRect::Make(bounds);
SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
- renderTargetContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- dstRect, srcRect);
+ surfaceDrawContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ dstRect, srcRect);
return SkSpecialImage::MakeDeferredFromGpu(
context, dstIRect, kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(), renderTargetContext->colorInfo().colorType(),
- renderTargetContext->colorInfo().refColorSpace());
+ surfaceDrawContext->readSurfaceView(), surfaceDrawContext->colorInfo().colorType(),
+ surfaceDrawContext->colorInfo().refColorSpace());
}
sk_sp<SkSpecialImage> SkImageFilter_Base::ImageToColorSpace(SkSpecialImage* src,
diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
index 0dd329a..e391c34 100644
--- a/src/core/SkSpecialSurface.cpp
+++ b/src/core/SkSpecialSurface.cpp
@@ -125,11 +125,11 @@
class SkSpecialSurface_Gpu : public SkSpecialSurface_Base {
public:
SkSpecialSurface_Gpu(GrRecordingContext* context,
- std::unique_ptr<GrSurfaceDrawContext> renderTargetContext,
+ std::unique_ptr<GrSurfaceDrawContext> surfaceDrawContext,
int width, int height, const SkIRect& subset)
- : INHERITED(subset, &renderTargetContext->surfaceProps())
- , fReadView(renderTargetContext->readSurfaceView()) {
- auto device = SkGpuDevice::Make(context, std::move(renderTargetContext),
+ : INHERITED(subset, &surfaceDrawContext->surfaceProps())
+ , fReadView(surfaceDrawContext->readSurfaceView()) {
+ auto device = SkGpuDevice::Make(context, std::move(surfaceDrawContext),
SkGpuDevice::kUninit_InitContents);
if (!device) {
return;
@@ -171,17 +171,17 @@
if (!context) {
return nullptr;
}
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, colorType, std::move(colorSpace), SkBackingFit::kApprox, {width, height}, 1,
GrMipmapped::kNo, GrProtected::kNo, kBottomLeft_GrSurfaceOrigin, SkBudgeted::kYes,
props);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
const SkIRect subset = SkIRect::MakeWH(width, height);
- return sk_make_sp<SkSpecialSurface_Gpu>(context, std::move(renderTargetContext),
+ return sk_make_sp<SkSpecialSurface_Gpu>(context, std::move(surfaceDrawContext),
width, height, subset);
}
diff --git a/src/effects/imagefilters/SkArithmeticImageFilter.cpp b/src/effects/imagefilters/SkArithmeticImageFilter.cpp
index c84105d..0ad8b0c 100644
--- a/src/effects/imagefilters/SkArithmeticImageFilter.cpp
+++ b/src/effects/imagefilters/SkArithmeticImageFilter.cpp
@@ -369,24 +369,24 @@
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox, bounds.size(),
1, GrMipmapped::kNo, isProtected, kBottomLeft_GrSurfaceOrigin);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
- SkRect::Make(bounds));
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
+ SkRect::Make(bounds));
return SkSpecialImage::MakeDeferredFromGpu(context,
SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(),
- renderTargetContext->colorInfo().colorType(),
- renderTargetContext->colorInfo().refColorSpace());
+ surfaceDrawContext->readSurfaceView(),
+ surfaceDrawContext->colorInfo().colorType(),
+ surfaceDrawContext->colorInfo().refColorSpace());
}
#endif
diff --git a/src/effects/imagefilters/SkBlurImageFilter.cpp b/src/effects/imagefilters/SkBlurImageFilter.cpp
index 8d43066..b1d424f 100644
--- a/src/effects/imagefilters/SkBlurImageFilter.cpp
+++ b/src/effects/imagefilters/SkBlurImageFilter.cpp
@@ -644,7 +644,7 @@
// TODO (michaelludwig) - The color space choice is odd, should it just be ctx.refColorSpace()?
dstBounds.offset(input->subset().topLeft());
inputBounds.offset(input->subset().topLeft());
- auto renderTargetContext = SkGpuBlurUtils::GaussianBlur(
+ auto surfaceDrawContext = SkGpuBlurUtils::GaussianBlur(
context,
std::move(inputView),
SkColorTypeToGrColorType(input->colorType()),
@@ -655,15 +655,15 @@
sigma.x(),
sigma.y(),
fTileMode);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
return SkSpecialImage::MakeDeferredFromGpu(context,
SkIRect::MakeSize(dstBounds.size()),
kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(),
- renderTargetContext->colorInfo().colorType(),
+ surfaceDrawContext->readSurfaceView(),
+ surfaceDrawContext->colorInfo().colorType(),
sk_ref_sp(input->getColorSpace()),
ctx.surfaceProps());
}
diff --git a/src/effects/imagefilters/SkDisplacementMapEffect.cpp b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
index fbfcf39..85a2de9 100644
--- a/src/effects/imagefilters/SkDisplacementMapEffect.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
@@ -347,15 +347,15 @@
SkMatrix matrix;
matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colorBounds.y()));
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox,
bounds.size(), 1, GrMipmapped::kNo, isProtected, kBottomLeft_GrSurfaceOrigin);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
- SkRect::Make(colorBounds));
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
+ SkRect::Make(colorBounds));
offset->fX = bounds.left();
offset->fY = bounds.top();
@@ -363,9 +363,9 @@
context,
SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(),
- renderTargetContext->colorInfo().colorType(),
- renderTargetContext->colorInfo().refColorSpace());
+ surfaceDrawContext->readSurfaceView(),
+ surfaceDrawContext->colorInfo().colorType(),
+ surfaceDrawContext->colorInfo().refColorSpace());
}
#endif
diff --git a/src/effects/imagefilters/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp
index 6d9350d..15489d3 100644
--- a/src/effects/imagefilters/SkLightingImageFilter.cpp
+++ b/src/effects/imagefilters/SkLightingImageFilter.cpp
@@ -457,7 +457,7 @@
};
#if SK_SUPPORT_GPU
-void SkLightingImageFilterInternal::drawRect(GrSurfaceDrawContext* renderTargetContext,
+void SkLightingImageFilterInternal::drawRect(GrSurfaceDrawContext* surfaceDrawContext,
GrSurfaceProxyView srcView,
const SkMatrix& matrix,
const SkRect& dstRect,
@@ -467,11 +467,11 @@
SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y()));
GrPaint paint;
auto fp = this->makeFragmentProcessor(std::move(srcView), matrix, srcBounds, boundaryMode,
- *renderTargetContext->caps());
+ *surfaceDrawContext->caps());
paint.setColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- dstRect, srcRect);
+ surfaceDrawContext->fillRectToRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ dstRect, srcRect);
}
sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
@@ -486,11 +486,11 @@
GrSurfaceProxyView inputView = input->view(context);
SkASSERT(inputView.asTextureProxy());
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox,
offsetBounds.size(), 1, GrMipmapped::kNo, inputView.proxy()->isProtected(),
kBottomLeft_GrSurfaceOrigin);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
@@ -509,32 +509,32 @@
SkRect bottomRight = SkRect::MakeXYWH(dstRect.width() - 1, dstRect.height() - 1, 1, 1);
const SkIRect* pSrcBounds = inputBounds.contains(offsetBounds) ? nullptr : &inputBounds;
- this->drawRect(renderTargetContext.get(), inputView, matrix, topLeft,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, topLeft,
kTopLeft_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, top,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, top,
kTop_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, topRight,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, topRight,
kTopRight_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, left,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, left,
kLeft_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, interior,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, interior,
kInterior_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, right,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, right,
kRight_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, bottomLeft,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, bottomLeft,
kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), inputView, matrix, bottom,
+ this->drawRect(surfaceDrawContext.get(), inputView, matrix, bottom,
kBottom_BoundaryMode, pSrcBounds, offsetBounds);
- this->drawRect(renderTargetContext.get(), std::move(inputView), matrix, bottomRight,
+ this->drawRect(surfaceDrawContext.get(), std::move(inputView), matrix, bottomRight,
kBottomRight_BoundaryMode, pSrcBounds, offsetBounds);
return SkSpecialImage::MakeDeferredFromGpu(
context,
SkIRect::MakeWH(offsetBounds.width(), offsetBounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(),
- renderTargetContext->colorInfo().colorType(),
- renderTargetContext->colorInfo().refColorSpace());
+ surfaceDrawContext->readSurfaceView(),
+ surfaceDrawContext->colorInfo().colorType(),
+ surfaceDrawContext->colorInfo().refColorSpace());
}
#endif
diff --git a/src/effects/imagefilters/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
index e90eead..0a34b78 100644
--- a/src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -362,7 +362,7 @@
}
#endif
-static void apply_morphology_rect(GrSurfaceDrawContext* renderTargetContext,
+static void apply_morphology_rect(GrSurfaceDrawContext* surfaceDrawContext,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
@@ -376,12 +376,12 @@
srcAlphaType, direction, radius,
morphType, range));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(/*clip=*/nullptr, std::move(paint), GrAA::kNo,
- SkMatrix::I(), SkRect::Make(dstRect),
- SkRect::Make(srcRect));
+ surfaceDrawContext->fillRectToRect(/*clip=*/nullptr, std::move(paint), GrAA::kNo,
+ SkMatrix::I(), SkRect::Make(dstRect),
+ SkRect::Make(srcRect));
}
-static void apply_morphology_rect_no_bounds(GrSurfaceDrawContext* renderTargetContext,
+static void apply_morphology_rect_no_bounds(GrSurfaceDrawContext* surfaceDrawContext,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
@@ -393,12 +393,12 @@
paint.setColorFragmentProcessor(GrMorphologyEffect::Make(
/*inputFP=*/nullptr, std::move(view), srcAlphaType, direction, radius, morphType));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- renderTargetContext->fillRectToRect(/*clip=*/nullptr, std::move(paint), GrAA::kNo,
- SkMatrix::I(), SkRect::Make(dstRect),
- SkRect::Make(srcRect));
+ surfaceDrawContext->fillRectToRect(/*clip=*/nullptr, std::move(paint), GrAA::kNo,
+ SkMatrix::I(), SkRect::Make(dstRect),
+ SkRect::Make(srcRect));
}
-static void apply_morphology_pass(GrSurfaceDrawContext* renderTargetContext,
+static void apply_morphology_pass(GrSurfaceDrawContext* surfaceDrawContext,
GrSurfaceProxyView view,
SkAlphaType srcAlphaType,
const SkIRect& srcRect,
@@ -431,15 +431,15 @@
}
if (middleSrcRect.width() <= 0) {
// radius covers srcRect; use bounds over entire draw
- apply_morphology_rect(renderTargetContext, std::move(view), srcAlphaType, srcRect,
+ apply_morphology_rect(surfaceDrawContext, std::move(view), srcAlphaType, srcRect,
dstRect, radius, morphType, bounds, direction);
} else {
// Draw upper and lower margins with bounds; middle without.
- apply_morphology_rect(renderTargetContext, view, srcAlphaType, lowerSrcRect,
+ apply_morphology_rect(surfaceDrawContext, view, srcAlphaType, lowerSrcRect,
lowerDstRect, radius, morphType, bounds, direction);
- apply_morphology_rect(renderTargetContext, view, srcAlphaType, upperSrcRect,
+ apply_morphology_rect(surfaceDrawContext, view, srcAlphaType, upperSrcRect,
upperDstRect, radius, morphType, bounds, direction);
- apply_morphology_rect_no_bounds(renderTargetContext, std::move(view), srcAlphaType,
+ apply_morphology_rect_no_bounds(surfaceDrawContext, std::move(view), srcAlphaType,
middleSrcRect, middleDstRect, radius, morphType, direction);
}
}
diff --git a/src/effects/imagefilters/SkXfermodeImageFilter.cpp b/src/effects/imagefilters/SkXfermodeImageFilter.cpp
index 73094ab..e2d8c45 100644
--- a/src/effects/imagefilters/SkXfermodeImageFilter.cpp
+++ b/src/effects/imagefilters/SkXfermodeImageFilter.cpp
@@ -287,23 +287,23 @@
paint.setColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox, bounds.size());
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
- SkRect::Make(bounds));
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, matrix,
+ SkRect::Make(bounds));
return SkSpecialImage::MakeDeferredFromGpu(context,
SkIRect::MakeWH(bounds.width(), bounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->readSurfaceView(),
- renderTargetContext->colorInfo().colorType(),
- renderTargetContext->colorInfo().refColorSpace());
+ surfaceDrawContext->readSurfaceView(),
+ surfaceDrawContext->colorInfo().colorType(),
+ surfaceDrawContext->colorInfo().refColorSpace());
}
#endif
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();
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 04f4453..aefe227 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -88,10 +88,10 @@
return nullptr;
}
- auto renderTargetContext = GrSurfaceDrawContext::MakeWithFallback(
+ auto surfaceDrawContext = GrSurfaceDrawContext::MakeWithFallback(
direct, SkColorTypeToGrColorType(targetCT), nullptr, SkBackingFit::kExact,
this->dimensions());
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return nullptr;
}
@@ -105,16 +105,16 @@
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
paint.setColorFragmentProcessor(std::move(colorFP));
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
- SkRect::MakeIWH(this->width(), this->height()));
- if (!renderTargetContext->asTextureProxy()) {
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(),
+ SkRect::MakeIWH(this->width(), this->height()));
+ if (!surfaceDrawContext->asTextureProxy()) {
return nullptr;
}
- targetCT = GrColorTypeToSkColorType(renderTargetContext->colorInfo().colorType());
- // MDB: this call is okay bc we know 'renderTargetContext' was exact
+ targetCT = GrColorTypeToSkColorType(surfaceDrawContext->colorInfo().colorType());
+ // MDB: this call is okay bc we know 'surfaceDrawContext' was exact
return sk_make_sp<SkImage_Gpu>(sk_ref_sp(direct), kNeedNewImageUniqueID,
- renderTargetContext->readSurfaceView(), targetCT,
+ surfaceDrawContext->readSurfaceView(), targetCT,
this->alphaType(), std::move(targetCS));
}
diff --git a/src/image/SkImage_GpuYUVA.cpp b/src/image/SkImage_GpuYUVA.cpp
index 80fd65b..b203827 100644
--- a/src/image/SkImage_GpuYUVA.cpp
+++ b/src/image/SkImage_GpuYUVA.cpp
@@ -205,10 +205,10 @@
}
// Needs to create a render target in order to draw to it for the yuv->rgb conversion.
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, this->refColorSpace(), SkBackingFit::kExact,
this->dimensions(), 1, GrMipmapped::kNo, GrProtected::kNo);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return;
}
@@ -232,9 +232,9 @@
}
paint.setColorFragmentProcessor(std::move(fp));
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(), rect);
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, SkMatrix::I(), rect);
- fRGBView = renderTargetContext->readSurfaceView();
+ fRGBView = surfaceDrawContext->readSurfaceView();
SkASSERT(fRGBView.swizzle() == GrSwizzle());
for (auto& v : fViews) {
v.reset();
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 3105809..3edcbcc 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -306,10 +306,10 @@
// TODO: investigate preallocating mip maps here
GrColorType ct = SkColorTypeToGrColorType(this->colorType());
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
ctx, ct, nullptr, SkBackingFit::kExact, this->dimensions(), 1, GrMipmapped::kNo,
GrProtected::kNo, kTopLeft_GrSurfaceOrigin, budgeted);
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
return {};
}
@@ -348,10 +348,10 @@
SkMatrix m = SkEncodedOriginToMatrix(yuvaPixmaps.yuvaInfo().origin(),
this->width(),
this->height());
- renderTargetContext->drawRect(nullptr, std::move(paint), GrAA::kNo, m, r);
+ surfaceDrawContext->drawRect(nullptr, std::move(paint), GrAA::kNo, m, r);
- SkASSERT(renderTargetContext->asTextureProxy());
- return renderTargetContext->readSurfaceView();
+ SkASSERT(surfaceDrawContext->asTextureProxy());
+ return surfaceDrawContext->readSurfaceView();
}
sk_sp<SkCachedData> SkImage_Lazy::getPlanes(
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 73c4f76..1a0489e 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -125,7 +125,7 @@
const SkImageInfo info = fDevice->imageInfo();
sk_sp<SkImage> image;
if (srcView.asTextureProxy()) {
- // The renderTargetContext coming out of SkGpuDevice should always be exact and the
+ // The surfaceDrawContext coming out of SkGpuDevice should always be exact and the
// above copy creates a kExact surfaceContext.
SkASSERT(srcView.proxy()->priv().isExact());
image = sk_make_sp<SkImage_Gpu>(sk_ref_sp(rContext), kNeedNewImageUniqueID,
diff --git a/tests/PathRendererCacheTests.cpp b/tests/PathRendererCacheTests.cpp
index e8c091a..c5e7d90 100644
--- a/tests/PathRendererCacheTests.cpp
+++ b/tests/PathRendererCacheTests.cpp
@@ -31,7 +31,7 @@
}
static void draw_path(GrRecordingContext* rContext,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const SkPath& path,
GrPathRenderer* pr,
GrAAType aaType,
@@ -40,8 +40,8 @@
GrPaint paint;
paint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc));
- SkIRect clipConservativeBounds = SkIRect::MakeWH(renderTargetContext->width(),
- renderTargetContext->height());
+ SkIRect clipConservativeBounds = SkIRect::MakeWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
GrStyledShape shape(path, style);
if (shape.style().applies()) {
shape = shape.applyStyle(GrStyle::Apply::kPathEffectAndStrokeRec, 1.0f);
@@ -51,7 +51,7 @@
GrPathRenderer::DrawPathArgs args{rContext,
std::move(paint),
&GrUserStencilSettings::kUnused,
- renderTargetContext,
+ surfaceDrawContext,
nullptr,
&clipConservativeBounds,
&matrix,
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index a4ab132..635220d 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -174,9 +174,9 @@
GrGpu* gpu = context->priv().getGpu();
#endif
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {1, 1});
- if (!renderTargetContext) {
+ if (!surfaceDrawContext) {
ERRORF(reporter, "Could not create render target context.");
return;
}
@@ -192,18 +192,18 @@
REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 0);
#endif
// Adding discard to appease vulkan validation warning about loading uninitialized data on draw
- renderTargetContext->discard();
+ surfaceDrawContext->discard();
GrPaint grPaint;
// This one should succeed.
- renderTargetContext->addDrawOp(Op::Make(context, attribCnt));
+ surfaceDrawContext->addDrawOp(Op::Make(context, attribCnt));
context->flushAndSubmit();
#if GR_GPU_STATS
REPORTER_ASSERT(reporter, gpu->stats()->numDraws() == 1);
REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 0);
#endif
context->priv().resetGpuStats();
- renderTargetContext->addDrawOp(Op::Make(context, attribCnt + 1));
+ surfaceDrawContext->addDrawOp(Op::Make(context, attribCnt + 1));
context->flushAndSubmit();
#if GR_GPU_STATS
REPORTER_ASSERT(reporter, gpu->stats()->numDraws() == 0);
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 89557e5..7006c10 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -157,7 +157,7 @@
for (bool makeClone : {false, true}) {
for (int parentCnt = 0; parentCnt < 2; parentCnt++) {
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
context, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kApprox, {1, 1});
{
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(
@@ -176,10 +176,10 @@
clone = fp->clone();
}
GrOp::Owner op = TestOp::Make(context, std::move(fp));
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
if (clone) {
op = TestOp::Make(context, std::move(clone));
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
}
diff --git a/tests/ProgramsTest.cpp b/tests/ProgramsTest.cpp
index 0008f7c..1963c0a 100644
--- a/tests/ProgramsTest.cpp
+++ b/tests/ProgramsTest.cpp
@@ -281,9 +281,9 @@
static const int NUM_TESTS = 1024;
for (int t = 0; t < NUM_TESTS; t++) {
// setup random render target(can fail)
- auto renderTargetContext = random_render_target_context(direct, &random, caps);
- if (!renderTargetContext) {
- SkDebugf("Could not allocate renderTargetContext");
+ auto surfaceDrawContext = random_render_target_context(direct, &random, caps);
+ if (!surfaceDrawContext) {
+ SkDebugf("Could not allocate surfaceDrawContext");
return false;
}
@@ -291,18 +291,18 @@
GrProcessorTestData ptd(&random, direct, /*maxTreeDepth=*/1, SK_ARRAY_COUNT(views), views);
set_random_color_coverage_stages(&paint, &ptd, maxStages, maxLevels);
set_random_xpf(&paint, &ptd);
- GrDrawRandomOp(&random, renderTargetContext.get(), std::move(paint));
+ GrDrawRandomOp(&random, surfaceDrawContext.get(), std::move(paint));
}
// Flush everything, test passes if flush is successful(ie, no asserts are hit, no crashes)
direct->flush(GrFlushInfo());
direct->submit(false);
// Validate that GrFPs work correctly without an input.
- auto renderTargetContext = GrSurfaceDrawContext::Make(
+ auto surfaceDrawContext = GrSurfaceDrawContext::Make(
direct, GrColorType::kRGBA_8888, nullptr, SkBackingFit::kExact,
{kRenderTargetWidth, kRenderTargetHeight});
- if (!renderTargetContext) {
- SkDebugf("Could not allocate a renderTargetContext");
+ if (!surfaceDrawContext) {
+ SkDebugf("Could not allocate a surfaceDrawContext");
return false;
}
@@ -318,7 +318,7 @@
auto fp = GrFragmentProcessorTestFactory::MakeIdx(i, &ptd);
auto blockFP = BlockInputFragmentProcessor::Make(std::move(fp));
paint.setColorFragmentProcessor(std::move(blockFP));
- GrDrawRandomOp(&random, renderTargetContext.get(), std::move(paint));
+ GrDrawRandomOp(&random, surfaceDrawContext.get(), std::move(paint));
direct->flush(GrFlushInfo());
direct->submit(false);
diff --git a/tests/TriangulatingPathRendererTests.cpp b/tests/TriangulatingPathRendererTests.cpp
index 96f20b5..610ad72 100644
--- a/tests/TriangulatingPathRendererTests.cpp
+++ b/tests/TriangulatingPathRendererTests.cpp
@@ -701,7 +701,7 @@
}
static void test_path(GrRecordingContext* rContext,
- GrSurfaceDrawContext* renderTargetContext,
+ GrSurfaceDrawContext* surfaceDrawContext,
const SkPath& path,
const SkMatrix& matrix = SkMatrix::I(),
GrAAType aaType = GrAAType::kNone,
@@ -715,14 +715,14 @@
paint.setColorFragmentProcessor(std::move(fp));
}
- SkIRect clipConservativeBounds = SkIRect::MakeWH(renderTargetContext->width(),
- renderTargetContext->height());
+ SkIRect clipConservativeBounds = SkIRect::MakeWH(surfaceDrawContext->width(),
+ surfaceDrawContext->height());
GrStyle style(SkStrokeRec::kFill_InitStyle);
GrStyledShape shape(path, style);
GrPathRenderer::DrawPathArgs args{rContext,
std::move(paint),
&GrUserStencilSettings::kUnused,
- renderTargetContext,
+ surfaceDrawContext,
nullptr,
&clipConservativeBounds,
&matrix,
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp
index bd27345..61e86c2 100644
--- a/tools/gpu/GrTest.cpp
+++ b/tools/gpu/GrTest.cpp
@@ -137,8 +137,8 @@
DRAW_OP_TEST_EXTERN(TriangulatingPathOp);
DRAW_OP_TEST_EXTERN(TextureOp);
-void GrDrawRandomOp(SkRandom* random, GrSurfaceDrawContext* renderTargetContext, GrPaint&& paint) {
- auto context = renderTargetContext->recordingContext();
+void GrDrawRandomOp(SkRandom* random, GrSurfaceDrawContext* surfaceDrawContext, GrPaint&& paint) {
+ auto context = surfaceDrawContext->recordingContext();
using MakeDrawOpFn = GrOp::Owner (GrPaint&&, SkRandom*,
GrRecordingContext*, int numSamples);
static constexpr MakeDrawOpFn* gFactories[] = {
@@ -168,11 +168,11 @@
static constexpr size_t kTotal = SK_ARRAY_COUNT(gFactories);
uint32_t index = random->nextULessThan(static_cast<uint32_t>(kTotal));
auto op = gFactories[index](
- std::move(paint), random, context, renderTargetContext->numSamples());
+ std::move(paint), random, context, surfaceDrawContext->numSamples());
// Creating a GrAtlasTextOp my not produce an op if for example, it is totally outside the
// render target context.
if (op) {
- renderTargetContext->addDrawOp(std::move(op));
+ surfaceDrawContext->addDrawOp(std::move(op));
}
}