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

Side by Side Diff: src/gpu/GrAADistanceFieldPathRenderer.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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAADistanceFieldPathRenderer.h" 9 #include "GrAADistanceFieldPathRenderer.h"
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 const char* name() const override { return "AADistanceFieldPathBatch"; } 132 const char* name() const override { return "AADistanceFieldPathBatch"; }
133 133
134 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 134 void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
135 out->setKnownFourComponents(fBatch.fColor); 135 out->setKnownFourComponents(fBatch.fColor);
136 } 136 }
137 137
138 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 138 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
139 out->setUnknownSingleComponent(); 139 out->setUnknownSingleComponent();
140 } 140 }
141 141
142 private:
142 void initBatchTracker(const GrPipelineOptimizations& opt) override { 143 void initBatchTracker(const GrPipelineOptimizations& opt) override {
143 // Handle any color overrides 144 // Handle any color overrides
144 if (!opt.readsColor()) { 145 if (!opt.readsColor()) {
145 fBatch.fColor = GrColor_ILLEGAL; 146 fBatch.fColor = GrColor_ILLEGAL;
146 } 147 }
147 opt.getOverrideColorIfSet(&fBatch.fColor); 148 opt.getOverrideColorIfSet(&fBatch.fColor);
148 149
149 // setup batch properties 150 // setup batch properties
150 fBatch.fColorIgnored = !opt.readsColor(); 151 fBatch.fColorIgnored = !opt.readsColor();
151 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); 152 fBatch.fUsesLocalCoords = opt.readsLocalCoords();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 args.fPath, 267 args.fPath,
267 args.fPathData); 268 args.fPathData);
268 flushInfo.fInstancesToFlush++; 269 flushInfo.fInstancesToFlush++;
269 } 270 }
270 271
271 this->flush(target, &flushInfo); 272 this->flush(target, &flushInfo);
272 } 273 }
273 274
274 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } 275 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
275 276
276 private:
277 AADistanceFieldPathBatch(const Geometry& geometry, GrColor color, const SkMa trix& viewMatrix, 277 AADistanceFieldPathBatch(const Geometry& geometry, GrColor color, const SkMa trix& viewMatrix,
278 GrBatchAtlas* atlas, 278 GrBatchAtlas* atlas,
279 PathCache* pathCache, PathDataList* pathList) { 279 PathCache* pathCache, PathDataList* pathList) {
280 this->initClassID<AADistanceFieldPathBatch>(); 280 this->initClassID<AADistanceFieldPathBatch>();
281 fBatch.fColor = color; 281 fBatch.fColor = color;
282 fBatch.fViewMatrix = viewMatrix; 282 fBatch.fViewMatrix = viewMatrix;
283 fGeoData.push_back(geometry); 283 fGeoData.push_back(geometry);
284 fGeoData.back().fPathData = NULL; 284 fGeoData.back().fPathData = NULL;
285 285
286 fAtlas = atlas; 286 fAtlas = atlas;
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 geometry.fPath = GrTest::TestPath(random); 617 geometry.fPath = GrTest::TestPath(random);
618 geometry.fAntiAlias = random->nextBool(); 618 geometry.fAntiAlias = random->nextBool();
619 619
620 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, 620 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
621 gTestStruct.fAtlas, 621 gTestStruct.fAtlas,
622 &gTestStruct.fPathCache, 622 &gTestStruct.fPathCache,
623 &gTestStruct.fPathList); 623 &gTestStruct.fPathList);
624 } 624 }
625 625
626 #endif 626 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698