Rename GrStrokeOp -> GrStrokeTessellateOp
Bug: skia:10419 Change-Id: I04fecec39610d7519edef8a97f367b329b6eea4c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366116 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
04f471aa49
commit
05007dfd58
@ -484,8 +484,8 @@ skia_gpu_sources = [
|
||||
"$_src/gpu/tessellate/GrStrokeIndirectTessellator.cpp",
|
||||
"$_src/gpu/tessellate/GrStrokeIndirectTessellator.h",
|
||||
"$_src/gpu/tessellate/GrStrokeIterator.h",
|
||||
"$_src/gpu/tessellate/GrStrokeOp.cpp",
|
||||
"$_src/gpu/tessellate/GrStrokeOp.h",
|
||||
"$_src/gpu/tessellate/GrStrokeTessellateOp.cpp",
|
||||
"$_src/gpu/tessellate/GrStrokeTessellateOp.h",
|
||||
"$_src/gpu/tessellate/GrStrokeTessellateShader.cpp",
|
||||
"$_src/gpu/tessellate/GrStrokeTessellateShader.h",
|
||||
"$_src/gpu/tessellate/GrTessellatingStencilFillOp.cpp",
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define GrStrokeHardwareTessellator_DEFINED
|
||||
|
||||
#include "include/core/SkStrokeRec.h"
|
||||
#include "src/gpu/tessellate/GrStrokeOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeTessellateOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeTessellateShader.h"
|
||||
|
||||
// Renders opaque, constant-color strokes by decomposing them into standalone tessellation patches.
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef GrStrokeIndirectTessellator_DEFINED
|
||||
#define GrStrokeIndirectTessellator_DEFINED
|
||||
|
||||
#include "src/gpu/tessellate/GrStrokeOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeTessellateOp.h"
|
||||
|
||||
struct SkPoint;
|
||||
namespace skiatest { class Reporter; }
|
||||
|
@ -5,7 +5,7 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "src/gpu/tessellate/GrStrokeOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeTessellateOp.h"
|
||||
|
||||
#include "src/core/SkPathPriv.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
@ -14,8 +14,9 @@
|
||||
#include "src/gpu/tessellate/GrStrokeHardwareTessellator.h"
|
||||
#include "src/gpu/tessellate/GrStrokeIndirectTessellator.h"
|
||||
|
||||
GrStrokeOp::GrStrokeOp(GrAAType aaType, const SkMatrix& viewMatrix, const SkPath& path,
|
||||
const SkStrokeRec& stroke, GrPaint&& paint)
|
||||
GrStrokeTessellateOp::GrStrokeTessellateOp(GrAAType aaType, const SkMatrix& viewMatrix,
|
||||
const SkPath& path, const SkStrokeRec& stroke,
|
||||
GrPaint&& paint)
|
||||
: GrDrawOp(ClassID())
|
||||
, fAAType(aaType)
|
||||
, fViewMatrix(viewMatrix)
|
||||
@ -32,7 +33,7 @@ GrStrokeOp::GrStrokeOp(GrAAType aaType, const SkMatrix& viewMatrix, const SkPath
|
||||
this->setBounds(devBounds, HasAABloat(GrAAType::kCoverage == fAAType), IsHairline::kNo);
|
||||
}
|
||||
|
||||
void GrStrokeOp::visitProxies(const VisitProxyFunc& fn) const {
|
||||
void GrStrokeTessellateOp::visitProxies(const VisitProxyFunc& fn) const {
|
||||
if (fFillProgram) {
|
||||
fFillProgram->visitFPProxies(fn);
|
||||
} else if (fStencilProgram) {
|
||||
@ -42,7 +43,7 @@ void GrStrokeOp::visitProxies(const VisitProxyFunc& fn) const {
|
||||
}
|
||||
}
|
||||
|
||||
GrDrawOp::FixedFunctionFlags GrStrokeOp::fixedFunctionFlags() const {
|
||||
GrDrawOp::FixedFunctionFlags GrStrokeTessellateOp::fixedFunctionFlags() const {
|
||||
// We might not actually end up needing stencil, but won't know for sure until finalize().
|
||||
// Request it just in case we do end up needing it.
|
||||
auto flags = FixedFunctionFlags::kUsesStencil;
|
||||
@ -52,8 +53,10 @@ GrDrawOp::FixedFunctionFlags GrStrokeOp::fixedFunctionFlags() const {
|
||||
return flags;
|
||||
}
|
||||
|
||||
GrProcessorSet::Analysis GrStrokeOp::finalize(const GrCaps& caps, const GrAppliedClip* clip,
|
||||
bool hasMixedSampledCoverage, GrClampType clampType) {
|
||||
GrProcessorSet::Analysis GrStrokeTessellateOp::finalize(const GrCaps& caps,
|
||||
const GrAppliedClip* clip,
|
||||
bool hasMixedSampledCoverage,
|
||||
GrClampType clampType) {
|
||||
// Make sure the finalize happens before combining. We might change fNeedsStencil here.
|
||||
SkASSERT(fPathList.begin().fCurr->fNext == nullptr);
|
||||
const GrProcessorSet::Analysis& analysis = fProcessors.finalize(
|
||||
@ -63,10 +66,10 @@ GrProcessorSet::Analysis GrStrokeOp::finalize(const GrCaps& caps, const GrApplie
|
||||
return analysis;
|
||||
}
|
||||
|
||||
GrOp::CombineResult GrStrokeOp::onCombineIfPossible(GrOp* grOp, SkArenaAlloc* alloc,
|
||||
const GrCaps&) {
|
||||
GrOp::CombineResult GrStrokeTessellateOp::onCombineIfPossible(GrOp* grOp, SkArenaAlloc* alloc,
|
||||
const GrCaps&) {
|
||||
SkASSERT(grOp->classID() == this->classID());
|
||||
auto* op = static_cast<GrStrokeOp*>(grOp);
|
||||
auto* op = static_cast<GrStrokeTessellateOp*>(grOp);
|
||||
if (fNeedsStencil ||
|
||||
op->fNeedsStencil ||
|
||||
fColor != op->fColor ||
|
||||
@ -106,7 +109,8 @@ constexpr static GrUserStencilSettings kTestAndResetStencil(
|
||||
GrUserStencilOp::kReplace,
|
||||
0xffff>());
|
||||
|
||||
void GrStrokeOp::prePrepareTessellator(GrPathShader::ProgramArgs&& args, GrAppliedClip&& clip) {
|
||||
void GrStrokeTessellateOp::prePrepareTessellator(GrPathShader::ProgramArgs&& args,
|
||||
GrAppliedClip&& clip) {
|
||||
SkASSERT(!fTessellator);
|
||||
SkASSERT(!fFillProgram);
|
||||
SkASSERT(!fStencilProgram);
|
||||
@ -159,10 +163,11 @@ void GrStrokeOp::prePrepareTessellator(GrPathShader::ProgramArgs&& args, GrAppli
|
||||
fillStencil);
|
||||
}
|
||||
|
||||
void GrStrokeOp::onPrePrepare(GrRecordingContext* context, const GrSurfaceProxyView& writeView,
|
||||
GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp) {
|
||||
void GrStrokeTessellateOp::onPrePrepare(GrRecordingContext* context,
|
||||
const GrSurfaceProxyView& writeView, GrAppliedClip* clip,
|
||||
const GrXferProcessor::DstProxyView& dstProxyView,
|
||||
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp
|
||||
colorLoadOp) {
|
||||
this->prePrepareTessellator({context->priv().recordTimeAllocator(), writeView, &dstProxyView,
|
||||
renderPassXferBarriers, colorLoadOp, context->priv().caps()},
|
||||
(clip) ? std::move(*clip) : GrAppliedClip::Disabled());
|
||||
@ -174,7 +179,7 @@ void GrStrokeOp::onPrePrepare(GrRecordingContext* context, const GrSurfaceProxyV
|
||||
}
|
||||
}
|
||||
|
||||
void GrStrokeOp::onPrepare(GrOpFlushState* flushState) {
|
||||
void GrStrokeTessellateOp::onPrepare(GrOpFlushState* flushState) {
|
||||
if (!fTessellator) {
|
||||
this->prePrepareTessellator({flushState->allocator(), flushState->writeView(),
|
||||
&flushState->dstProxyView(), flushState->renderPassBarriers(),
|
||||
@ -185,7 +190,7 @@ void GrStrokeOp::onPrepare(GrOpFlushState* flushState) {
|
||||
fTessellator->prepare(flushState, fViewMatrix, fPathList, fStroke, fTotalCombinedVerbCnt);
|
||||
}
|
||||
|
||||
void GrStrokeOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
|
||||
void GrStrokeTessellateOp::onExecute(GrOpFlushState* flushState, const SkRect& chainBounds) {
|
||||
SkASSERT(chainBounds == this->bounds());
|
||||
if (fStencilProgram) {
|
||||
flushState->bindPipelineAndScissorClip(*fStencilProgram, this->bounds());
|
@ -5,8 +5,8 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef GrStrokeOp_DEFINED
|
||||
#define GrStrokeOp_DEFINED
|
||||
#ifndef GrStrokeTessellateOp_DEFINED
|
||||
#define GrStrokeTessellateOp_DEFINED
|
||||
|
||||
#include "include/core/SkStrokeRec.h"
|
||||
#include "src/gpu/GrSTArenaList.h"
|
||||
@ -31,19 +31,19 @@ public:
|
||||
|
||||
// Base class for ops that render opaque, constant-color strokes by linearizing them into sorted
|
||||
// "parametric" and "radial" edges. See GrStrokeTessellateShader.
|
||||
class GrStrokeOp : public GrDrawOp {
|
||||
class GrStrokeTessellateOp : public GrDrawOp {
|
||||
public:
|
||||
// The provided matrix must be a similarity matrix for the time being. This is so we can
|
||||
// bootstrap this Op on top of GrStrokeGeometry with minimal modifications.
|
||||
//
|
||||
// Patches can overlap, so until a stencil technique is implemented, the provided paint must be
|
||||
// a constant blended color.
|
||||
GrStrokeOp(GrAAType, const SkMatrix&, const SkPath&, const SkStrokeRec&, GrPaint&&);
|
||||
GrStrokeTessellateOp(GrAAType, const SkMatrix&, const SkPath&, const SkStrokeRec&, GrPaint&&);
|
||||
|
||||
protected:
|
||||
DEFINE_OP_CLASS_ID
|
||||
|
||||
const char* name() const override { return "GrStrokeOp"; }
|
||||
const char* name() const override { return "GrStrokeTessellateOp"; }
|
||||
void visitProxies(const VisitProxyFunc& fn) const override;
|
||||
FixedFunctionFlags fixedFunctionFlags() const override;
|
||||
GrProcessorSet::Analysis finalize(const GrCaps&, const GrAppliedClip*,
|
@ -18,7 +18,7 @@
|
||||
#include "src/gpu/ops/GrFillRectOp.h"
|
||||
#include "src/gpu/tessellate/GrDrawAtlasPathOp.h"
|
||||
#include "src/gpu/tessellate/GrPathInnerTriangulateOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeOp.h"
|
||||
#include "src/gpu/tessellate/GrStrokeTessellateOp.h"
|
||||
#include "src/gpu/tessellate/GrTessellatingStencilFillOp.h"
|
||||
#include "src/gpu/tessellate/GrWangsFormula.h"
|
||||
|
||||
@ -211,7 +211,8 @@ static GrOp::Owner make_op(GrRecordingContext* rContext, const GrSurfaceContext*
|
||||
if (!shape.style().isSimpleFill()) {
|
||||
const SkStrokeRec& stroke = shape.style().strokeRec();
|
||||
SkASSERT(stroke.getStyle() != SkStrokeRec::kStrokeAndFill_Style);
|
||||
return GrOp::Make<GrStrokeOp>(rContext, aaType, viewMatrix, path, stroke, std::move(paint));
|
||||
return GrOp::Make<GrStrokeTessellateOp>(rContext, aaType, viewMatrix, path, stroke,
|
||||
std::move(paint));
|
||||
} else {
|
||||
if ((1 << worstCaseResolveLevel) > shaderCaps.maxTessellationSegments()) {
|
||||
// The path is too large for hardware tessellation; a curve in this bounding box could
|
||||
|
Loading…
Reference in New Issue
Block a user