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

Side by Side Diff: src/gpu/GrRectBatch.cpp

Issue 1111603004: removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: tweaks Created 5 years, 7 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/GrOvalRenderer.cpp ('k') | src/gpu/GrTestBatch.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 #include "GrRectBatch.h" 8 #include "GrRectBatch.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 13 matching lines...) Expand all
24 24
25 The vertex attrib order is always pos, color, [local coords]. 25 The vertex attrib order is always pos, color, [local coords].
26 */ 26 */
27 static const GrGeometryProcessor* create_rect_gp(bool hasExplicitLocalCoords, 27 static const GrGeometryProcessor* create_rect_gp(bool hasExplicitLocalCoords,
28 GrColor color, 28 GrColor color,
29 const SkMatrix* localMatrix) { 29 const SkMatrix* localMatrix) {
30 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType | 30 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType |
31 GrDefaultGeoProcFactory::kColor_GPType; 31 GrDefaultGeoProcFactory::kColor_GPType;
32 flags |= hasExplicitLocalCoords ? GrDefaultGeoProcFactory::kLocalCoord_GPTyp e : 0; 32 flags |= hasExplicitLocalCoords ? GrDefaultGeoProcFactory::kLocalCoord_GPTyp e : 0;
33 if (localMatrix) { 33 if (localMatrix) {
34 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), *loc alMatrix, 34 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), *loc alMatrix);
35 GrColorIsOpaque(color));
36 } else { 35 } else {
37 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), SkMa trix::I(), 36 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), SkMa trix::I());
38 GrColorIsOpaque(color));
39 } 37 }
40 } 38 }
41 39
42 class RectBatch : public GrBatch { 40 class RectBatch : public GrBatch {
43 public: 41 public:
44 struct Geometry { 42 struct Geometry {
45 SkMatrix fViewMatrix; 43 SkMatrix fViewMatrix;
46 SkRect fRect; 44 SkRect fRect;
47 SkRect fLocalRect; 45 SkRect fLocalRect;
48 SkMatrix fLocalMatrix; 46 SkMatrix fLocalMatrix;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (hasLocalMatrix) { 273 if (hasLocalMatrix) {
276 localMatrix = GrTest::TestMatrix(random); 274 localMatrix = GrTest::TestMatrix(random);
277 } 275 }
278 276
279 return GrRectBatch::Create(color, viewMatrix, rect, 277 return GrRectBatch::Create(color, viewMatrix, rect,
280 hasLocalRect ? &localRect : NULL, 278 hasLocalRect ? &localRect : NULL,
281 hasLocalMatrix ? &localMatrix : NULL); 279 hasLocalMatrix ? &localMatrix : NULL);
282 } 280 }
283 281
284 #endif 282 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698