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

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

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 5 years, 7 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/GrDashingEffect.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 init.fColorIgnored = fBatch.fColorIgnored; 61 init.fColorIgnored = fBatch.fColorIgnored;
62 init.fOverrideColor = GrColor_ILLEGAL; 62 init.fOverrideColor = GrColor_ILLEGAL;
63 init.fCoverageIgnored = fBatch.fCoverageIgnored; 63 init.fCoverageIgnored = fBatch.fCoverageIgnored;
64 init.fUsesLocalCoords = fBatch.fUsesLocalCoords; 64 init.fUsesLocalCoords = fBatch.fUsesLocalCoords;
65 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(), init); 65 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(), init);
66 66
67 this->onGenerateGeometry(batchTarget, pipeline); 67 this->onGenerateGeometry(batchTarget, pipeline);
68 } 68 }
69 69
70 protected: 70 protected:
71 GrTestBatch(const GrGeometryProcessor* gp) { 71 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
72 fGeometryProcessor.reset(SkRef(gp)); 72 fGeometryProcessor.reset(SkRef(gp));
73
74 this->setBounds(bounds);
73 } 75 }
74 76
75 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; } 77 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; }
76 78
77 private: 79 private:
78 virtual Geometry* geoData(int index) = 0; 80 virtual Geometry* geoData(int index) = 0;
79 81
80 bool onCombineIfPossible(GrBatch* t) override { 82 bool onCombineIfPossible(GrBatch* t) override {
81 return false; 83 return false;
82 } 84 }
83 85
84 virtual void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline * pipeline) = 0; 86 virtual void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline * pipeline) = 0;
85 87
86 struct BatchTracker { 88 struct BatchTracker {
87 GrColor fColor; 89 GrColor fColor;
88 bool fUsesLocalCoords; 90 bool fUsesLocalCoords;
89 bool fColorIgnored; 91 bool fColorIgnored;
90 bool fCoverageIgnored; 92 bool fCoverageIgnored;
91 }; 93 };
92 94
93 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; 95 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
94 BatchTracker fBatch; 96 BatchTracker fBatch;
95 }; 97 };
96 98
97 #endif 99 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698