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

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

Issue 1457373003: Add more batch information printouts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/GrAtlasTextContext.cpp ('k') | src/gpu/batches/GrNinePatch.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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 public: 210 public:
211 struct Geometry { 211 struct Geometry {
212 SkMatrix fViewMatrix; 212 SkMatrix fViewMatrix;
213 SkRect fRect; 213 SkRect fRect;
214 SkRect fDevRect; 214 SkRect fDevRect;
215 GrColor fColor; 215 GrColor fColor;
216 }; 216 };
217 217
218 static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; } 218 static const char* Name() { return "AAFillRectBatchNoLocalMatrix"; }
219 219
220 static SkString DumpInfo(const Geometry& geo) { 220 static SkString DumpInfo(const Geometry& geo, int index) {
221 SkString str; 221 SkString str;
222 str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n" , 222 str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f ]\n",
223 index,
223 geo.fColor, 224 geo.fColor,
224 geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect .fBottom); 225 geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect .fBottom);
225 return str; 226 return str;
226 } 227 }
227 228
228 static bool CanCombine(const Geometry& mine, const Geometry& theirs, 229 static bool CanCombine(const Geometry& mine, const Geometry& theirs,
229 const GrPipelineOptimizations& opts) { 230 const GrPipelineOptimizations& opts) {
230 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses 231 // We apply the viewmatrix to the rect points on the cpu. However, if t he pipeline uses
231 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix 232 // local coords then we won't be able to batch. We could actually uploa d the viewmatrix
232 // using vertex attributes in these cases, but haven't investigated that 233 // using vertex attributes in these cases, but haven't investigated that
(...skipping 26 matching lines...) Expand all
259 struct Geometry { 260 struct Geometry {
260 SkMatrix fViewMatrix; 261 SkMatrix fViewMatrix;
261 SkMatrix fLocalMatrix; 262 SkMatrix fLocalMatrix;
262 SkRect fRect; 263 SkRect fRect;
263 SkRect fDevRect; 264 SkRect fDevRect;
264 GrColor fColor; 265 GrColor fColor;
265 }; 266 };
266 267
267 static const char* Name() { return "AAFillRectBatchLocalMatrix"; } 268 static const char* Name() { return "AAFillRectBatchLocalMatrix"; }
268 269
269 static SkString DumpInfo(const Geometry& geo) { 270 static SkString DumpInfo(const Geometry& geo, int index) {
270 SkString str; 271 SkString str;
271 str.appendf("Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f]\n" , 272 str.appendf("%d: Color: 0x%08x, Rect [L: %.2f, T: %.2f, R: %.2f, B: %.2f ]\n",
273 index,
272 geo.fColor, 274 geo.fColor,
273 geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect .fBottom); 275 geo.fRect.fLeft, geo.fRect.fTop, geo.fRect.fRight, geo.fRect .fBottom);
274 return str; 276 return str;
275 } 277 }
276 278
277 static bool CanCombine(const Geometry& mine, const Geometry& theirs, 279 static bool CanCombine(const Geometry& mine, const Geometry& theirs,
278 const GrPipelineOptimizations&) { 280 const GrPipelineOptimizations&) {
279 return true; 281 return true;
280 } 282 }
281 283
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) { 412 DRAW_BATCH_TEST_DEFINE(AAFillRectBatchLocalMatrix) {
411 GrColor color = GrRandomColor(random); 413 GrColor color = GrRandomColor(random);
412 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); 414 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random);
413 SkMatrix localMatrix = GrTest::TestMatrix(random); 415 SkMatrix localMatrix = GrTest::TestMatrix(random);
414 SkRect rect = GrTest::TestRect(random); 416 SkRect rect = GrTest::TestRect(random);
415 SkRect devRect = GrTest::TestRect(random); 417 SkRect devRect = GrTest::TestRect(random);
416 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct); 418 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe ct);
417 } 419 }
418 420
419 #endif 421 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/batches/GrNinePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698