Rename GrSurfaceDrawContext to skgpu::v1::SurfaceDrawContext
This CL is mostly mechanical. It:
replaces "src/gpu/GrSurfaceDrawContext.h" #includes with
"src/gpu/v1/SurfaceDrawContext_v1.h" and reorders
replaces "class GrSurfaceDrawContext;" with
"namespace skgpu { namespace v1 { class SurfaceDrawContext; }}"
replaces "GrSurfaceDrawContext*" with "auto" where possible
replaces "rtc" with "sdc"
replaces "surfaceDrawContext" with "sdc"
replaces GrSurfaceDrawContext with skgpu::v1::SurfaceDrawContext
reflows parameters as needed
This CL does not try to:
make skgpu::v1::SurfaceDrawContext V1-only
minimize the skgpu and/or skgpu::v1 prefixes
Those two tasks will be accomplished in follow up CLs. This CL is just trying to get the bulk of the mechanical changes comprehensibly landed.
Bug: skia:11837
Change-Id: I6fe59080249d585df8f5d27c6b67569cdc35842f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 787c817..9ea7af3 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -17,7 +17,6 @@
#include "src/gpu/GrGeometryProcessor.h"
#include "src/gpu/GrProcessor.h"
#include "src/gpu/GrProgramInfo.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
@@ -30,6 +29,7 @@
#include "src/gpu/ops/GrAAConvexPathRenderer.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
GrAAConvexPathRenderer::GrAAConvexPathRenderer() {
}
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index d128092..2303da0 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -22,7 +22,6 @@
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrUtil.h"
#include "src/gpu/effects/GrBezierEffect.h"
#include "src/gpu/geometry/GrPathUtils.h"
@@ -30,6 +29,7 @@
#include "src/gpu/ops/GrAAHairLinePathRenderer.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
#define PREALLOC_PTARRAY(N) SkSTArray<(N),SkPoint, true>
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index 4ad7c41..7576d58 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -18,7 +18,6 @@
#include "src/gpu/GrProcessor.h"
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
@@ -27,6 +26,7 @@
#include "src/gpu/ops/GrAALinearizingConvexPathRenderer.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
static const int DEFAULT_BUFFER_SIZE = 100;
diff --git a/src/gpu/ops/GrAtlasPathRenderer.cpp b/src/gpu/ops/GrAtlasPathRenderer.cpp
index 42b7483..26bbe99 100644
--- a/src/gpu/ops/GrAtlasPathRenderer.cpp
+++ b/src/gpu/ops/GrAtlasPathRenderer.cpp
@@ -11,7 +11,6 @@
#include "src/core/SkIPoint16.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrDirectContextPriv.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrVx.h"
#include "src/gpu/effects/GrModulateAtlasCoverageEffect.h"
#include "src/gpu/geometry/GrStyledShape.h"
@@ -19,6 +18,7 @@
#include "src/gpu/tessellate/GrAtlasRenderTask.h"
#include "src/gpu/tessellate/GrTessellationPathRenderer.h"
#include "src/gpu/tessellate/shaders/GrTessellationShader.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
using grvx::float2;
using grvx::int2;
@@ -278,7 +278,7 @@
return true;
}
-GrFPResult GrAtlasPathRenderer::makeAtlasClipEffect(const GrSurfaceDrawContext* sdc,
+GrFPResult GrAtlasPathRenderer::makeAtlasClipEffect(const skgpu::v1::SurfaceDrawContext* sdc,
const GrOp* opBeingClipped,
std::unique_ptr<GrFragmentProcessor> inputFP,
const SkIRect& drawBounds,
diff --git a/src/gpu/ops/GrAtlasPathRenderer.h b/src/gpu/ops/GrAtlasPathRenderer.h
index 370b4a3..fb8420d 100644
--- a/src/gpu/ops/GrAtlasPathRenderer.h
+++ b/src/gpu/ops/GrAtlasPathRenderer.h
@@ -50,7 +50,7 @@
// 128^2 total pixels if the surfaceDrawContext supports MSAA or DMSAA.)
//
// Also returns GrFPFailure() if the view matrix has perspective.
- GrFPResult makeAtlasClipEffect(const GrSurfaceDrawContext*,
+ GrFPResult makeAtlasClipEffect(const skgpu::v1::SurfaceDrawContext*,
const GrOp* opBeingClipped,
std::unique_ptr<GrFragmentProcessor> inputFP,
const SkIRect& drawBounds,
diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp
index e0fe16c..64e20d4 100644
--- a/src/gpu/ops/GrAtlasTextOp.cpp
+++ b/src/gpu/ops/GrAtlasTextOp.cpp
@@ -19,13 +19,13 @@
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrResourceProvider.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/effects/GrBitmapTextGeoProc.h"
#include "src/gpu/effects/GrDistanceFieldGeoProc.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h"
#include "src/gpu/text/GrAtlasManager.h"
#include "src/gpu/text/GrDistanceFieldAdjustTable.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
#if GR_TEST_UTILS
#include "src/gpu/GrDrawOpTest.h"
@@ -488,7 +488,7 @@
#if GR_TEST_UTILS
-GrOp::Owner GrAtlasTextOp::CreateOpTestingOnly(GrSurfaceDrawContext* rtc,
+GrOp::Owner GrAtlasTextOp::CreateOpTestingOnly(skgpu::v1::SurfaceDrawContext* sdc,
const SkPaint& skPaint,
const SkFont& font,
const SkMatrixProvider& mtxProvider,
@@ -506,11 +506,11 @@
return nullptr;
}
- auto rContext = rtc->recordingContext();
+ auto rContext = sdc->recordingContext();
GrSDFTControl control =
- rContext->priv().getSDFTControl(rtc->surfaceProps().isUseDeviceIndependentFonts());
+ rContext->priv().getSDFTControl(sdc->surfaceProps().isUseDeviceIndependentFonts());
- SkGlyphRunListPainter* painter = rtc->glyphRunPainter();
+ SkGlyphRunListPainter* painter = sdc->glyphRunPainter();
sk_sp<GrTextBlob> blob = GrTextBlob::Make(glyphRunList, skPaint, drawMatrix, control, painter);
if (blob->subRunList().isEmpty()) {
@@ -521,7 +521,7 @@
SkASSERT(subRun);
GrOp::Owner op;
std::tie(std::ignore, op) = subRun->makeAtlasTextOp(
- nullptr, mtxProvider, glyphRunList, skPaint, rtc, nullptr);
+ nullptr, mtxProvider, glyphRunList, skPaint, sdc, nullptr);
return op;
}
diff --git a/src/gpu/ops/GrAtlasTextOp.h b/src/gpu/ops/GrAtlasTextOp.h
index 95b5bca..cf5466b 100644
--- a/src/gpu/ops/GrAtlasTextOp.h
+++ b/src/gpu/ops/GrAtlasTextOp.h
@@ -116,10 +116,10 @@
static constexpr int kMaskTypeCount = static_cast<int>(MaskType::kLast) + 1;
#if GR_TEST_UTILS
- static GrOp::Owner CreateOpTestingOnly(GrSurfaceDrawContext* rtc,
- const SkPaint& skPaint,
- const SkFont& font,
- const SkMatrixProvider& mtxProvider,
+ static GrOp::Owner CreateOpTestingOnly(skgpu::v1::SurfaceDrawContext*,
+ const SkPaint&,
+ const SkFont&,
+ const SkMatrixProvider&,
const char* text,
int x,
int y);
diff --git a/src/gpu/ops/GrDashLinePathRenderer.cpp b/src/gpu/ops/GrDashLinePathRenderer.cpp
index c7d22ee..7abd52f 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.cpp
+++ b/src/gpu/ops/GrDashLinePathRenderer.cpp
@@ -7,11 +7,11 @@
#include "src/gpu/GrAuditTrail.h"
#include "src/gpu/GrGpu.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrDashLinePathRenderer.h"
#include "src/gpu/ops/GrDashOp.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
GrPathRenderer::CanDrawPath
GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 9385840..53f33f5 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -22,13 +22,13 @@
#include "src/gpu/GrProgramInfo.h"
#include "src/gpu/GrSimpleMesh.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrUtil.h"
#include "src/gpu/effects/GrDisableColorXP.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
GrDefaultPathRenderer::GrDefaultPathRenderer() {
}
@@ -592,7 +592,7 @@
} // anonymous namespace
-bool GrDefaultPathRenderer::internalDrawPath(GrSurfaceDrawContext* surfaceDrawContext,
+bool GrDefaultPathRenderer::internalDrawPath(skgpu::v1::SurfaceDrawContext* sdc,
GrPaint&& paint,
GrAAType aaType,
const GrUserStencilSettings& userStencilSettings,
@@ -600,7 +600,7 @@
const SkMatrix& viewMatrix,
const GrStyledShape& shape,
bool stencilOnly) {
- auto context = surfaceDrawContext->recordingContext();
+ auto context = sdc->recordingContext();
SkASSERT(GrAAType::kCoverage != aaType);
SkPath path;
@@ -688,7 +688,7 @@
SkScalar srcSpaceTol = GrPathUtils::scaleToleranceToSrc(tol, viewMatrix, path.getBounds());
SkRect devBounds;
- GetPathDevBounds(path, surfaceDrawContext->asRenderTargetProxy()->backingStoreDimensions(),
+ GetPathDevBounds(path, sdc->asRenderTargetProxy()->backingStoreDimensions(),
viewMatrix, &devBounds);
for (int p = 0; p < passCount; ++p) {
@@ -714,9 +714,9 @@
viewMatrix;
// This is a non-coverage aa rect op since we assert aaType != kCoverage at the start
assert_alive(paint);
- surfaceDrawContext->stencilRect(clip, passes[p], std::move(paint),
- GrAA(aaType == GrAAType::kMSAA), viewM, bounds,
- &localMatrix);
+ sdc->stencilRect(clip, passes[p], std::move(paint),
+ GrAA(aaType == GrAAType::kMSAA), viewM, bounds,
+ &localMatrix);
} else {
bool stencilPass = stencilOnly || passCount > 1;
GrOp::Owner op;
@@ -731,7 +731,7 @@
op = DefaultPathOp::Make(context, std::move(paint), path, srcSpaceTol, newCoverage,
viewMatrix, isHairline, aaType, devBounds, passes[p]);
}
- surfaceDrawContext->addDrawOp(clip, std::move(op));
+ sdc->addDrawOp(clip, std::move(op));
}
}
return true;
diff --git a/src/gpu/ops/GrDefaultPathRenderer.h b/src/gpu/ops/GrDefaultPathRenderer.h
index e7274d6..d9106a0 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.h
+++ b/src/gpu/ops/GrDefaultPathRenderer.h
@@ -31,7 +31,7 @@
void onStencilPath(const StencilPathArgs&) override;
- bool internalDrawPath(GrSurfaceDrawContext*,
+ bool internalDrawPath(skgpu::v1::SurfaceDrawContext*,
GrPaint&&,
GrAAType,
const GrUserStencilSettings&,
diff --git a/src/gpu/ops/GrDrawOp.h b/src/gpu/ops/GrDrawOp.h
index a3282cc..5442d6a 100644
--- a/src/gpu/ops/GrDrawOp.h
+++ b/src/gpu/ops/GrDrawOp.h
@@ -15,7 +15,7 @@
#include "src/gpu/ops/GrOp.h"
class GrAppliedClip;
-class GrSurfaceDrawContext;
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
class GrShape;
/**
@@ -54,8 +54,11 @@
* to combine with other ops. If the op knows how to clip its own geometry then it will
* generally be much faster than a generalized clip method.
*/
- virtual ClipResult clipToShape(GrSurfaceDrawContext*, SkClipOp, const SkMatrix& clipMatrix,
- const GrShape&, GrAA) {
+ virtual ClipResult clipToShape(skgpu::v1::SurfaceDrawContext*,
+ SkClipOp,
+ const SkMatrix& /* clipMatrix */,
+ const GrShape&,
+ GrAA) {
return ClipResult::kFail;
}
diff --git a/src/gpu/ops/GrFillRRectOp.cpp b/src/gpu/ops/GrFillRRectOp.cpp
index 54a829e..974eec8 100644
--- a/src/gpu/ops/GrFillRRectOp.cpp
+++ b/src/gpu/ops/GrFillRRectOp.cpp
@@ -47,8 +47,11 @@
FixedFunctionFlags fixedFunctionFlags() const final { return fHelper.fixedFunctionFlags(); }
- ClipResult clipToShape(GrSurfaceDrawContext*, SkClipOp, const SkMatrix& clipMatrix,
- const GrShape&, GrAA) override;
+ ClipResult clipToShape(skgpu::v1::SurfaceDrawContext*,
+ SkClipOp,
+ const SkMatrix& clipMatrix,
+ const GrShape&,
+ GrAA) override;
GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*, GrClampType) final;
CombineResult onCombineIfPossible(GrOp*, SkArenaAlloc*, const GrCaps&) final;
@@ -206,7 +209,7 @@
GrOp::IsHairline::kNo);
}
-GrDrawOp::ClipResult FillRRectOp::clipToShape(GrSurfaceDrawContext* sdc, SkClipOp clipOp,
+GrDrawOp::ClipResult FillRRectOp::clipToShape(skgpu::v1::SurfaceDrawContext* sdc, SkClipOp clipOp,
const SkMatrix& clipMatrix, const GrShape& shape,
GrAA aa) {
SkASSERT(fInstanceCount == 1); // This needs to be called before combining.
diff --git a/src/gpu/ops/GrFillRectOp.cpp b/src/gpu/ops/GrFillRectOp.cpp
index c69bca1..54c805b 100644
--- a/src/gpu/ops/GrFillRectOp.cpp
+++ b/src/gpu/ops/GrFillRectOp.cpp
@@ -14,7 +14,6 @@
#include "src/gpu/GrOpsTypes.h"
#include "src/gpu/GrPaint.h"
#include "src/gpu/GrProgramInfo.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/geometry/GrQuad.h"
#include "src/gpu/geometry/GrQuadBuffer.h"
@@ -25,6 +24,7 @@
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrQuadPerEdgeAA.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
namespace {
@@ -517,7 +517,7 @@
return op;
}
-void GrFillRectOp::AddFillRectOps(GrSurfaceDrawContext* rtc,
+void GrFillRectOp::AddFillRectOps(skgpu::v1::SurfaceDrawContext* sdc,
const GrClip* clip,
GrRecordingContext* context,
GrPaint&& paint,
@@ -539,7 +539,7 @@
offset += numConsumed;
numLeft -= numConsumed;
- rtc->addDrawOp(clip, std::move(op));
+ sdc->addDrawOp(clip, std::move(op));
}
SkASSERT(offset == cnt);
diff --git a/src/gpu/ops/GrFillRectOp.h b/src/gpu/ops/GrFillRectOp.h
index 6ba4c10..e018905 100644
--- a/src/gpu/ops/GrFillRectOp.h
+++ b/src/gpu/ops/GrFillRectOp.h
@@ -18,7 +18,7 @@
class GrQuad;
struct GrQuadSetEntry;
class GrRecordingContext;
-class GrSurfaceDrawContext;
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
struct GrUserStencilSettings;
class SkMatrix;
struct SkRect;
@@ -33,26 +33,26 @@
public:
using InputFlags = GrSimpleMeshDrawOpHelper::InputFlags;
- static GrOp::Owner Make(GrRecordingContext* context,
- GrPaint&& paint,
- GrAAType aaType,
- DrawQuad* quad,
- const GrUserStencilSettings* stencil = nullptr,
+ static GrOp::Owner Make(GrRecordingContext*,
+ GrPaint&&,
+ GrAAType,
+ DrawQuad*,
+ const GrUserStencilSettings* = nullptr,
InputFlags = InputFlags::kNone);
// Utility function to create a non-AA rect transformed by view. This is used commonly enough
// in testing and GMs that manage ops without going through GrRTC that it's worth the
// convenience.
- static GrOp::Owner MakeNonAARect(GrRecordingContext* context,
- GrPaint&& paint,
+ static GrOp::Owner MakeNonAARect(GrRecordingContext*,
+ GrPaint&&,
const SkMatrix& view,
- const SkRect& rect,
- const GrUserStencilSettings* stencil = nullptr);
+ const SkRect&,
+ const GrUserStencilSettings* = nullptr);
// Bulk API for drawing quads with a single op
// TODO(michaelludwig) - remove if the bulk API is not useful for SkiaRenderer
- static void AddFillRectOps(GrSurfaceDrawContext*,
- const GrClip* clip,
+ static void AddFillRectOps(skgpu::v1::SurfaceDrawContext*,
+ const GrClip*,
GrRecordingContext*,
GrPaint&&,
GrAAType,
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index 295cbc27..ab55b23 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -21,7 +21,6 @@
#include "src/gpu/GrDistanceFieldGenFromVector.h"
#include "src/gpu/GrDrawOpTest.h"
#include "src/gpu/GrResourceProvider.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/effects/GrBitmapTextGeoProc.h"
#include "src/gpu/effects/GrDistanceFieldGeoProc.h"
@@ -31,6 +30,7 @@
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
#include "src/gpu/ops/GrSmallPathAtlasMgr.h"
#include "src/gpu/ops/GrSmallPathShapeData.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
// mip levels
static constexpr SkScalar kIdealMinMIP = 12;
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index e5245f9..d705e24 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -27,7 +27,6 @@
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrResourceProviderPriv.h"
#include "src/gpu/GrShaderCaps.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/SkGr.h"
@@ -43,6 +42,7 @@
#include "src/gpu/ops/GrQuadPerEdgeAA.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelper.h"
#include "src/gpu/ops/GrTextureOp.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
namespace {
@@ -1184,9 +1184,9 @@
// A helper class that assists in breaking up bulk API quad draws into manageable chunks.
class GrTextureOp::BatchSizeLimiter {
public:
- BatchSizeLimiter(GrSurfaceDrawContext* sdc,
+ BatchSizeLimiter(skgpu::v1::SurfaceDrawContext* sdc,
const GrClip* clip,
- GrRecordingContext* context,
+ GrRecordingContext* rContext,
int numEntries,
GrSamplerState::Filter filter,
GrSamplerState::MipmapMode mm,
@@ -1196,7 +1196,7 @@
sk_sp<GrColorSpaceXform> textureColorSpaceXform)
: fSDC(sdc)
, fClip(clip)
- , fContext(context)
+ , fContext(rContext)
, fFilter(filter)
, fMipmapMode(mm)
, fSaturate(saturate)
@@ -1229,22 +1229,22 @@
int baseIndex() const { return fNumClumped; }
private:
- GrSurfaceDrawContext* fSDC;
- const GrClip* fClip;
- GrRecordingContext* fContext;
- GrSamplerState::Filter fFilter;
- GrSamplerState::MipmapMode fMipmapMode;
- GrTextureOp::Saturate fSaturate;
- SkCanvas::SrcRectConstraint fConstraint;
- const SkMatrix& fViewMatrix;
- sk_sp<GrColorSpaceXform> fTextureColorSpaceXform;
+ skgpu::v1::SurfaceDrawContext* fSDC;
+ const GrClip* fClip;
+ GrRecordingContext* fContext;
+ GrSamplerState::Filter fFilter;
+ GrSamplerState::MipmapMode fMipmapMode;
+ GrTextureOp::Saturate fSaturate;
+ SkCanvas::SrcRectConstraint fConstraint;
+ const SkMatrix& fViewMatrix;
+ sk_sp<GrColorSpaceXform> fTextureColorSpaceXform;
- int fNumLeft;
- int fNumClumped = 0; // also the offset for the start of the next clump
+ int fNumLeft;
+ int fNumClumped = 0; // also the offset for the start of the next clump
};
// Greedily clump quad draws together until the index buffer limit is exceeded.
-void GrTextureOp::AddTextureSetOps(GrSurfaceDrawContext* rtc,
+void GrTextureOp::AddTextureSetOps(skgpu::v1::SurfaceDrawContext* sdc,
const GrClip* clip,
GrRecordingContext* context,
GrTextureSetEntry set[],
@@ -1294,7 +1294,7 @@
auto op = Make(context, set[i].fProxyView, set[i].fSrcAlphaType, textureColorSpaceXform,
filter, mm, set[i].fColor, saturate, blendMode, aaType, &quad, subset);
- rtc->addDrawOp(clip, std::move(op));
+ sdc->addDrawOp(clip, std::move(op));
}
return;
}
@@ -1305,11 +1305,11 @@
GrResourceProvider::MaxNumAAQuads())) {
auto op = TextureOp::Make(context, set, cnt, proxyRunCnt, filter, mm, saturate, aaType,
constraint, viewMatrix, std::move(textureColorSpaceXform));
- rtc->addDrawOp(clip, std::move(op));
+ sdc->addDrawOp(clip, std::move(op));
return;
}
- BatchSizeLimiter state(rtc, clip, context, cnt, filter, mm, saturate, constraint, viewMatrix,
+ BatchSizeLimiter state(sdc, clip, context, cnt, filter, mm, saturate, constraint, viewMatrix,
std::move(textureColorSpaceXform));
// kNone and kMSAA never get altered
diff --git a/src/gpu/ops/GrTextureOp.h b/src/gpu/ops/GrTextureOp.h
index 4bb33f5..2361f2e 100644
--- a/src/gpu/ops/GrTextureOp.h
+++ b/src/gpu/ops/GrTextureOp.h
@@ -18,7 +18,7 @@
class GrClip;
class GrColorSpaceXform;
class GrDrawOp;
-class GrSurfaceDrawContext;
+namespace skgpu { namespace v1 { class SurfaceDrawContext; }}
class GrTextureProxy;
struct GrTextureSetEntry;
struct SkRect;
@@ -60,8 +60,8 @@
// Automatically falls back to using one GrFillRectOp per entry if dynamic states are not
// supported, or if the blend mode is not src-over. 'cnt' is the size of the entry array.
// 'proxyCnt' <= 'cnt' and represents the number of proxy switches within the array.
- static void AddTextureSetOps(GrSurfaceDrawContext*,
- const GrClip* clip,
+ static void AddTextureSetOps(skgpu::v1::SurfaceDrawContext*,
+ const GrClip*,
GrRecordingContext*,
GrTextureSetEntry[],
int cnt,
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
index a9353dd..17d6967 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
@@ -22,13 +22,13 @@
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrSimpleMesh.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrThreadSafeCache.h"
#include "src/gpu/GrTriangulator.h"
#include "src/gpu/geometry/GrPathUtils.h"
#include "src/gpu/geometry/GrStyledShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
+#include "src/gpu/v1/SurfaceDrawContext_v1.h"
#include <cstdio>