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

Side by Side Diff: src/gpu/batches/GrAAFillRectBatch.cpp

Issue 1295773003: fill rect batch refactor into separate batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 4 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 | « no previous file | src/gpu/batches/GrBWFillRectBatch.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 #include "GrAAFillRectBatch.h" 8 #include "GrAAFillRectBatch.h"
9 9
10 #include "GrColor.h" 10 #include "GrColor.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 } 181 }
182 } 182 }
183 183
184 // Common functions 184 // Common functions
185 class AAFillRectBatchBase { 185 class AAFillRectBatchBase {
186 public: 186 public:
187 static const int kVertsPerInstance = kVertsPerAAFillRect; 187 static const int kVertsPerInstance = kVertsPerAAFillRect;
188 static const int kIndicesPerInstance = kIndicesPerAAFillRect; 188 static const int kIndicesPerInstance = kIndicesPerAAFillRect;
189 189
190 inline static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) { 190 inline static const GrIndexBuffer* GetIndexBuffer(GrResourceProvider* rp) {
bsalomon 2015/08/18 20:31:03 Do these all need to be explicitly inline?
191 return get_index_buffer(rp); 191 return get_index_buffer(rp);
192 } 192 }
193
194 template <class Geometry>
195 inline static void SetBounds(const Geometry& geo, SkRect* outBounds) {
196 *outBounds = geo.fDevRect;
197 }
193 }; 198 };
194 199
195 class AAFillRectBatchNoLocalMatrixImp : public AAFillRectBatchBase { 200 class AAFillRectBatchNoLocalMatrixImp : public AAFillRectBatchBase {
196 public: 201 public:
197 struct Geometry { 202 struct Geometry {
198 SkMatrix fViewMatrix; 203 SkMatrix fViewMatrix;
199 SkRect fRect; 204 SkRect fRect;
200 SkRect fDevRect; 205 SkRect fDevRect;
201 GrColor fColor; 206 GrColor fColor;
202 }; 207 };
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { 330 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) {
326 GrColor color = GrRandomColor(random); 331 GrColor color = GrRandomColor(random);
327 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); 332 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
328 SkMatrix localMatrix = GrTest::TestMatrix(random); 333 SkMatrix localMatrix = GrTest::TestMatrix(random);
329 SkRect rect = GrTest::TestRect(random); 334 SkRect rect = GrTest::TestRect(random);
330 SkRect devRect = GrTest::TestRect(random); 335 SkRect devRect = GrTest::TestRect(random);
331 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct); 336 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct);
332 } 337 }
333 338
334 #endif 339 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/batches/GrBWFillRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698