aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2015-11-24 12:10:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-24 12:10:10 -0800
commitff2103200bad7abcf8929ae22ac78a9f4f725142 (patch)
treeb6fef9998bf11fdfbb9855414e8980cf47a2a4e9 /src/gpu/effects
parent6868c3fccf65d297a64919a7cb74f09780c845c3 (diff)
New API for computing optimization invariants.
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index c1e2011e08..77d29cba26 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -269,12 +269,13 @@ public:
const char* name() const override { return "DashBatch"; }
- void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
+ void computePipelineOptimizations(GrInitInvariantOutput* color,
+ GrInitInvariantOutput* coverage,
+ GrBatchToXPOverrides* overrides) const override {
// When this is called on a batch, there is only one geometry bundle
- out->setKnownFourComponents(fGeoData[0].fColor);
- }
- void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
- out->setUnknownSingleComponent();
+ color->setKnownFourComponents(fGeoData[0].fColor);
+ coverage->setUnknownSingleComponent();
+ overrides->fUsePLSDstRead = false;
}
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
@@ -300,18 +301,18 @@ private:
combinedMatrix.mapRect(&fBounds);
}
- void initBatchTracker(const GrPipelineOptimizations& opt) override {
+ void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
// Handle any color overrides
- if (!opt.readsColor()) {
+ if (!overrides.readsColor()) {
fGeoData[0].fColor = GrColor_ILLEGAL;
}
- opt.getOverrideColorIfSet(&fGeoData[0].fColor);
+ overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
// setup batch properties
- fBatch.fColorIgnored = !opt.readsColor();
+ fBatch.fColorIgnored = !overrides.readsColor();
fBatch.fColor = fGeoData[0].fColor;
- fBatch.fUsesLocalCoords = opt.readsLocalCoords();
- fBatch.fCoverageIgnored = !opt.readsCoverage();
+ fBatch.fUsesLocalCoords = overrides.readsLocalCoords();
+ fBatch.fCoverageIgnored = !overrides.readsCoverage();
}
struct DashDraw {