aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops/GrLatticeOp.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-21 09:20:25 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-21 15:12:49 +0000
commit92aee3d6857386f2b5b8e1148e680a7b58e9b1fc (patch)
tree8b54e16b9dbee4411c8e996504872672e1f61fa3 /src/gpu/ops/GrLatticeOp.cpp
parentbd81a327b5728b51cac8642128bd2f165d078ef7 (diff)
This renames methods and classes that relate to static analysis of combinations of GrDrawOps and GrPipelines.
Change-Id: I737b901a19d3c67d2ff7f95802fb4df35656beb2 Reviewed-on: https://skia-review.googlesource.com/6199 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops/GrLatticeOp.cpp')
-rw-r--r--src/gpu/ops/GrLatticeOp.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index 119032209d..af83aa629d 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -62,16 +62,19 @@ public:
return str;
}
- void computePipelineOptimizations(GrInitInvariantOutput* color,
- GrInitInvariantOutput* coverage,
- GrBatchToXPOverrides* overrides) const override {
- color->setUnknownFourComponents();
- coverage->setKnownSingleComponent(0xff);
+private:
+ void getPipelineAnalysisInput(GrPipelineAnalysisDrawOpInput* input) const override {
+ input->pipelineColorInput()->setUnknownFourComponents();
+ input->pipelineCoverageInput()->setKnownSingleComponent(0xff);
+ }
+
+ void applyPipelineOptimizations(const GrPipelineOptimizations& analysioptimizations) override {
+ analysioptimizations.getOverrideColorIfSet(&fPatches[0].fColor);
+ fOptimizations = analysioptimizations;
}
-private:
void onPrepareDraws(Target* target) const override {
- sk_sp<GrGeometryProcessor> gp(create_gp(fOverrides.readsCoverage()));
+ sk_sp<GrGeometryProcessor> gp(create_gp(fOptimizations.readsCoverage()));
if (!gp) {
SkDebugf("Couldn't create GrGeometryProcessor\n");
return;
@@ -135,11 +138,6 @@ private:
helper.recordDraw(target, gp.get());
}
- void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
- overrides.getOverrideColorIfSet(&fPatches[0].fColor);
- fOverrides = overrides;
- }
-
bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {
NonAALatticeOp* that = t->cast<NonAALatticeOp>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
@@ -152,8 +150,9 @@ private:
// In the event of two ops, one who can tweak, one who cannot, we just fall back to not
// tweaking.
- if (fOverrides.canTweakAlphaForCoverage() && !that->fOverrides.canTweakAlphaForCoverage()) {
- fOverrides = that->fOverrides;
+ if (fOptimizations.canTweakAlphaForCoverage() &&
+ !that->fOptimizations.canTweakAlphaForCoverage()) {
+ fOptimizations = that->fOptimizations;
}
fPatches.move_back_n(that->fPatches.count(), that->fPatches.begin());
@@ -168,7 +167,7 @@ private:
GrColor fColor;
};
- GrXPOverridesForBatch fOverrides;
+ GrPipelineOptimizations fOptimizations;
int fImageWidth;
int fImageHeight;
SkSTArray<1, Patch, true> fPatches;