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

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

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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/batches/GrTessellatingPathRenderer.cpp ('k') | src/gpu/batches/GrVertexBatch.h » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 opt.getOverrideColorIfSet(&this->geoData(0)->fColor); 43 opt.getOverrideColorIfSet(&this->geoData(0)->fColor);
44 44
45 // setup batch properties 45 // setup batch properties
46 fBatch.fColorIgnored = !opt.readsColor(); 46 fBatch.fColorIgnored = !opt.readsColor();
47 fBatch.fColor = this->geoData(0)->fColor; 47 fBatch.fColor = this->geoData(0)->fColor;
48 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); 48 fBatch.fUsesLocalCoords = opt.readsLocalCoords();
49 fBatch.fCoverageIgnored = !opt.readsCoverage(); 49 fBatch.fCoverageIgnored = !opt.readsCoverage();
50 } 50 }
51 51
52 protected: 52 protected:
53 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { 53 GrTestBatch(uint32_t classID, const GrGeometryProcessor* gp, const SkRect& b ounds)
54 : INHERITED(classID) {
54 fGeometryProcessor.reset(SkRef(gp)); 55 fGeometryProcessor.reset(SkRef(gp));
55 56
56 this->setBounds(bounds); 57 this->setBounds(bounds);
57 } 58 }
58 59
59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; } 60 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; }
60 61
61 private: 62 private:
62 void onPrepareDraws(Target* target) override { 63 void onPrepareDraws(Target* target) override {
63 target->initDraw(fGeometryProcessor, this->pipeline()); 64 target->initDraw(fGeometryProcessor, this->pipeline());
(...skipping 11 matching lines...) Expand all
75 76
76 struct BatchTracker { 77 struct BatchTracker {
77 GrColor fColor; 78 GrColor fColor;
78 bool fUsesLocalCoords; 79 bool fUsesLocalCoords;
79 bool fColorIgnored; 80 bool fColorIgnored;
80 bool fCoverageIgnored; 81 bool fCoverageIgnored;
81 }; 82 };
82 83
83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; 84 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
84 BatchTracker fBatch; 85 BatchTracker fBatch;
86
87 typedef GrVertexBatch INHERITED;
85 }; 88 };
86 89
87 #endif 90 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrTessellatingPathRenderer.cpp ('k') | src/gpu/batches/GrVertexBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698