aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrDrawPathOp.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-04-07 15:37:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-08 00:46:14 +0000
commit0ae0e23696f2ef08503040f8c02765eb58b26ddf (patch)
tree4213b333c45314df8fd0a7bda1891b99bcdcb053 /src/gpu/ops/GrDrawPathOp.h
parent44320dda9495b9cf8ff8a5ea4f9d9522edeabef6 (diff)
Create GrXferProcessor while doing GrProcessorSet analysis.
Bug: skia: Change-Id: I62a628f9c0536ffb05c8f9d0c9ded5657f93b48e Reviewed-on: https://skia-review.googlesource.com/11482 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops/GrDrawPathOp.h')
-rw-r--r--src/gpu/ops/GrDrawPathOp.h45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/gpu/ops/GrDrawPathOp.h b/src/gpu/ops/GrDrawPathOp.h
index 0631adcdf6..8995de4bbd 100644
--- a/src/gpu/ops/GrDrawPathOp.h
+++ b/src/gpu/ops/GrDrawPathOp.h
@@ -23,31 +23,33 @@ class GrPaint;
class GrDrawPathOpBase : public GrDrawOp {
protected:
- GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix, GrPaint&& paint,
- GrPathRendering::FillType fill, GrAA aa);
+ GrDrawPathOpBase(uint32_t classID, const SkMatrix& viewMatrix, GrPaint&&,
+ GrPathRendering::FillType, GrAAType);
FixedFunctionFlags fixedFunctionFlags() const override {
- return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil;
+ if (GrAATypeIsHW(fAAType)) {
+ return FixedFunctionFlags::kUsesHWAA | FixedFunctionFlags::kUsesStencil;
+ }
+ return FixedFunctionFlags::kUsesStencil;
}
bool xpRequiresDstTexture(const GrCaps& caps, const GrAppliedClip* clip) override {
return this->doProcessorAnalysis(caps, clip).requiresDstTexture();
}
- void wasRecorded() override { fProcessorSet.makePendingExecution(); }
-
protected:
const SkMatrix& viewMatrix() const { return fViewMatrix; }
- GrColor color() const { return fAnalysis.inputColor(); }
+ GrColor color() const { return fInputColor; }
GrPathRendering::FillType fillType() const { return fFillType; }
const GrProcessorSet& processors() const { return fProcessorSet; }
void initPipeline(const GrOpFlushState&, GrPipeline*);
const GrProcessorSet::Analysis& doProcessorAnalysis(const GrCaps& caps,
const GrAppliedClip* clip) {
- fProcessorSet.analyzeAndEliminateFragmentProcessors(
- &fAnalysis, fAnalysis.inputColor(), GrProcessorAnalysisCoverage::kNone, clip, caps);
+ bool isMixedSamples = GrAAType::kMixedSamples == fAAType;
+ fAnalysis = fProcessorSet.finalize(fInputColor, GrProcessorAnalysisCoverage::kNone, clip,
+ isMixedSamples, caps, &fInputColor);
return fAnalysis;
}
const GrProcessorSet::Analysis& processorAnalysis() const {
- SkASSERT(fAnalysis.isInitializedWithProcessorSet());
+ SkASSERT(fAnalysis.isInitialized());
return fAnalysis;
}
@@ -55,10 +57,11 @@ private:
void onPrepare(GrOpFlushState*) final {}
SkMatrix fViewMatrix;
+ GrColor fInputColor;
GrProcessorSet fProcessorSet;
GrProcessorSet::Analysis fAnalysis;
GrPathRendering::FillType fFillType;
- GrAA fAA;
+ GrAAType fAAType;
typedef GrDrawOp INHERITED;
};
@@ -67,9 +70,10 @@ class GrDrawPathOp final : public GrDrawPathOpBase {
public:
DEFINE_OP_CLASS_ID
- static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, GrPaint&& paint, GrAA aa,
- GrPath* path) {
- return std::unique_ptr<GrDrawOp>(new GrDrawPathOp(viewMatrix, std::move(paint), aa, path));
+ static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, GrPaint&& paint,
+ GrAAType aaType, GrPath* path) {
+ return std::unique_ptr<GrDrawOp>(
+ new GrDrawPathOp(viewMatrix, std::move(paint), aaType, path));
}
const char* name() const override { return "DrawPath"; }
@@ -77,8 +81,8 @@ public:
SkString dumpInfo() const override;
private:
- GrDrawPathOp(const SkMatrix& viewMatrix, GrPaint&& paint, GrAA aa, const GrPath* path)
- : GrDrawPathOpBase(ClassID(), viewMatrix, std::move(paint), path->getFillType(), aa)
+ GrDrawPathOp(const SkMatrix& viewMatrix, GrPaint&& paint, GrAAType aaType, const GrPath* path)
+ : GrDrawPathOpBase(ClassID(), viewMatrix, std::move(paint), path->getFillType(), aaType)
, fPath(path) {
this->setTransformedBounds(path->getBounds(), viewMatrix, HasAABloat::kNo, IsZeroArea::kNo);
}
@@ -160,11 +164,12 @@ public:
static std::unique_ptr<GrDrawOp> Make(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x,
SkScalar y, GrPaint&& paint,
- GrPathRendering::FillType fill, GrAA aa,
+ GrPathRendering::FillType fill, GrAAType aaType,
GrPathRange* range, const InstanceData* instanceData,
const SkRect& bounds) {
- return std::unique_ptr<GrDrawOp>(new GrDrawPathRangeOp(
- viewMatrix, scale, x, y, std::move(paint), fill, aa, range, instanceData, bounds));
+ return std::unique_ptr<GrDrawOp>(new GrDrawPathRangeOp(viewMatrix, scale, x, y,
+ std::move(paint), fill, aaType,
+ range, instanceData, bounds));
}
const char* name() const override { return "DrawPathRange"; }
@@ -173,8 +178,8 @@ public:
private:
GrDrawPathRangeOp(const SkMatrix& viewMatrix, SkScalar scale, SkScalar x, SkScalar y,
- GrPaint&& paint, GrPathRendering::FillType fill, GrAA aa, GrPathRange* range,
- const InstanceData* instanceData, const SkRect& bounds);
+ GrPaint&& paint, GrPathRendering::FillType fill, GrAAType aaType,
+ GrPathRange* range, const InstanceData* instanceData, const SkRect& bounds);
TransformType transformType() const { return fDraws.head()->fInstanceData->transformType(); }