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

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

Issue 1301663002: Privatize GrBatch subclass overrides (Closed) Base URL: https://skia.googlesource.com/skia.git@drawsonvb
Patch Set: more Created 5 years, 4 months 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/GrTessellatingPathRenderer.cpp ('k') | src/gpu/batches/GrAAStrokeRectBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAAFillRectBatch.cpp
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 098c6bdae49e6060172bc2b5f80b0c09e8592faa..335dbedd8b1e4177c59e556c5ba5e4e2e40a846d 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -97,6 +97,32 @@ public:
fBatch.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage();
}
+ SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
+
+ // to avoid even the initial copy of the struct, we have a getter for the first item which
+ // is used to seed the batch with its initial geometry. After seeding, the client should call
+ // init() so the Batch can initialize itself
+ Geometry* geometry() { return &fGeoData[0]; }
+ void init() {
+ const Geometry& geo = fGeoData[0];
+ this->setBounds(geo.fDevRect);
+ }
+
+private:
+ AAFillRectBatch() {
+ this->initClassID<AAFillRectBatch<Base>>();
+
+ // Push back an initial geometry
+ fGeoData.push_back();
+ }
+
+ GrColor color() const { return fBatch.fColor; }
+ bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
+ bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCoverage; }
+ bool colorIgnored() const { return fBatch.fColorIgnored; }
+ const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
+ bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
+
void onPrepareDraws(Target* target) override {
bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
@@ -137,33 +163,6 @@ public:
helper.recordDraw(target);
}
- SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
- // to avoid even the initial copy of the struct, we have a getter for the first item which
- // is used to seed the batch with its initial geometry. After seeding, the client should call
- // init() so the Batch can initialize itself
- Geometry* geometry() { return &fGeoData[0]; }
- void init() {
- const Geometry& geo = fGeoData[0];
- this->setBounds(geo.fDevRect);
- }
-
-
-private:
- AAFillRectBatch() {
- this->initClassID<AAFillRectBatch<Base>>();
-
- // Push back an initial geometry
- fGeoData.push_back();
- }
-
- GrColor color() const { return fBatch.fColor; }
- bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
- bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCoverage; }
- bool colorIgnored() const { return fBatch.fColorIgnored; }
- const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
-
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
AAFillRectBatch* that = t->cast<AAFillRectBatch>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/batches/GrAAStrokeRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698