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

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

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 : INHERITED(classID) { 53 : INHERITED(classID) {
54 fGeometryProcessor.reset(SkRef(gp)); 54 fGeometryProcessor.reset(SkRef(gp));
55 55
56 this->setBounds(bounds); 56 this->setBounds(bounds);
57 } 57 }
58 58
59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; } 59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce ssor; }
60 60
61 private: 61 private:
62 void onPrepareDraws(Target* target) const override { 62 void onPrepareDraws(Target* target) const override {
63 target->initDraw(fGeometryProcessor, this->pipeline()); 63 target->initDraw(fGeometryProcessor);
64 this->generateGeometry(target); 64 this->generateGeometry(target);
65 } 65 }
66 66
67 virtual Geometry* geoData(int index) = 0; 67 virtual Geometry* geoData(int index) = 0;
68 virtual const Geometry* geoData(int index) const = 0; 68 virtual const Geometry* geoData(int index) const = 0;
69 69
70 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override { 70 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override {
71 return false; 71 return false;
72 } 72 }
73 73
74 virtual void generateGeometry(Target*) const = 0; 74 virtual void generateGeometry(Target*) const = 0;
75 75
76 struct BatchTracker { 76 struct BatchTracker {
77 GrColor fColor; 77 GrColor fColor;
78 bool fUsesLocalCoords; 78 bool fUsesLocalCoords;
79 bool fColorIgnored; 79 bool fColorIgnored;
80 bool fCoverageIgnored; 80 bool fCoverageIgnored;
81 }; 81 };
82 82
83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; 83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
84 BatchTracker fBatch; 84 BatchTracker fBatch;
85 85
86 typedef GrVertexBatch INHERITED; 86 typedef GrVertexBatch INHERITED;
87 }; 87 };
88 88
89 #endif 89 #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