Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: src/gpu/batches/GrAAStrokeRectBatch.cpp

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp ('k') | src/gpu/batches/GrAtlasTextBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAAStrokeRectBatch.cpp
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index 9addc2fa417b9f4d6a45424932bd34ea562ba09d..419964fb75330689e94369cbf84c2c6396d98214 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -62,13 +62,13 @@ public:
const char* name() const override { return "AAStrokeRect"; }
- 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; }
@@ -108,7 +108,7 @@ private:
}
void onPrepareDraws(Target*) override;
- void initBatchTracker(const GrPipelineOptimizations&) override;
+ void initBatchTracker(const GrXPOverridesForBatch&) override;
AAStrokeRectBatch(const SkMatrix& viewMatrix,bool miterStroke)
: INHERITED(ClassID()) {
@@ -167,19 +167,19 @@ private:
typedef GrVertexBatch INHERITED;
};
-void AAStrokeRectBatch::initBatchTracker(const GrPipelineOptimizations& opt) {
+void AAStrokeRectBatch::initBatchTracker(const GrXPOverridesForBatch& overrides) {
// 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.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage();
+ fBatch.fUsesLocalCoords = overrides.readsLocalCoords();
+ fBatch.fCoverageIgnored = !overrides.readsCoverage();
+ fBatch.fCanTweakAlphaForCoverage = overrides.canTweakAlphaForCoverage();
}
void AAStrokeRectBatch::onPrepareDraws(Target* target) {
« no previous file with comments | « src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp ('k') | src/gpu/batches/GrAtlasTextBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698