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

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

Issue 1355353002: Create GrDraw and start fast pathing src over rects (Closed) Base URL: https://skia.googlesource.com/skia.git@strokerect2
Patch Set: tweaks Created 5 years, 2 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/GrRectBatchFactory.h ('k') | src/gpu/draws/GrDraw.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 GrTInstanceBatch_DEFINED 8 #ifndef GrTInstanceBatch_DEFINED
9 #define GrTInstanceBatch_DEFINED 9 #define GrTInstanceBatch_DEFINED
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void init() { 70 void init() {
71 const Geometry& geo = fGeoData[0]; 71 const Geometry& geo = fGeoData[0];
72 Impl::SetBounds(geo, &fBounds); 72 Impl::SetBounds(geo, &fBounds);
73 } 73 }
74 74
75 void updateBoundsAfterAppend() { 75 void updateBoundsAfterAppend() {
76 const Geometry& geo = fGeoData.back(); 76 const Geometry& geo = fGeoData.back();
77 Impl::UpdateBoundsAfterAppend(geo, &fBounds); 77 Impl::UpdateBoundsAfterAppend(geo, &fBounds);
78 } 78 }
79 79
80 bool appendIfPossible(const Geometry& geo) {
81 const Geometry& mine = fGeoData.back();
82 if (Impl::CanCombine(mine, geo, fOpts)) {
83 fGeoData.push_back(geo);
84 this->updateBoundsAfterAppend();
85 return true;
86 } else {
87 return false;
88 }
89
90 }
91
80 private: 92 private:
81 GrTInstanceBatch() : INHERITED(ClassID()) {} 93 GrTInstanceBatch() : INHERITED(ClassID()) {}
82 94
83 void onPrepareDraws(Target* target) override { 95 void onPrepareDraws(Target* target) override {
84 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom etry(), fOpts)); 96 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom etry(), fOpts));
85 if (!gp) { 97 if (!gp) {
86 SkDebugf("Couldn't create GrGeometryProcessor\n"); 98 SkDebugf("Couldn't create GrGeometryProcessor\n");
87 return; 99 return;
88 } 100 }
89 101
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return true; 147 return true;
136 } 148 }
137 149
138 GrPipelineOptimizations fOpts; 150 GrPipelineOptimizations fOpts;
139 SkSTArray<1, Geometry, true> fGeoData; 151 SkSTArray<1, Geometry, true> fGeoData;
140 152
141 typedef GrVertexBatch INHERITED; 153 typedef GrVertexBatch INHERITED;
142 }; 154 };
143 155
144 #endif 156 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | src/gpu/draws/GrDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698