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

Unified Diff: src/gpu/GrAtlasTextContext.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/GrAALinearizingConvexPathRenderer.cpp ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index fbfb2e1c94d26034ebf470444abfe23f4b5a6c68..56486e9ccb56a9483250661c6105efef3d7beb7c 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1488,6 +1488,28 @@ public:
return batch;
}
+ // 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];
+ fBatch.fColor = geo.fColor;
+ fBatch.fViewMatrix = geo.fBlob->fViewMatrix;
+
+ // We don't yet position distance field text on the cpu, so we have to map the vertex bounds
+ // into device space
+ const Run& run = geo.fBlob->fRuns[geo.fRun];
+ if (run.fSubRunInfo[geo.fSubRun].fDrawAsDistanceFields) {
+ SkRect bounds = run.fVertexBounds;
+ fBatch.fViewMatrix.mapRect(&bounds);
+ this->setBounds(bounds);
+ } else {
+ this->setBounds(run.fVertexBounds);
+ }
+ }
+
const char* name() const override { return "TextBatch"; }
void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
@@ -1514,6 +1536,7 @@ public:
}
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1762,28 +1785,6 @@ public:
this->flush(target, &flushInfo);
}
- // 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];
- fBatch.fColor = geo.fColor;
- fBatch.fViewMatrix = geo.fBlob->fViewMatrix;
-
- // We don't yet position distance field text on the cpu, so we have to map the vertex bounds
- // into device space
- const Run& run = geo.fBlob->fRuns[geo.fRun];
- if (run.fSubRunInfo[geo.fSubRun].fDrawAsDistanceFields) {
- SkRect bounds = run.fVertexBounds;
- fBatch.fViewMatrix.mapRect(&bounds);
- this->setBounds(bounds);
- } else {
- this->setBounds(run.fVertexBounds);
- }
- }
-
-private:
TextBatch() {} // initialized in factory functions.
~TextBatch() {
« no previous file with comments | « src/gpu/GrAALinearizingConvexPathRenderer.cpp ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698