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

Side by Side Diff: src/gpu/GrTestBatch.h

Issue 1213013003: Revert of Rework GrPipelineInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrCustomXfermode.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 2015 Google Inc. 2 * Copyright 2015 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 #ifndef GrTestBatch_DEFINED 8 #ifndef GrTestBatch_DEFINED
9 #define GrTestBatch_DEFINED 9 #define GrTestBatch_DEFINED
10 10
(...skipping 16 matching lines...) Expand all
27 // When this is called on a batch, there is only one geometry bundle 27 // When this is called on a batch, there is only one geometry bundle
28 out->setKnownFourComponents(this->geoData(0)->fColor); 28 out->setKnownFourComponents(this->geoData(0)->fColor);
29 } 29 }
30 30
31 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { 31 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
32 out->setUnknownSingleComponent(); 32 out->setUnknownSingleComponent();
33 } 33 }
34 34
35 void initBatchTracker(const GrPipelineInfo& init) override { 35 void initBatchTracker(const GrPipelineInfo& init) override {
36 // Handle any color overrides 36 // Handle any color overrides
37 if (!init.readsColor()) { 37 if (init.fColorIgnored) {
38 this->geoData(0)->fColor = GrColor_ILLEGAL; 38 this->geoData(0)->fColor = GrColor_ILLEGAL;
39 } else if (GrColor_ILLEGAL != init.fOverrideColor) {
40 this->geoData(0)->fColor = init.fOverrideColor;
39 } 41 }
40 init.getOverrideColorIfSet(&this->geoData(0)->fColor);
41 42
42 // setup batch properties 43 // setup batch properties
43 fBatch.fColorIgnored = !init.readsColor(); 44 fBatch.fColorIgnored = init.fColorIgnored;
44 fBatch.fColor = this->geoData(0)->fColor; 45 fBatch.fColor = this->geoData(0)->fColor;
45 fBatch.fUsesLocalCoords = init.readsLocalCoords(); 46 fBatch.fUsesLocalCoords = init.fUsesLocalCoords;
46 fBatch.fCoverageIgnored = !init.readsCoverage(); 47 fBatch.fCoverageIgnored = init.fCoverageIgnored;
47 } 48 }
48 49
49 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 50 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override {
50 batchTarget->initDraw(fGeometryProcessor, pipeline); 51 batchTarget->initDraw(fGeometryProcessor, pipeline);
51 52
52 this->onGenerateGeometry(batchTarget, pipeline); 53 this->onGenerateGeometry(batchTarget, pipeline);
53 } 54 }
54 55
55 protected: 56 protected:
56 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { 57 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
(...skipping 19 matching lines...) Expand all
76 bool fUsesLocalCoords; 77 bool fUsesLocalCoords;
77 bool fColorIgnored; 78 bool fColorIgnored;
78 bool fCoverageIgnored; 79 bool fCoverageIgnored;
79 }; 80 };
80 81
81 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; 82 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
82 BatchTracker fBatch; 83 BatchTracker fBatch;
83 }; 84 };
84 85
85 #endif 86 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698