Revert "Rename GrShape to GrStyledShape"
This reverts commit f3f08af010eebdb9c1501bdf1b3d8e715298b05f.
Reason for revert: maybe this is breaking the ios perf bot; it is the first CL that caused the bot to fail, but I can't really say why this would break them.
Original change's description:
> Rename GrShape to GrStyledShape
>
> Change-Id: Ic457e634b4b95356f5615cff3fce1ca7d7677c26
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284036
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I2e5adbfc820811fbbde9cb57af28f86a7ba40bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284231
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index 476d075..72c5d55 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -19,7 +19,7 @@
#include "src/gpu/GrStyle.h"
#include "src/gpu/GrTextureProxy.h"
#include "src/gpu/effects/GrTextureEffect.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "include/core/SkPaint.h"
#include "src/core/SkDraw.h"
@@ -71,7 +71,7 @@
GrRenderTargetContext* renderTargetContext,
const GrClip& clipData,
const SkMatrix& viewMatrix,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMaskFilter* filter,
const SkIRect& clipBounds,
GrPaint&& paint,
@@ -174,7 +174,7 @@
static std::unique_ptr<GrRenderTargetContext> create_mask_GPU(GrRecordingContext* context,
const SkIRect& maskRect,
const SkMatrix& origViewMatrix,
- const GrStyledShape& shape,
+ const GrShape& shape,
int sampleCnt) {
// Use GrResourceProvider::MakeApprox to implement our own approximate size matching, but demand
// a "SkBackingFit::kExact" size match on the actual render target. We do this because the
@@ -210,7 +210,7 @@
return rtContext;
}
-static bool get_unclipped_shape_dev_bounds(const GrStyledShape& shape, const SkMatrix& matrix,
+static bool get_unclipped_shape_dev_bounds(const GrShape& shape, const SkMatrix& matrix,
SkIRect* devBounds) {
SkRect shapeBounds = shape.styledBounds();
if (shapeBounds.isEmpty()) {
@@ -239,7 +239,7 @@
// is no intersection.
static bool get_shape_and_clip_bounds(GrRenderTargetContext* renderTargetContext,
const GrClip& clip,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& matrix,
SkIRect* unclippedDevShapeBounds,
SkIRect* devClipBounds) {
@@ -262,11 +262,11 @@
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkMaskFilterBase* maskFilter,
- const GrStyledShape& origShape) {
+ const GrShape& origShape) {
SkASSERT(maskFilter);
- const GrStyledShape* shape = &origShape;
- SkTLazy<GrStyledShape> tmpShape;
+ const GrShape* shape = &origShape;
+ SkTLazy<GrShape> tmpShape;
if (origShape.style().applies()) {
SkScalar styleScale = GrStyle::MatrixToScaleFactor(viewMatrix);
@@ -440,7 +440,7 @@
void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
GrRenderTargetContext* renderTargetContext,
const GrClip& clip,
- const GrStyledShape& shape,
+ const GrShape& shape,
GrPaint&& paint,
const SkMatrix& viewMatrix,
const SkMaskFilter* mf) {
@@ -453,7 +453,7 @@
const GrClip& clip,
const SkPaint& paint,
const SkMatrix& viewMatrix,
- const GrStyledShape& shape) {
+ const GrShape& shape) {
if (context->priv().abandoned()) {
return;
}
diff --git a/src/gpu/GrBlurUtils.h b/src/gpu/GrBlurUtils.h
index 51c54be..d2f2570 100644
--- a/src/gpu/GrBlurUtils.h
+++ b/src/gpu/GrBlurUtils.h
@@ -16,7 +16,7 @@
class GrRecordingContext;
class GrRenderTarget;
class GrRenderTargetContext;
-class GrStyledShape;
+class GrShape;
class GrStyle;
struct SkIRect;
class SkMaskFilter;
@@ -38,7 +38,7 @@
const GrClip&,
const SkPaint&,
const SkMatrix& viewMatrix,
- const GrStyledShape&);
+ const GrShape&);
/**
* Draw a shape handling the mask filter. The mask filter is not optional.
@@ -47,7 +47,7 @@
void drawShapeWithMaskFilter(GrRecordingContext*,
GrRenderTargetContext*,
const GrClip&,
- const GrStyledShape&,
+ const GrShape&,
GrPaint&&,
const SkMatrix& viewMatrix,
const SkMaskFilter*);
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 3c10df9..63409c2 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -28,7 +28,7 @@
#include "src/gpu/effects/GrRRectEffect.h"
#include "src/gpu/effects/GrTextureDomain.h"
#include "src/gpu/effects/generated/GrDeviceSpaceEffect.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
typedef SkClipStack::Element Element;
typedef GrReducedClip::InitialState InitialState;
@@ -131,7 +131,7 @@
needsStencil ? GrPathRendererChain::DrawType::kStencilAndColor
: GrPathRendererChain::DrawType::kColor;
- GrStyledShape shape(path, GrStyle::SimpleFill());
+ GrShape shape(path, GrStyle::SimpleFill());
GrPathRenderer::CanDrawPathArgs canDrawArgs;
canDrawArgs.fCaps = context->priv().caps();
canDrawArgs.fProxy = renderTargetContext->asRenderTargetProxy();
@@ -450,7 +450,7 @@
SkPath clipPath;
element->asDeviceSpacePath(&clipPath);
clipPath.toggleInverseFillType();
- GrStyledShape shape(clipPath, GrStyle::SimpleFill());
+ GrShape shape(clipPath, GrStyle::SimpleFill());
helper.drawShape(shape, translate, SkRegion::kReplace_Op, aa, 0x00);
continue;
}
@@ -462,7 +462,7 @@
} else {
SkPath path;
element->asDeviceSpacePath(&path);
- GrStyledShape shape(path, GrStyle::SimpleFill());
+ GrShape shape(path, GrStyle::SimpleFill());
helper.drawShape(shape, translate, (SkRegion::Op)op, aa, 0xFF);
}
}
diff --git a/src/gpu/GrPath.cpp b/src/gpu/GrPath.cpp
index b214187..625f8c4 100644
--- a/src/gpu/GrPath.cpp
+++ b/src/gpu/GrPath.cpp
@@ -6,7 +6,7 @@
*/
#include "src/gpu/GrPath.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
static inline void write_style_key(uint32_t* key, const GrStyle& style) {
// Pass 1 for the scale since the GPU will apply the style not GrStyle::applyToPath().
@@ -14,7 +14,7 @@
}
-void GrPath::ComputeKey(const GrStyledShape& shape, GrUniqueKey* key, bool* outIsVolatile) {
+void GrPath::ComputeKey(const GrShape& shape, GrUniqueKey* key, bool* outIsVolatile) {
int geoCnt = shape.unstyledKeySize();
int styleCnt = GrStyle::KeySize(shape.style(), GrStyle::Apply::kPathEffectAndStrokeRec);
// This should only fail for an arbitrary path effect, and we should not have gotten
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index 1792870..9fc84fd 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -14,7 +14,7 @@
#include "src/gpu/GrPathRendering.h"
#include "src/gpu/GrStyle.h"
-class GrStyledShape;
+class GrShape;
class GrPath : public GrGpuResource {
public:
@@ -32,7 +32,7 @@
{
}
- static void ComputeKey(const GrStyledShape&, GrUniqueKey* key, bool* outIsVolatile);
+ static void ComputeKey(const GrShape&, GrUniqueKey* key, bool* outIsVolatile);
const SkRect& getBounds() const { return fBounds; }
diff --git a/src/gpu/GrPathRenderer.cpp b/src/gpu/GrPathRenderer.cpp
index b049a8b..ecc9e09 100644
--- a/src/gpu/GrPathRenderer.cpp
+++ b/src/gpu/GrPathRenderer.cpp
@@ -12,7 +12,7 @@
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrUserStencilSettings.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#ifdef SK_DEBUG
void GrPathRenderer::StencilPathArgs::validate() const {
@@ -32,7 +32,7 @@
GrPathRenderer::GrPathRenderer() {}
-GrPathRenderer::StencilSupport GrPathRenderer::getStencilSupport(const GrStyledShape& shape) const {
+GrPathRenderer::StencilSupport GrPathRenderer::getStencilSupport(const GrShape& shape) const {
SkDEBUGCODE(SkPath path;)
SkDEBUGCODE(shape.asPath(&path);)
SkASSERT(shape.style().isSimpleFill());
diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h
index 04bbcab..e29a42c 100644
--- a/src/gpu/GrPathRenderer.h
+++ b/src/gpu/GrPathRenderer.h
@@ -20,7 +20,7 @@
class GrRecordingContext;
class GrRenderTargetContext;
class GrRenderTargetProxy;
-class GrStyledShape;
+class GrShape;
class GrStyle;
struct GrUserStencilSettings;
struct SkIRect;
@@ -67,7 +67,7 @@
* @param shape the shape that will be drawn. Must be simple fill styled and non-inverse
* filled.
*/
- StencilSupport getStencilSupport(const GrStyledShape& shape) const;
+ StencilSupport getStencilSupport(const GrShape& shape) const;
enum class CanDrawPath {
kNo,
@@ -82,7 +82,7 @@
const GrRenderTargetProxy* fProxy;
const SkIRect* fClipConservativeBounds;
const SkMatrix* fViewMatrix;
- const GrStyledShape* fShape;
+ const GrShape* fShape;
GrAAType fAAType;
bool fTargetIsWrappedVkSecondaryCB;
@@ -118,7 +118,7 @@
const GrClip* fClip;
const SkIRect* fClipConservativeBounds;
const SkMatrix* fViewMatrix;
- const GrStyledShape* fShape;
+ const GrShape* fShape;
GrAAType fAAType;
bool fGammaCorrect;
#ifdef SK_DEBUG
@@ -150,7 +150,7 @@
const GrHardClip* fClip;
const SkIRect* fClipConservativeBounds;
const SkMatrix* fViewMatrix;
- const GrStyledShape* fShape;
+ const GrShape* fShape;
GrAA fDoStencilMSAA;
SkDEBUGCODE(void validate() const);
@@ -183,7 +183,7 @@
/**
* Subclass overrides if it has any limitations of stenciling support.
*/
- virtual StencilSupport onGetStencilSupport(const GrStyledShape&) const {
+ virtual StencilSupport onGetStencilSupport(const GrShape&) const {
return kNoRestriction_StencilSupport;
}
diff --git a/src/gpu/GrPathRendering_none.cpp b/src/gpu/GrPathRendering_none.cpp
index 048e8a3..0e12a36 100644
--- a/src/gpu/GrPathRendering_none.cpp
+++ b/src/gpu/GrPathRendering_none.cpp
@@ -53,4 +53,4 @@
const GrScissorState&,
sk_sp<const GrPath>) { return nullptr; }
-void GrPath::ComputeKey(const GrStyledShape&, GrUniqueKey*, bool*) {}
+void GrPath::ComputeKey(const GrShape&, GrUniqueKey*, bool*) {}
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index 696dbc2..008e2ba 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -24,7 +24,7 @@
#include "src/gpu/effects/GrConvexPolyEffect.h"
#include "src/gpu/effects/GrRRectEffect.h"
#include "src/gpu/effects/generated/GrAARectEffect.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
/**
* There are plenty of optimizations that could be added here. Maybe flips could be folded into
@@ -861,7 +861,7 @@
clipPath.toggleInverseFillType();
}
- GrStyledShape shape(clipPath, GrStyle::SimpleFill());
+ GrShape shape(clipPath, GrStyle::SimpleFill());
GrPathRenderer::CanDrawPathArgs canDrawArgs;
canDrawArgs.fCaps = context->priv().caps();
canDrawArgs.fProxy = renderTargetContext->asRenderTargetProxy();
@@ -906,7 +906,7 @@
GrAA(doStencilMSAA), element->getDeviceSpaceRect());
} else {
if (!clipPath.isEmpty()) {
- GrStyledShape shape(clipPath, GrStyle::SimpleFill());
+ GrShape shape(clipPath, GrStyle::SimpleFill());
if (canRenderDirectToStencil) {
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
@@ -945,7 +945,7 @@
stencil_device_rect(renderTargetContext, stencilClip, *pass,
GrAA(doStencilMSAA), element->getDeviceSpaceRect());
} else {
- GrStyledShape shape(clipPath, GrStyle::SimpleFill());
+ GrShape shape(clipPath, GrStyle::SimpleFill());
GrPaint paint;
paint.setXPFactory(GrDisableColorXPFactory::Get());
GrPathRenderer::DrawPathArgs args{context,
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index f291979..79563e6 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -52,7 +52,7 @@
#include "src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h"
#include "src/gpu/geometry/GrQuad.h"
#include "src/gpu/geometry/GrQuadUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrAtlasTextOp.h"
#include "src/gpu/ops/GrClearOp.h"
#include "src/gpu/ops/GrClearStencilClipOp.h"
@@ -86,7 +86,7 @@
}
void drawShape(const GrClip& clip, const SkPaint& paint,
- const SkMatrix& viewMatrix, const GrStyledShape& shape) override {
+ const SkMatrix& viewMatrix, const GrShape& shape) override {
GrBlurUtils::drawShapeWithMaskFilter(fRenderTargetContext->fContext, fRenderTargetContext,
clip, paint, viewMatrix, shape);
}
@@ -877,7 +877,7 @@
if ((!rect.width() || !rect.height()) &&
SkStrokeRec::kHairline_Style != stroke.getStyle()) {
SkScalar r = stroke.getWidth() / 2;
- // TODO: Move these stroke->fill fallbacks to GrStyledShape?
+ // TODO: Move these stroke->fill fallbacks to GrShape?
switch (stroke.getJoin()) {
case SkPaint::kMiter_Join:
this->drawRect(
@@ -919,8 +919,7 @@
}
}
assert_alive(paint);
- this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix,
- GrStyledShape(rect, *style));
+ this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, GrShape(rect, *style));
}
void GrRenderTargetContext::drawQuadSet(const GrClip& clip, GrPaint&& paint, GrAA aa,
@@ -1189,7 +1188,7 @@
assert_alive(paint);
this->drawShapeUsingPathRenderer(*clip, std::move(paint), aa, viewMatrix,
- GrStyledShape(rrect, style));
+ GrShape(rrect, style));
}
///////////////////////////////////////////////////////////////////////////////
@@ -1511,7 +1510,7 @@
path.addRRect(inner);
path.addRRect(outer);
path.setFillType(SkPathFillType::kEvenOdd);
- this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, GrStyledShape(path));
+ this->drawShapeUsingPathRenderer(clip, std::move(paint), aa, viewMatrix, GrShape(path));
}
///////////////////////////////////////////////////////////////////////////////
@@ -1610,7 +1609,7 @@
assert_alive(paint);
this->drawShapeUsingPathRenderer(
clip, std::move(paint), aa, viewMatrix,
- GrStyledShape(SkRRect::MakeOval(oval), SkPathDirection::kCW, 2, false, style));
+ GrShape(SkRRect::MakeOval(oval), SkPathDirection::kCW, 2, false, style));
}
void GrRenderTargetContext::drawArc(const GrClip& clip,
@@ -1649,7 +1648,7 @@
}
this->drawShapeUsingPathRenderer(
clip, std::move(paint), aa, viewMatrix,
- GrStyledShape::MakeArc(oval, startAngle, sweepAngle, useCenter, style));
+ GrShape::MakeArc(oval, startAngle, sweepAngle, useCenter, style));
}
void GrRenderTargetContext::drawImageLattice(const GrClip& clip,
@@ -2228,7 +2227,7 @@
SkDEBUGCODE(this->validate();)
GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "drawPath", fContext);
- GrStyledShape shape(path, style);
+ GrShape shape(path, style);
this->drawShape(clip, std::move(paint), aa, viewMatrix, shape);
}
@@ -2237,7 +2236,7 @@
GrPaint&& paint,
GrAA aa,
const SkMatrix& viewMatrix,
- const GrStyledShape& shape) {
+ const GrShape& shape) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
SkDEBUGCODE(this->validate();)
@@ -2324,7 +2323,7 @@
clip.getConservativeBounds(fRenderTargetContext->width(), fRenderTargetContext->height(),
&clipConservativeBounds, nullptr);
- GrStyledShape shape(path, GrStyle::SimpleFill());
+ GrShape shape(path, GrStyle::SimpleFill());
GrPathRenderer::CanDrawPathArgs canDrawArgs;
canDrawArgs.fCaps = fRenderTargetContext->caps();
canDrawArgs.fProxy = fRenderTargetContext->asRenderTargetProxy();
@@ -2376,7 +2375,7 @@
GrPaint&& paint,
GrAA aa,
const SkMatrix& viewMatrix,
- const GrStyledShape& originalShape) {
+ const GrShape& originalShape) {
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
GR_CREATE_TRACE_MARKER_CONTEXT("GrRenderTargetContext", "internalDrawPath", fContext);
@@ -2388,7 +2387,7 @@
SkIRect clipConservativeBounds;
clip.getConservativeBounds(this->width(), this->height(), &clipConservativeBounds, nullptr);
- GrStyledShape tempShape;
+ GrShape tempShape;
GrAAType aaType = this->chooseAAType(aa);
GrPathRenderer::CanDrawPathArgs canDrawArgs;
diff --git a/src/gpu/GrRenderTargetContext.h b/src/gpu/GrRenderTargetContext.h
index 44fed20..b3b3379 100644
--- a/src/gpu/GrRenderTargetContext.h
+++ b/src/gpu/GrRenderTargetContext.h
@@ -32,7 +32,7 @@
class GrOp;
class GrRenderTarget;
class GrRenderTargetContextPriv;
-class GrStyledShape;
+class GrShape;
class GrStyle;
class GrTextureProxy;
struct GrUserStencilSettings;
@@ -407,7 +407,7 @@
GrPaint&&,
GrAA,
const SkMatrix& viewMatrix,
- const GrStyledShape&);
+ const GrShape&);
/**
@@ -671,7 +671,7 @@
const SkRect* domain = nullptr);
void drawShapeUsingPathRenderer(const GrClip&, GrPaint&&, GrAA, const SkMatrix&,
- const GrStyledShape&);
+ const GrShape&);
void addOp(std::unique_ptr<GrOp>);
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 840396b..02dc626 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -14,7 +14,7 @@
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrSurfaceContext.h"
#include "src/gpu/GrTextureProxy.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
/*
* Convert a boolean operation into a transfer mode code
@@ -53,7 +53,7 @@
/**
* Draw a single path element of the clip stack into the accumulation bitmap
*/
-void GrSWMaskHelper::drawShape(const GrStyledShape& shape, const SkMatrix& matrix, SkRegion::Op op,
+void GrSWMaskHelper::drawShape(const GrShape& shape, const SkMatrix& matrix, SkRegion::Op op,
GrAA aa, uint8_t alpha) {
SkPaint paint;
paint.setPathEffect(shape.style().refPathEffect());
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index 1891198..8664f96 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -16,7 +16,7 @@
#include "src/core/SkDraw.h"
#include "src/core/SkRasterClip.h"
-class GrStyledShape;
+class GrShape;
class GrRecordingContext;
class GrTextureProxy;
@@ -49,8 +49,7 @@
void drawRect(const SkRect& rect, const SkMatrix& matrix, SkRegion::Op op, GrAA, uint8_t alpha);
// Draw a single path into the accumuation bitmap using the specified op
- void drawShape(const GrStyledShape&, const SkMatrix& matrix, SkRegion::Op op, GrAA,
- uint8_t alpha);
+ void drawShape(const GrShape&, const SkMatrix& matrix, SkRegion::Op op, GrAA, uint8_t alpha);
GrSurfaceProxyView toTextureView(GrRecordingContext*, SkBackingFit fit);
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index ed7227d..98c30bb 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -23,14 +23,14 @@
#include "src/gpu/GrSWMaskHelper.h"
#include "src/gpu/GrSurfaceContextPriv.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrDrawOp.h"
////////////////////////////////////////////////////////////////////////////////
GrPathRenderer::CanDrawPath
GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
// Pass on any style that applies. The caller will apply the style if a suitable renderer is
- // not found and try again with the new GrStyledShape.
+ // not found and try again with the new GrShape.
if (!args.fShape->style().applies() && SkToBool(fProxyProvider) &&
(args.fAAType == GrAAType::kCoverage || args.fAAType == GrAAType::kNone)) {
// This is the fallback renderer for when a path is too complicated for the GPU ones.
@@ -40,7 +40,7 @@
}
////////////////////////////////////////////////////////////////////////////////
-static bool get_unclipped_shape_dev_bounds(const GrStyledShape& shape, const SkMatrix& matrix,
+static bool get_unclipped_shape_dev_bounds(const GrShape& shape, const SkMatrix& matrix,
SkIRect* devBounds) {
SkRect shapeBounds = shape.styledBounds();
if (shapeBounds.isEmpty()) {
@@ -69,7 +69,7 @@
// is no intersection.
bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrRenderTargetContext* renderTargetContext,
const GrClip& clip,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& matrix,
SkIRect* unclippedDevShapeBounds,
SkIRect* clippedDevShapeBounds,
@@ -198,8 +198,8 @@
*/
class SoftwarePathData {
public:
- SoftwarePathData(const SkIRect& maskBounds, const SkMatrix& viewMatrix,
- const GrStyledShape& shape, GrAA aa)
+ SoftwarePathData(const SkIRect& maskBounds, const SkMatrix& viewMatrix, const GrShape& shape,
+ GrAA aa)
: fMaskBounds(maskBounds)
, fViewMatrix(viewMatrix)
, fShape(shape)
@@ -207,13 +207,13 @@
const SkIRect& getMaskBounds() const { return fMaskBounds; }
const SkMatrix* getViewMatrix() const { return &fViewMatrix; }
- const GrStyledShape& getShape() const { return fShape; }
+ const GrShape& getShape() const { return fShape; }
GrAA getAA() const { return fAA; }
private:
SkIRect fMaskBounds;
SkMatrix fViewMatrix;
- GrStyledShape fShape;
+ GrShape fShape;
GrAA fAA;
};
diff --git a/src/gpu/GrSoftwarePathRenderer.h b/src/gpu/GrSoftwarePathRenderer.h
index d24d48a..9337d22 100644
--- a/src/gpu/GrSoftwarePathRenderer.h
+++ b/src/gpu/GrSoftwarePathRenderer.h
@@ -28,7 +28,7 @@
static bool GetShapeAndClipBounds(GrRenderTargetContext*,
const GrClip& clip,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& matrix,
SkIRect* unclippedDevShapeBounds,
SkIRect* clippedDevShapeBounds,
@@ -62,7 +62,7 @@
const SkIPoint& textureOriginInDeviceSpace,
const SkIRect& deviceSpaceRectToDraw);
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;
}
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
index f369f64..1dce72d 100644
--- a/src/gpu/GrStyle.h
+++ b/src/gpu/GrStyle.h
@@ -14,11 +14,11 @@
#include "include/private/SkTemplates.h"
/**
- * Represents the various ways that a GrStyledShape can be styled. It has fill/stroking information
+ * Represents the various ways that a GrShape can be styled. It has fill/stroking information
* as well as an optional path effect. If the path effect represents dashing, the dashing
* information is extracted from the path effect and stored explicitly.
*
- * This will replace GrStrokeInfo as GrStyledShape is deployed.
+ * This will replace GrStrokeInfo as GrShape is deployed.
*/
class GrStyle {
public:
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 8f2be69..36a01c8 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -41,7 +41,7 @@
#include "src/gpu/GrTextureAdjuster.h"
#include "src/gpu/GrTracing.h"
#include "src/gpu/SkGr.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/text/GrTextTarget.h"
#include "src/image/SkImage_Base.h"
#include "src/image/SkReadPixelsRec.h"
@@ -360,7 +360,7 @@
// A couple reasons we might need to call drawPath.
if (paint.getMaskFilter() || paint.getPathEffect()) {
- GrStyledShape shape(rect, style);
+ GrShape shape(rect, style);
GrBlurUtils::drawShapeWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
this->clip(), paint, this->localToDevice(), shape);
@@ -421,7 +421,7 @@
if (mf || style.pathEffect()) {
// A path effect will presumably transform this rrect into something else.
- GrStyledShape shape(rrect, style);
+ GrShape shape(rrect, style);
GrBlurUtils::drawShapeWithMaskFilter(fContext.get(), fRenderTargetContext.get(),
this->clip(), paint, this->localToDevice(), shape);
@@ -474,8 +474,8 @@
path.setFillType(SkPathFillType::kEvenOdd);
// TODO: We are losing the possible mutability of the path here but this should probably be
- // fixed by upgrading GrStyledShape to handle DRRects.
- GrStyledShape shape(path, paint);
+ // fixed by upgrading GrShape to handle DRRects.
+ GrShape shape(path, paint);
GrBlurUtils::drawShapeWithMaskFilter(fContext.get(), fRenderTargetContext.get(), this->clip(),
paint, this->localToDevice(), shape);
@@ -627,7 +627,7 @@
}
// TODO: losing possible mutability of 'origSrcPath' here
- GrStyledShape shape(origSrcPath, paint);
+ GrShape shape(origSrcPath, paint);
GrBlurUtils::drawShapeWithMaskFilter(fContext.get(), fRenderTargetContext.get(), this->clip(),
paint, this->localToDevice(), shape);
@@ -1153,3 +1153,4 @@
GrStyle::SimpleFill(), &kDrawToStencil);
return true;
}
+
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index 3bad63d..0b880e3 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -23,7 +23,7 @@
#include "src/gpu/effects/GrBicubicEffect.h"
#include "src/gpu/effects/GrTextureDomain.h"
#include "src/gpu/effects/GrTextureEffect.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/image/SkImage_Base.h"
namespace {
@@ -485,17 +485,17 @@
canUseTextureCoordsAsLocalCoords ? &src : nullptr);
}
} else {
- // Must draw the mask filter as a GrStyledShape. For now, this loses the per-edge AA
- // information since it always draws with AA, but that should not be noticeable since the
- // mask filter is probably a blur.
- GrStyledShape shape;
+ // Must draw the mask filter as a GrShape. For now, this loses the per-edge AA information
+ // since it always draws with AA, but that is should not be noticeable since the mask filter
+ // is probably a blur.
+ GrShape shape;
if (dstClip) {
// Represent it as an SkPath formed from the dstClip
SkPath path;
path.addPoly(dstClip, 4, true);
- shape = GrStyledShape(path);
+ shape = GrShape(path);
} else {
- shape = GrStyledShape(dst);
+ shape = GrShape(dst);
}
GrBlurUtils::drawShapeWithMaskFilter(
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index 3b27f15..b8a73e8 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -27,7 +27,7 @@
std::unique_ptr<GrCCDrawPathsOp> GrCCDrawPathsOp::Make(
GrRecordingContext* context, const SkIRect& clipIBounds, const SkMatrix& m,
- const GrStyledShape& shape, GrPaint&& paint) {
+ const GrShape& shape, GrPaint&& paint) {
SkRect conservativeDevBounds;
m.mapRect(&conservativeDevBounds, shape.bounds());
@@ -49,10 +49,10 @@
croppedDevPath.transform(m, &croppedDevPath);
SkIRect cropBox = clipIBounds;
- GrStyledShape croppedDevShape;
+ GrShape croppedDevShape;
if (stroke.isFillStyle()) {
GrCoverageCountingPathRenderer::CropPath(croppedDevPath, cropBox, &croppedDevPath);
- croppedDevShape = GrStyledShape(croppedDevPath);
+ croppedDevShape = GrShape(croppedDevPath);
conservativeDevBounds = croppedDevShape.bounds();
} else {
int r = SkScalarCeilToInt(conservativeInflationRadius);
@@ -60,7 +60,7 @@
GrCoverageCountingPathRenderer::CropPath(croppedDevPath, cropBox, &croppedDevPath);
SkStrokeRec devStroke = stroke;
devStroke.setStrokeStyle(strokeDevWidth);
- croppedDevShape = GrStyledShape(croppedDevPath, GrStyle(devStroke, nullptr));
+ croppedDevShape = GrShape(croppedDevPath, GrStyle(devStroke, nullptr));
conservativeDevBounds = croppedDevPath.getBounds();
conservativeDevBounds.outset(conservativeInflationRadius, conservativeInflationRadius);
}
@@ -76,7 +76,7 @@
std::unique_ptr<GrCCDrawPathsOp> GrCCDrawPathsOp::InternalMake(
GrRecordingContext* context, const SkIRect& clipIBounds, const SkMatrix& m,
- const GrStyledShape& shape, float strokeDevWidth, const SkRect& conservativeDevBounds,
+ const GrShape& shape, float strokeDevWidth, const SkRect& conservativeDevBounds,
GrPaint&& paint) {
// The path itself should have been cropped if larger than kPathCropThreshold. If it had a
// stroke, that would have further inflated its draw bounds.
@@ -97,8 +97,8 @@
maskDevIBounds, conservativeDevBounds, std::move(paint));
}
-GrCCDrawPathsOp::GrCCDrawPathsOp(const SkMatrix& m, const GrStyledShape& shape,
- float strokeDevWidth, const SkIRect& shapeConservativeIBounds,
+GrCCDrawPathsOp::GrCCDrawPathsOp(const SkMatrix& m, const GrShape& shape, float strokeDevWidth,
+ const SkIRect& shapeConservativeIBounds,
const SkIRect& maskDevIBounds, const SkRect& conservativeDevBounds,
GrPaint&& paint)
: GrDrawOp(ClassID())
@@ -127,7 +127,7 @@
}
}
-GrCCDrawPathsOp::SingleDraw::SingleDraw(const SkMatrix& m, const GrStyledShape& shape,
+GrCCDrawPathsOp::SingleDraw::SingleDraw(const SkMatrix& m, const GrShape& shape,
float strokeDevWidth,
const SkIRect& shapeConservativeIBounds,
const SkIRect& maskDevIBounds, const SkPMColor4f& color)
@@ -182,7 +182,7 @@
// How transparent does a 1px stroke have to be in order to appear as thin as the real one?
float coverage = fStrokeDevWidth;
- fShape = GrStyledShape(path, GrStyle(hairlineStroke, nullptr));
+ fShape = GrShape(path, GrStyle(hairlineStroke, nullptr));
fStrokeDevWidth = 1;
// fShapeConservativeIBounds already accounted for this possibility of inflating the stroke.
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.h b/src/gpu/ccpr/GrCCDrawPathsOp.h
index 92c37ed..bc22738 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.h
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.h
@@ -11,7 +11,7 @@
#include "src/core/SkTInternalLList.h"
#include "src/gpu/ccpr/GrCCPathCache.h"
#include "src/gpu/ccpr/GrCCSTLList.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrDrawOp.h"
class GrCCAtlas;
@@ -30,7 +30,7 @@
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrCCDrawPathsOp);
static std::unique_ptr<GrCCDrawPathsOp> Make(GrRecordingContext*, const SkIRect& clipIBounds,
- const SkMatrix&, const GrStyledShape&, GrPaint&&);
+ const SkMatrix&, const GrShape&, GrPaint&&);
~GrCCDrawPathsOp() override;
const char* name() const override { return "GrCCDrawPathsOp"; }
@@ -80,12 +80,12 @@
static std::unique_ptr<GrCCDrawPathsOp> InternalMake(GrRecordingContext*,
const SkIRect& clipIBounds,
- const SkMatrix&, const GrStyledShape&,
+ const SkMatrix&, const GrShape&,
float strokeDevWidth,
const SkRect& conservativeDevBounds,
GrPaint&&);
- GrCCDrawPathsOp(const SkMatrix&, const GrStyledShape&, float strokeDevWidth,
+ GrCCDrawPathsOp(const SkMatrix&, const GrShape&, float strokeDevWidth,
const SkIRect& shapeConservativeIBounds, const SkIRect& maskDevIBounds,
const SkRect& conservativeDevBounds, GrPaint&&);
@@ -96,7 +96,7 @@
class SingleDraw {
public:
- SingleDraw(const SkMatrix&, const GrStyledShape&, float strokeDevWidth,
+ SingleDraw(const SkMatrix&, const GrShape&, float strokeDevWidth,
const SkIRect& shapeConservativeIBounds, const SkIRect& maskDevIBounds,
const SkPMColor4f&);
@@ -113,7 +113,7 @@
bool shouldCachePathMask(int maxRenderTargetSize) const;
SkMatrix fMatrix;
- GrStyledShape fShape;
+ GrShape fShape;
float fStrokeDevWidth;
const SkIRect fShapeConservativeIBounds;
SkIRect fMaskDevIBounds;
diff --git a/src/gpu/ccpr/GrCCPathCache.cpp b/src/gpu/ccpr/GrCCPathCache.cpp
index b1037bb..4f29c90 100644
--- a/src/gpu/ccpr/GrCCPathCache.cpp
+++ b/src/gpu/ccpr/GrCCPathCache.cpp
@@ -126,13 +126,13 @@
static constexpr int kStrokeCapJoinIdx = 2;
static constexpr int kShapeUnstyledKeyIdx = 3;
- WriteKeyHelper(const GrStyledShape& shape) : fShapeUnstyledKeyCount(shape.unstyledKeySize()) {}
+ WriteKeyHelper(const GrShape& shape) : fShapeUnstyledKeyCount(shape.unstyledKeySize()) {}
// Returns the total number of uint32_t's to allocate for the key.
int allocCountU32() const { return kShapeUnstyledKeyIdx + fShapeUnstyledKeyCount; }
// Writes the key data to out[].
- void write(const GrStyledShape& shape, uint32_t* out) {
+ void write(const GrShape& shape, uint32_t* out) {
// Stroke key.
// We don't use GrStyle::WriteKey() because it does not account for hairlines.
// http://skbug.com/8273
@@ -161,7 +161,7 @@
}
GrCCPathCache::OnFlushEntryRef GrCCPathCache::find(
- GrOnFlushResourceProvider* onFlushRP, const GrStyledShape& shape,
+ GrOnFlushResourceProvider* onFlushRP, const GrShape& shape,
const SkIRect& clippedDrawBounds, const SkMatrix& viewMatrix, SkIVector* maskShift) {
if (!shape.hasUnstyledKey()) {
return OnFlushEntryRef();
diff --git a/src/gpu/ccpr/GrCCPathCache.h b/src/gpu/ccpr/GrCCPathCache.h
index 2009aaf..05d31ea 100644
--- a/src/gpu/ccpr/GrCCPathCache.h
+++ b/src/gpu/ccpr/GrCCPathCache.h
@@ -14,15 +14,15 @@
#include "src/core/SkTInternalLList.h"
#include "src/gpu/ccpr/GrCCAtlas.h"
#include "src/gpu/ccpr/GrCCPathProcessor.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
class GrCCPathCacheEntry;
-class GrStyledShape;
+class GrShape;
/**
- * This class implements an LRU cache that maps from GrStyledShape to GrCCPathCacheEntry objects.
- * Shapes are only given one entry in the cache, so any time they are accessed with a different
- * matrix, the old entry gets evicted.
+ * This class implements an LRU cache that maps from GrShape to GrCCPathCacheEntry objects. Shapes
+ * are only given one entry in the cache, so any time they are accessed with a different matrix, the
+ * old entry gets evicted.
*/
class GrCCPathCache {
public:
@@ -67,8 +67,8 @@
const uint32_t fPathCacheUniqueID;
int fDataSizeInBytes;
SkDEBUGCODE(const int fDataReserveCountU32);
- // The GrStyledShape's unstyled key is stored as a variable-length footer to this class.
- // GetKey provides access to it.
+ // The GrShape's unstyled key is stored as a variable-length footer to this class. GetKey
+ // provides access to it.
};
// Stores the components of a transformation that affect a path mask (i.e. everything but
@@ -109,7 +109,7 @@
//
// NOTE: Shapes are only given one entry, so any time they are accessed with a new
// transformation, the old entry gets evicted.
- OnFlushEntryRef find(GrOnFlushResourceProvider*, const GrStyledShape&,
+ OnFlushEntryRef find(GrOnFlushResourceProvider*, const GrShape&,
const SkIRect& clippedDrawBounds, const SkMatrix& viewMatrix,
SkIVector* maskShift);
@@ -137,7 +137,7 @@
}
HashNode() = default;
- HashNode(GrCCPathCache*, sk_sp<Key>, const MaskTransform&, const GrStyledShape&);
+ HashNode(GrCCPathCache*, sk_sp<Key>, const MaskTransform&, const GrShape&);
HashNode(HashNode&& node)
: fPathCache(node.fPathCache), fEntry(std::move(node.fEntry)) {
SkASSERT(!node.fEntry);
@@ -341,7 +341,7 @@
inline GrCCPathCache::HashNode::HashNode(GrCCPathCache* pathCache, sk_sp<Key> key,
- const MaskTransform& m, const GrStyledShape& shape)
+ const MaskTransform& m, const GrShape& shape)
: fPathCache(pathCache)
, fEntry(new GrCCPathCacheEntry(key, m)) {
SkASSERT(shape.hasUnstyledKey());
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp
index 3a3d88b..af790c1 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.cpp
+++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp
@@ -18,7 +18,7 @@
#include "src/gpu/ccpr/GrGSCoverageProcessor.h"
#include "src/gpu/ccpr/GrSampleMaskProcessor.h"
#include "src/gpu/ccpr/GrVSCoverageProcessor.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include <algorithm>
using CoverageType = GrCCAtlas::CoverageType;
@@ -363,9 +363,8 @@
}
GrCCAtlas* GrCCPerFlushResources::renderShapeInAtlas(
- const SkIRect& clipIBounds, const SkMatrix& m, const GrStyledShape& shape,
- float strokeDevWidth, GrOctoBounds* octoBounds, SkIRect* devIBounds,
- SkIVector* devToAtlasOffset) {
+ const SkIRect& clipIBounds, const SkMatrix& m, const GrShape& shape, float strokeDevWidth,
+ GrOctoBounds* octoBounds, SkIRect* devIBounds, SkIVector* devToAtlasOffset) {
SkASSERT(this->isMapped());
SkASSERT(fNextPathInstanceIdx < fEndPathInstance);
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.h b/src/gpu/ccpr/GrCCPerFlushResources.h
index 770b59d..c094a9f 100644
--- a/src/gpu/ccpr/GrCCPerFlushResources.h
+++ b/src/gpu/ccpr/GrCCPerFlushResources.h
@@ -20,7 +20,7 @@
class GrCCPathCacheEntry;
class GrOctoBounds;
class GrOnFlushResourceProvider;
-class GrStyledShape;
+class GrShape;
/**
* This struct counts values that help us preallocate buffers for rendered path geometry.
@@ -88,7 +88,7 @@
// strokeDevWidth must be 0 for fills, 1 for hairlines, or the stroke width in device-space
// pixels for non-hairline strokes (implicitly requiring a rigid-body transform).
GrCCAtlas* renderShapeInAtlas(
- const SkIRect& clipIBounds, const SkMatrix&, const GrStyledShape&, float strokeDevWidth,
+ const SkIRect& clipIBounds, const SkMatrix&, const GrShape&, float strokeDevWidth,
GrOctoBounds*, SkIRect* devIBounds, SkIVector* devToAtlasOffset);
const GrCCAtlas* renderDeviceSpacePathInAtlas(
const SkIRect& clipIBounds, const SkPath& devPath, const SkIRect& devPathIBounds,
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
index 320b743..242b992 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp
@@ -80,7 +80,7 @@
GrPathRenderer::CanDrawPath GrCoverageCountingPathRenderer::onCanDrawPath(
const CanDrawPathArgs& args) const {
- const GrStyledShape& shape = *args.fShape;
+ const GrShape& shape = *args.fShape;
// We use "kCoverage", or analytic AA, no mater what the coverage type of our atlas: Even if the
// atlas is multisampled, that resolves into analytic coverage before we draw the path to the
// main canvas.
diff --git a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
index a310705..1b86ad0 100644
--- a/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
+++ b/src/gpu/ccpr/GrCoverageCountingPathRenderer.h
@@ -90,7 +90,7 @@
GrCoverageCountingPathRenderer(CoverageType, AllowCaching, uint32_t contextUniqueID);
// GrPathRenderer overrides.
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;
}
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
diff --git a/src/gpu/geometry/GrStyledShape.cpp b/src/gpu/geometry/GrShape.cpp
similarity index 93%
rename from src/gpu/geometry/GrStyledShape.cpp
rename to src/gpu/geometry/GrShape.cpp
index d81b99e..b340c7d 100644
--- a/src/gpu/geometry/GrStyledShape.cpp
+++ b/src/gpu/geometry/GrShape.cpp
@@ -5,13 +5,13 @@
* found in the LICENSE file.
*/
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "include/private/SkIDChangeListener.h"
#include <utility>
-GrStyledShape& GrStyledShape::operator=(const GrStyledShape& that) {
+GrShape& GrShape::operator=(const GrShape& that) {
fStyle = that.fStyle;
this->changeType(that.fType, Type::kPath == that.fType ? &that.path() : nullptr);
switch (fType) {
@@ -43,41 +43,41 @@
return *this;
}
-static bool flip_inversion(bool originalIsInverted, GrStyledShape::FillInversion inversion) {
+static bool flip_inversion(bool originalIsInverted, GrShape::FillInversion inversion) {
switch (inversion) {
- case GrStyledShape::FillInversion::kPreserve:
+ case GrShape::FillInversion::kPreserve:
return false;
- case GrStyledShape::FillInversion::kFlip:
+ case GrShape::FillInversion::kFlip:
return true;
- case GrStyledShape::FillInversion::kForceInverted:
+ case GrShape::FillInversion::kForceInverted:
return !originalIsInverted;
- case GrStyledShape::FillInversion::kForceNoninverted:
+ case GrShape::FillInversion::kForceNoninverted:
return originalIsInverted;
}
return false;
}
-static bool is_inverted(bool originalIsInverted, GrStyledShape::FillInversion inversion) {
+static bool is_inverted(bool originalIsInverted, GrShape::FillInversion inversion) {
switch (inversion) {
- case GrStyledShape::FillInversion::kPreserve:
+ case GrShape::FillInversion::kPreserve:
return originalIsInverted;
- case GrStyledShape::FillInversion::kFlip:
+ case GrShape::FillInversion::kFlip:
return !originalIsInverted;
- case GrStyledShape::FillInversion::kForceInverted:
+ case GrShape::FillInversion::kForceInverted:
return true;
- case GrStyledShape::FillInversion::kForceNoninverted:
+ case GrShape::FillInversion::kForceNoninverted:
return false;
}
return false;
}
-GrStyledShape GrStyledShape::MakeFilled(const GrStyledShape& original, FillInversion inversion) {
+GrShape GrShape::MakeFilled(const GrShape& original, FillInversion inversion) {
if (original.style().isSimpleFill() && !flip_inversion(original.inverseFilled(), inversion)) {
// By returning the original rather than falling through we can preserve any inherited style
// key. Otherwise, we wipe it out below since the style change invalidates it.
return original;
}
- GrStyledShape result;
+ GrShape result;
if (original.fInheritedPathForListeners.isValid()) {
result.fInheritedPathForListeners.set(*original.fInheritedPathForListeners.get());
}
@@ -130,7 +130,7 @@
return result;
}
-SkRect GrStyledShape::bounds() const {
+SkRect GrShape::bounds() const {
// Bounds where left == bottom or top == right can indicate a line or point shape. We return
// inverted bounds for a truly empty shape.
static constexpr SkRect kInverted = SkRect::MakeLTRB(1, 1, -1, -1);
@@ -168,7 +168,7 @@
SK_ABORT("Unknown shape type");
}
-SkRect GrStyledShape::styledBounds() const {
+SkRect GrShape::styledBounds() const {
if (this->isEmpty() && !fStyle.hasNonDashPathEffect()) {
return SkRect::MakeEmpty();
}
@@ -181,7 +181,7 @@
// If the path is small enough to be keyed from its data this returns key length, otherwise -1.
static int path_key_from_data_size(const SkPath& path) {
const int verbCnt = path.countVerbs();
- if (verbCnt > GrStyledShape::kMaxKeyFromDataVerbCnt) {
+ if (verbCnt > GrShape::kMaxKeyFromDataVerbCnt) {
return -1;
}
const int pointCnt = path.countPoints();
@@ -201,7 +201,7 @@
const int verbCnt = path.countVerbs();
const int pointCnt = path.countPoints();
const int conicWeightCnt = SkPathPriv::ConicWeightCnt(path);
- SkASSERT(verbCnt <= GrStyledShape::kMaxKeyFromDataVerbCnt);
+ SkASSERT(verbCnt <= GrShape::kMaxKeyFromDataVerbCnt);
SkASSERT(pointCnt && verbCnt);
*key++ = (uint32_t)path.getFillType();
*key++ = verbCnt;
@@ -221,7 +221,7 @@
SkASSERT(key - origKey == path_key_from_data_size(path));
}
-int GrStyledShape::unstyledKeySize() const {
+int GrShape::unstyledKeySize() const {
if (fInheritedKey.count()) {
return fInheritedKey.count();
}
@@ -258,7 +258,7 @@
SK_ABORT("Should never get here.");
}
-void GrStyledShape::writeUnstyledKey(uint32_t* key) const {
+void GrShape::writeUnstyledKey(uint32_t* key) const {
SkASSERT(this->unstyledKeySize());
SkDEBUGCODE(uint32_t* origKey = key;)
if (fInheritedKey.count()) {
@@ -307,8 +307,7 @@
SkASSERT(key - origKey == this->unstyledKeySize());
}
-void GrStyledShape::setInheritedKey(const GrStyledShape &parent, GrStyle::Apply apply,
- SkScalar scale) {
+void GrShape::setInheritedKey(const GrShape &parent, GrStyle::Apply apply, SkScalar scale) {
SkASSERT(!fInheritedKey.count());
// If the output shape turns out to be simple, then we will just use its geometric key
if (Type::kPath == fType) {
@@ -357,7 +356,7 @@
}
}
-const SkPath* GrStyledShape::originalPathForListeners() const {
+const SkPath* GrShape::originalPathForListeners() const {
if (fInheritedPathForListeners.isValid()) {
return fInheritedPathForListeners.get();
} else if (Type::kPath == fType && !fPathData.fPath.isVolatile()) {
@@ -366,16 +365,15 @@
return nullptr;
}
-void GrStyledShape::addGenIDChangeListener(sk_sp<SkIDChangeListener> listener) const {
+void GrShape::addGenIDChangeListener(sk_sp<SkIDChangeListener> listener) const {
if (const auto* lp = this->originalPathForListeners()) {
SkPathPriv::AddGenIDChangeListener(*lp, std::move(listener));
}
}
-GrStyledShape GrStyledShape::MakeArc(const SkRect& oval, SkScalar startAngleDegrees,
- SkScalar sweepAngleDegrees, bool useCenter,
- const GrStyle& style) {
- GrStyledShape result;
+GrShape GrShape::MakeArc(const SkRect& oval, SkScalar startAngleDegrees, SkScalar sweepAngleDegrees,
+ bool useCenter, const GrStyle& style) {
+ GrShape result;
result.changeType(Type::kArc);
result.fArcData.fOval = oval;
result.fArcData.fStartAngleDegrees = startAngleDegrees;
@@ -387,7 +385,7 @@
return result;
}
-GrStyledShape::GrStyledShape(const GrStyledShape& that) : fStyle(that.fStyle) {
+GrShape::GrShape(const GrShape& that) : fStyle(that.fStyle) {
const SkPath* thatPath = Type::kPath == that.fType ? &that.fPathData.fPath : nullptr;
this->initType(that.fType, thatPath);
switch (fType) {
@@ -416,7 +414,7 @@
}
}
-GrStyledShape::GrStyledShape(const GrStyledShape& parent, GrStyle::Apply apply, SkScalar scale) {
+GrShape::GrShape(const GrShape& parent, GrStyle::Apply apply, SkScalar scale) {
// TODO: Add some quantization of scale for better cache performance here or leave that up
// to caller?
// TODO: For certain shapes and stroke params we could ignore the scale. (e.g. miter or bevel
@@ -430,8 +428,8 @@
SkPathEffect* pe = parent.fStyle.pathEffect();
SkTLazy<SkPath> tmpPath;
- const GrStyledShape* parentForKey = &parent;
- SkTLazy<GrStyledShape> tmpParent;
+ const GrShape* parentForKey = &parent;
+ SkTLazy<GrShape> tmpParent;
this->initType(Type::kPath);
fPathData.fGenID = 0;
if (pe) {
@@ -508,7 +506,7 @@
this->setInheritedKey(*parentForKey, apply, scale);
}
-void GrStyledShape::attemptToSimplifyPath() {
+void GrShape::attemptToSimplifyPath() {
SkRect rect;
SkRRect rrect;
SkPathDirection rrectDir;
@@ -603,7 +601,7 @@
}
}
-void GrStyledShape::attemptToSimplifyRRect() {
+void GrShape::attemptToSimplifyRRect() {
SkASSERT(Type::kRRect == fType);
SkASSERT(!fInheritedKey.count());
if (fRRectData.fRRect.isEmpty()) {
@@ -643,7 +641,7 @@
}
}
-void GrStyledShape::attemptToSimplifyLine() {
+void GrShape::attemptToSimplifyLine() {
SkASSERT(Type::kLine == fType);
SkASSERT(!fInheritedKey.count());
if (fStyle.isDashed()) {
@@ -683,7 +681,7 @@
}
}
-void GrStyledShape::attemptToSimplifyArc() {
+void GrShape::attemptToSimplifyArc() {
SkASSERT(fType == Type::kArc);
SkASSERT(!fArcData.fInverted);
if (fArcData.fOval.isEmpty() || !fArcData.fSweepAngleDegrees) {
@@ -723,7 +721,7 @@
// could as well if the stroke fills the center.
}
-bool GrStyledShape::attemptToSimplifyStrokedLineToRRect() {
+bool GrShape::attemptToSimplifyStrokedLineToRRect() {
SkASSERT(Type::kLine == fType);
SkASSERT(fStyle.strokeRec().getStyle() == SkStrokeRec::kStroke_Style);
diff --git a/src/gpu/geometry/GrStyledShape.h b/src/gpu/geometry/GrShape.h
similarity index 91%
rename from src/gpu/geometry/GrStyledShape.h
rename to src/gpu/geometry/GrShape.h
index 0fc7d1c..a510984 100644
--- a/src/gpu/geometry/GrStyledShape.h
+++ b/src/gpu/geometry/GrShape.h
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-#ifndef GrStyledShape_DEFINED
-#define GrStyledShape_DEFINED
+#ifndef GrShape_DEFINED
+#define GrShape_DEFINED
#include "include/core/SkPath.h"
#include "include/core/SkRRect.h"
@@ -20,9 +20,9 @@
/**
* Represents a geometric shape (rrect or path) and the GrStyle that it should be rendered with.
- * It is possible to apply the style to the GrStyledShape to produce a new GrStyledShape where the
- * geometry reflects the styling information (e.g. is stroked). It is also possible to apply just
- * the path effect from the style. In this case the resulting shape will include any remaining
+ * It is possible to apply the style to the GrShape to produce a new GrShape where the geometry
+ * reflects the styling information (e.g. is stroked). It is also possible to apply just the
+ * path effect from the style. In this case the resulting shape will include any remaining
* stroking information that is to be applied after the path effect.
*
* Shapes can produce keys that represent only the geometry information, not the style. Note that
@@ -35,26 +35,26 @@
* applying style to the geometry. The idea is to expand this to cover most or all of the geometries
* that have fast paths in the GPU backend.
*/
-class GrStyledShape {
+class GrShape {
public:
// Keys for paths may be extracted from the path data for small paths. Clients aren't supposed
// to have to worry about this. This value is exposed for unit tests.
static constexpr int kMaxKeyFromDataVerbCnt = 10;
- GrStyledShape() { this->initType(Type::kEmpty); }
+ GrShape() { this->initType(Type::kEmpty); }
- explicit GrStyledShape(const SkPath& path) : GrStyledShape(path, GrStyle::SimpleFill()) {}
+ explicit GrShape(const SkPath& path) : GrShape(path, GrStyle::SimpleFill()) {}
- explicit GrStyledShape(const SkRRect& rrect) : GrStyledShape(rrect, GrStyle::SimpleFill()) {}
+ explicit GrShape(const SkRRect& rrect) : GrShape(rrect, GrStyle::SimpleFill()) {}
- explicit GrStyledShape(const SkRect& rect) : GrStyledShape(rect, GrStyle::SimpleFill()) {}
+ explicit GrShape(const SkRect& rect) : GrShape(rect, GrStyle::SimpleFill()) {}
- GrStyledShape(const SkPath& path, const GrStyle& style) : fStyle(style) {
+ GrShape(const SkPath& path, const GrStyle& style) : fStyle(style) {
this->initType(Type::kPath, &path);
this->attemptToSimplifyPath();
}
- GrStyledShape(const SkRRect& rrect, const GrStyle& style) : fStyle(style) {
+ GrShape(const SkRRect& rrect, const GrStyle& style) : fStyle(style) {
this->initType(Type::kRRect);
fRRectData.fRRect = rrect;
fRRectData.fInverted = false;
@@ -63,7 +63,7 @@
this->attemptToSimplifyRRect();
}
- GrStyledShape(const SkRRect& rrect, SkPathDirection dir, unsigned start, bool inverted,
+ GrShape(const SkRRect& rrect, SkPathDirection dir, unsigned start, bool inverted,
const GrStyle& style)
: fStyle(style) {
this->initType(Type::kRRect);
@@ -83,7 +83,7 @@
this->attemptToSimplifyRRect();
}
- GrStyledShape(const SkRect& rect, const GrStyle& style) : fStyle(style) {
+ GrShape(const SkRect& rect, const GrStyle& style) : fStyle(style) {
this->initType(Type::kRRect);
fRRectData.fRRect = SkRRect::MakeRect(rect);
fRRectData.fInverted = false;
@@ -92,12 +92,12 @@
this->attemptToSimplifyRRect();
}
- GrStyledShape(const SkPath& path, const SkPaint& paint) : fStyle(paint) {
+ GrShape(const SkPath& path, const SkPaint& paint) : fStyle(paint) {
this->initType(Type::kPath, &path);
this->attemptToSimplifyPath();
}
- GrStyledShape(const SkRRect& rrect, const SkPaint& paint) : fStyle(paint) {
+ GrShape(const SkRRect& rrect, const SkPaint& paint) : fStyle(paint) {
this->initType(Type::kRRect);
fRRectData.fRRect = rrect;
fRRectData.fInverted = false;
@@ -106,7 +106,7 @@
this->attemptToSimplifyRRect();
}
- GrStyledShape(const SkRect& rect, const SkPaint& paint) : fStyle(paint) {
+ GrShape(const SkRect& rect, const SkPaint& paint) : fStyle(paint) {
this->initType(Type::kRRect);
fRRectData.fRRect = SkRRect::MakeRect(rect);
fRRectData.fInverted = false;
@@ -115,13 +115,13 @@
this->attemptToSimplifyRRect();
}
- static GrStyledShape MakeArc(const SkRect& oval, SkScalar startAngleDegrees,
+ static GrShape MakeArc(const SkRect& oval, SkScalar startAngleDegrees,
SkScalar sweepAngleDegrees, bool useCenter, const GrStyle& style);
- GrStyledShape(const GrStyledShape&);
- GrStyledShape& operator=(const GrStyledShape& that);
+ GrShape(const GrShape&);
+ GrShape& operator=(const GrShape& that);
- ~GrStyledShape() { this->changeType(Type::kEmpty); }
+ ~GrShape() { this->changeType(Type::kEmpty); }
/**
* Informs MakeFilled on how to modify that shape's fill rule when making a simple filled
@@ -140,8 +140,7 @@
* (e.g. filled paths are always closed when stored in a shape and dashed paths are always
* made non-inverted since dashing ignores inverseness).
*/
- static GrStyledShape MakeFilled(const GrStyledShape& original,
- FillInversion = FillInversion::kPreserve);
+ static GrShape MakeFilled(const GrShape& original, FillInversion = FillInversion::kPreserve);
const GrStyle& style() const { return fStyle; }
@@ -150,8 +149,8 @@
* information from this shape's style to its geometry. Scale is used when approximating the
* output geometry and typically is computed from the view matrix
*/
- GrStyledShape applyStyle(GrStyle::Apply apply, SkScalar scale) const {
- return GrStyledShape(*this, apply, scale);
+ GrShape applyStyle(GrStyle::Apply apply, SkScalar scale) const {
+ return GrShape(*this, apply, scale);
}
bool isRect() const {
@@ -458,8 +457,8 @@
}
/**
- * Gets the size of the key for the shape represented by this GrStyledShape (ignoring its
- * styling). A negative value is returned if the shape has no key (shouldn't be cached).
+ * Gets the size of the key for the shape represented by this GrShape (ignoring its styling).
+ * A negative value is returned if the shape has no key (shouldn't be cached).
*/
int unstyledKeySize() const;
@@ -534,13 +533,13 @@
}
/** Constructor used by the applyStyle() function */
- GrStyledShape(const GrStyledShape& parentShape, GrStyle::Apply, SkScalar scale);
+ GrShape(const GrShape& parentShape, GrStyle::Apply, SkScalar scale);
/**
* Determines the key we should inherit from the input shape's geometry and style when
* we are applying the style to create a new shape.
*/
- void setInheritedKey(const GrStyledShape& parentShape, GrStyle::Apply, SkScalar scale);
+ void setInheritedKey(const GrShape& parentShape, GrStyle::Apply, SkScalar scale);
void attemptToSimplifyPath();
void attemptToSimplifyRRect();
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 0aff891..24920e4 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -19,7 +19,7 @@
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/geometry/GrPathUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/glsl/GrGLSLProgramDataManager.h"
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index db6a9ee..fd14dc1 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -25,7 +25,7 @@
#include "src/gpu/GrStyle.h"
#include "src/gpu/effects/GrBezierEffect.h"
#include "src/gpu/geometry/GrPathUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrAAHairLinePathRenderer.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index d6d6449..64eedbe 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -21,7 +21,7 @@
#include "src/gpu/GrStyle.h"
#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/geometry/GrPathUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
#include "src/gpu/ops/GrAAConvexTessellator.h"
#include "src/gpu/ops/GrAALinearizingConvexPathRenderer.h"
diff --git a/src/gpu/ops/GrDashLinePathRenderer.cpp b/src/gpu/ops/GrDashLinePathRenderer.cpp
index 96fc06c..f15309c 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.cpp
+++ b/src/gpu/ops/GrDashLinePathRenderer.cpp
@@ -8,7 +8,7 @@
#include "src/gpu/GrAuditTrail.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrRenderTargetContext.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrDashLinePathRenderer.h"
#include "src/gpu/ops/GrDashOp.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
diff --git a/src/gpu/ops/GrDashLinePathRenderer.h b/src/gpu/ops/GrDashLinePathRenderer.h
index 029f1ab..267eaf8 100644
--- a/src/gpu/ops/GrDashLinePathRenderer.h
+++ b/src/gpu/ops/GrDashLinePathRenderer.h
@@ -18,7 +18,7 @@
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return kNoSupport_StencilSupport;
}
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index 7f4f634..332560c 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -24,7 +24,7 @@
#include "src/gpu/GrStyle.h"
#include "src/gpu/GrSurfaceContextPriv.h"
#include "src/gpu/geometry/GrPathUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
@@ -36,7 +36,7 @@
#define STENCIL_OFF 0 // Always disable stencil (even when needed)
-static inline bool single_pass_shape(const GrStyledShape& shape) {
+static inline bool single_pass_shape(const GrShape& shape) {
#if STENCIL_OFF
return true;
#else
@@ -55,7 +55,7 @@
}
GrPathRenderer::StencilSupport
-GrDefaultPathRenderer::onGetStencilSupport(const GrStyledShape& shape) const {
+GrDefaultPathRenderer::onGetStencilSupport(const GrShape& shape) const {
if (single_pass_shape(shape)) {
return GrPathRenderer::kNoRestriction_StencilSupport;
} else {
@@ -539,7 +539,7 @@
const GrUserStencilSettings& userStencilSettings,
const GrClip& clip,
const SkMatrix& viewMatrix,
- const GrStyledShape& shape,
+ const GrShape& shape,
bool stencilOnly) {
auto context = renderTargetContext->surfPriv().getContext();
diff --git a/src/gpu/ops/GrDefaultPathRenderer.h b/src/gpu/ops/GrDefaultPathRenderer.h
index e709964..a42061c 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.h
+++ b/src/gpu/ops/GrDefaultPathRenderer.h
@@ -23,7 +23,7 @@
const char* name() const final { return "Default"; }
private:
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override;
+ StencilSupport onGetStencilSupport(const GrShape&) const override;
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
@@ -37,7 +37,7 @@
const GrUserStencilSettings&,
const GrClip&,
const SkMatrix& viewMatrix,
- const GrStyledShape&,
+ const GrShape&,
bool stencilOnly);
typedef GrPathRenderer INHERITED;
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index ab01e99..d958e5f 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -50,8 +50,8 @@
public:
ShapeDataKey() {}
ShapeDataKey(const ShapeDataKey& that) { *this = that; }
- ShapeDataKey(const GrStyledShape& shape, uint32_t dim) { this->set(shape, dim); }
- ShapeDataKey(const GrStyledShape& shape, const SkMatrix& ctm) { this->set(shape, ctm); }
+ ShapeDataKey(const GrShape& shape, uint32_t dim) { this->set(shape, dim); }
+ ShapeDataKey(const GrShape& shape, const SkMatrix& ctm) { this->set(shape, ctm); }
ShapeDataKey& operator=(const ShapeDataKey& that) {
fKey.reset(that.fKey.count());
@@ -60,7 +60,7 @@
}
// for SDF paths
- void set(const GrStyledShape& shape, uint32_t dim) {
+ void set(const GrShape& shape, uint32_t dim) {
// Shapes' keys are for their pre-style geometry, but by now we shouldn't have any
// relevant styling information.
SkASSERT(shape.style().isSimpleFill());
@@ -72,7 +72,7 @@
}
// for bitmap paths
- void set(const GrStyledShape& shape, const SkMatrix& ctm) {
+ void set(const GrShape& shape, const SkMatrix& ctm) {
// Shapes' keys are for their pre-style geometry, but by now we shouldn't have any
// relevant styling information.
SkASSERT(shape.style().isSimpleFill());
@@ -108,7 +108,7 @@
const uint32_t* data() const { return fKey.get(); }
private:
- // The key is composed of the GrStyledShape's key, and either the dimensions of the DF
+ // The key is composed of the GrShape's key, and either the dimensions of the DF
// generated for the path (32x32 max, 64x64 max, 128x128 max) if an SDF image or
// the matrix for the path with only fractional translation.
SkAutoSTArray<24, uint32_t> fKey;
@@ -228,7 +228,7 @@
static std::unique_ptr<GrDrawOp> Make(GrRecordingContext* context,
GrPaint&& paint,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& viewMatrix,
GrDrawOpAtlas* atlas,
ShapeCache* shapeCache,
@@ -240,7 +240,7 @@
stencilSettings);
}
- SmallPathOp(Helper::MakeArgs helperArgs, const SkPMColor4f& color, const GrStyledShape& shape,
+ SmallPathOp(Helper::MakeArgs helperArgs, const SkPMColor4f& color, const GrShape& shape,
const SkMatrix& viewMatrix, GrDrawOpAtlas* atlas, ShapeCache* shapeCache,
ShapeDataList* shapeList, bool gammaCorrect,
const GrUserStencilSettings* stencilSettings)
@@ -539,7 +539,7 @@
}
bool addDFPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo,
- GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrStyledShape& shape,
+ GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape,
uint32_t dimension, SkScalar scale) const {
const SkRect& bounds = shape.bounds();
@@ -644,7 +644,7 @@
}
bool addBMPathToAtlas(GrMeshDrawOp::Target* target, FlushInfo* flushInfo,
- GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrStyledShape& shape,
+ GrDrawOpAtlas* atlas, ShapeData* shapeData, const GrShape& shape,
const SkMatrix& ctm) const {
const SkRect& bounds = shape.bounds();
if (bounds.isEmpty()) {
@@ -840,9 +840,9 @@
bool fUsesDistanceField;
struct Entry {
- SkPMColor4f fColor;
- GrStyledShape fShape;
- SkMatrix fViewMatrix;
+ SkPMColor4f fColor;
+ GrShape fShape;
+ SkMatrix fViewMatrix;
};
SkSTArray<1, Entry> fShapes;
@@ -933,7 +933,7 @@
std::unique_ptr<GrDrawOp> GrSmallPathRenderer::createOp_TestingOnly(
GrRecordingContext* context,
GrPaint&& paint,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& viewMatrix,
GrDrawOpAtlas* atlas,
ShapeCache* shapeCache,
@@ -970,7 +970,7 @@
bool gammaCorrect = random->nextBool();
// This path renderer only allows fill styles.
- GrStyledShape shape(GrTest::TestPath(random), GrStyle::SimpleFill());
+ GrShape shape(GrTest::TestPath(random), GrStyle::SimpleFill());
return GrSmallPathRenderer::createOp_TestingOnly(
context,
std::move(paint), shape, viewMatrix,
diff --git a/src/gpu/ops/GrSmallPathRenderer.h b/src/gpu/ops/GrSmallPathRenderer.h
index c03b82a..a823286 100644
--- a/src/gpu/ops/GrSmallPathRenderer.h
+++ b/src/gpu/ops/GrSmallPathRenderer.h
@@ -12,7 +12,7 @@
#include "src/gpu/GrOnFlushResourceProvider.h"
#include "src/gpu/GrPathRenderer.h"
#include "src/gpu/geometry/GrRect.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/core/SkOpts.h"
#include "src/core/SkTDynamicHash.h"
@@ -56,7 +56,7 @@
static std::unique_ptr<GrDrawOp> createOp_TestingOnly(GrRecordingContext*,
GrPaint&&,
- const GrStyledShape&,
+ const GrShape&,
const SkMatrix& viewMatrix,
GrDrawOpAtlas* atlas,
ShapeCache*,
@@ -68,7 +68,7 @@
private:
class SmallPathOp;
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;
}
diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
index 0ab1a07..c05b955 100644
--- a/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp
@@ -14,7 +14,7 @@
#include "src/gpu/GrResourceProvider.h"
#include "src/gpu/GrStencilClip.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrDrawPathOp.h"
#include "src/gpu/ops/GrStencilAndCoverPathRenderer.h"
#include "src/gpu/ops/GrStencilPathOp.h"
@@ -49,7 +49,7 @@
return CanDrawPath::kYes;
}
-static sk_sp<GrPath> get_gr_path(GrResourceProvider* resourceProvider, const GrStyledShape& shape) {
+static sk_sp<GrPath> get_gr_path(GrResourceProvider* resourceProvider, const GrShape& shape) {
GrUniqueKey key;
bool isVolatile;
GrPath::ComputeKey(shape, &key, &isVolatile);
diff --git a/src/gpu/ops/GrStencilAndCoverPathRenderer.h b/src/gpu/ops/GrStencilAndCoverPathRenderer.h
index 8ed422d..74dd490 100644
--- a/src/gpu/ops/GrStencilAndCoverPathRenderer.h
+++ b/src/gpu/ops/GrStencilAndCoverPathRenderer.h
@@ -25,7 +25,7 @@
private:
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kStencilOnly_StencilSupport;
}
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.cpp b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
index 0347f4e..b8ab235 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.cpp
@@ -23,7 +23,7 @@
#include "src/gpu/GrStyle.h"
#include "src/gpu/GrTriangulator.h"
#include "src/gpu/geometry/GrPathUtils.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/ops/GrSimpleMeshDrawOpHelperWithStencil.h"
@@ -170,7 +170,7 @@
static std::unique_ptr<GrDrawOp> Make(GrRecordingContext* context,
GrPaint&& paint,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& viewMatrix,
SkIRect devClipBounds,
GrAAType aaType,
@@ -202,7 +202,7 @@
TriangulatingPathOp(Helper::MakeArgs helperArgs,
const SkPMColor4f& color,
- const GrStyledShape& shape,
+ const GrShape& shape,
const SkMatrix& viewMatrix,
const SkIRect& devClipBounds,
GrAAType aaType,
@@ -401,7 +401,7 @@
Helper fHelper;
SkPMColor4f fColor;
- GrStyledShape fShape;
+ GrShape fShape;
SkMatrix fViewMatrix;
SkIRect fDevClipBounds;
bool fAntiAlias;
@@ -447,7 +447,7 @@
do {
GrTest::TestStyle(random, &style);
} while (!style.isSimpleFill());
- GrStyledShape shape(path, style);
+ GrShape shape(path, style);
return TriangulatingPathOp::Make(context, std::move(paint), shape, viewMatrix, devClipBounds,
aaType, GrGetRandomStencil(random, context));
}
diff --git a/src/gpu/ops/GrTriangulatingPathRenderer.h b/src/gpu/ops/GrTriangulatingPathRenderer.h
index c2aa523..175325b 100644
--- a/src/gpu/ops/GrTriangulatingPathRenderer.h
+++ b/src/gpu/ops/GrTriangulatingPathRenderer.h
@@ -26,7 +26,7 @@
private:
CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
- StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
+ StencilSupport onGetStencilSupport(const GrShape&) const override {
return GrPathRenderer::kNoSupport_StencilSupport;
}
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.cpp b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
index e632c23..b4c2c53 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.cpp
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.cpp
@@ -13,7 +13,7 @@
#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrRenderTargetContext.h"
#include "src/gpu/GrSurfaceContextPriv.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrFillRectOp.h"
#include "src/gpu/tessellate/GrDrawAtlasPathOp.h"
#include "src/gpu/tessellate/GrTessellatePathOp.h"
diff --git a/src/gpu/tessellate/GrTessellationPathRenderer.h b/src/gpu/tessellate/GrTessellationPathRenderer.h
index bf8ea29..f09aa71 100644
--- a/src/gpu/tessellate/GrTessellationPathRenderer.h
+++ b/src/gpu/tessellate/GrTessellationPathRenderer.h
@@ -22,7 +22,7 @@
const char* name() const final { return "Tess"; }
GrTessellationPathRenderer(const GrCaps&);
- StencilSupport onGetStencilSupport(const GrStyledShape& shape) const override {
+ StencilSupport onGetStencilSupport(const GrShape& shape) const override {
// TODO: Single-pass (e.g., convex) paths can have full support.
return kStencilOnly_StencilSupport;
}
diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp
index e6bdcf8..eb6c93a 100644
--- a/src/gpu/text/GrTextBlob.cpp
+++ b/src/gpu/text/GrTextBlob.cpp
@@ -15,7 +15,7 @@
#include "src/gpu/GrBlurUtils.h"
#include "src/gpu/GrClip.h"
#include "src/gpu/GrStyle.h"
-#include "src/gpu/geometry/GrStyledShape.h"
+#include "src/gpu/geometry/GrShape.h"
#include "src/gpu/ops/GrAtlasTextOp.h"
#include "src/gpu/text/GrAtlasManager.h"
#include "src/gpu/text/GrStrikeCache.h"
@@ -508,7 +508,7 @@
subRun->fStrikeSpec.strikeToSourceRatio());
pathMatrix.postTranslate(pathGlyph.fOrigin.x(), pathGlyph.fOrigin.y());
- // TmpPath must be in the same scope as GrStyledShape shape below.
+ // TmpPath must be in the same scope as GrShape shape below.
SkTLazy<SkPath> tmpPath;
const SkPath* path = &pathGlyph.fPath;
if (!scalePath) {
@@ -526,7 +526,7 @@
}
// TODO: we are losing the mutability of the path here
- GrStyledShape shape(*path, paint);
+ GrShape shape(*path, paint);
target->drawShape(clip, runPaint, ctm, shape);
}
} else {
diff --git a/src/gpu/text/GrTextTarget.h b/src/gpu/text/GrTextTarget.h
index 693597f..8498d71 100644
--- a/src/gpu/text/GrTextTarget.h
+++ b/src/gpu/text/GrTextTarget.h
@@ -15,7 +15,7 @@
class GrClip;
class GrPaint;
class GrRecordingContext;
-class GrStyledShape;
+class GrShape;
class SkGlyphRunListPainter;
class SkMatrix;
struct SkIRect;
@@ -33,7 +33,7 @@
virtual void addDrawOp(const GrClip&, std::unique_ptr<GrAtlasTextOp> op) = 0;
virtual void drawShape(const GrClip&, const SkPaint&,
- const SkMatrix& viewMatrix, const GrStyledShape&) = 0;
+ const SkMatrix& viewMatrix, const GrShape&) = 0;
virtual void makeGrPaint(GrMaskFormat, const SkPaint&, const SkMatrix& viewMatrix,
GrPaint*) = 0;