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

Side by Side Diff: src/gpu/GrDefaultPathRenderer.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/GrAtlasTextContext.cpp ('k') | src/gpu/GrOvalRenderer.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrDefaultPathRenderer.h" 8 #include "GrDefaultPathRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 const char* name() const override { return "DefaultPathBatch"; } 227 const char* name() const override { return "DefaultPathBatch"; }
228 228
229 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { 229 void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
230 // When this is called on a batch, there is only one geometry bundle 230 // When this is called on a batch, there is only one geometry bundle
231 out->setKnownFourComponents(fGeoData[0].fColor); 231 out->setKnownFourComponents(fGeoData[0].fColor);
232 } 232 }
233 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 233 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
234 out->setKnownSingleComponent(this->coverage()); 234 out->setKnownSingleComponent(this->coverage());
235 } 235 }
236 236
237 private:
237 void initBatchTracker(const GrPipelineOptimizations& opt) override { 238 void initBatchTracker(const GrPipelineOptimizations& opt) override {
238 // Handle any color overrides 239 // Handle any color overrides
239 if (!opt.readsColor()) { 240 if (!opt.readsColor()) {
240 fGeoData[0].fColor = GrColor_ILLEGAL; 241 fGeoData[0].fColor = GrColor_ILLEGAL;
241 } 242 }
242 opt.getOverrideColorIfSet(&fGeoData[0].fColor); 243 opt.getOverrideColorIfSet(&fGeoData[0].fColor);
243 244
244 // setup batch properties 245 // setup batch properties
245 fBatch.fColorIgnored = !opt.readsColor(); 246 fBatch.fColorIgnored = !opt.readsColor();
246 fBatch.fColor = fGeoData[0].fColor; 247 fBatch.fColor = fGeoData[0].fColor;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 369 }
369 target->draw(vertices); 370 target->draw(vertices);
370 371
371 // put back reserves 372 // put back reserves
372 target->putBackIndices((size_t)(maxIndices - indexOffset)); 373 target->putBackIndices((size_t)(maxIndices - indexOffset));
373 target->putBackVertices((size_t)(maxVertices - vertexOffset), (size_t)ve rtexStride); 374 target->putBackVertices((size_t)(maxVertices - vertexOffset), (size_t)ve rtexStride);
374 } 375 }
375 376
376 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } 377 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
377 378
378 private:
379 DefaultPathBatch(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix, 379 DefaultPathBatch(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix,
380 bool isHairline, const SkRect& devBounds) { 380 bool isHairline, const SkRect& devBounds) {
381 this->initClassID<DefaultPathBatch>(); 381 this->initClassID<DefaultPathBatch>();
382 fBatch.fCoverage = coverage; 382 fBatch.fCoverage = coverage;
383 fBatch.fIsHairline = isHairline; 383 fBatch.fIsHairline = isHairline;
384 fBatch.fViewMatrix = viewMatrix; 384 fBatch.fViewMatrix = viewMatrix;
385 fGeoData.push_back(geometry); 385 fGeoData.push_back(geometry);
386 386
387 this->setBounds(devBounds); 387 this->setBounds(devBounds);
388 } 388 }
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 geometry.fColor = color; 753 geometry.fColor = color;
754 geometry.fPath = path; 754 geometry.fPath = path;
755 geometry.fTolerance = srcSpaceTol; 755 geometry.fTolerance = srcSpaceTol;
756 756
757 viewMatrix.mapRect(&bounds); 757 viewMatrix.mapRect(&bounds);
758 uint8_t coverage = GrRandomCoverage(random); 758 uint8_t coverage = GrRandomCoverage(random);
759 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds ); 759 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds );
760 } 760 }
761 761
762 #endif 762 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698