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

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

Issue 1278043003: Move AAFillRect into CPP for templatization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more 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 | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | 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 "GrRectBatchFactory.h" 8 #include "GrRectBatchFactory.h"
9 9
10 #include "GrAAFillRectBatch.h" 10 #include "GrAAFillRectBatch.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (localMatrix) { 52 if (localMatrix) {
53 geometry.fHasLocalMatrix = true; 53 geometry.fHasLocalMatrix = true;
54 geometry.fLocalMatrix = *localMatrix; 54 geometry.fLocalMatrix = *localMatrix;
55 } else { 55 } else {
56 geometry.fHasLocalMatrix = false; 56 geometry.fHasLocalMatrix = false;
57 } 57 }
58 58
59 return GrRectBatch::Create(geometry); 59 return GrRectBatch::Create(geometry);
60 } 60 }
61 61
62 GrBatch* CreateFillAA(GrColor color,
63 const SkMatrix& viewMatrix,
64 const SkRect& rect,
65 const SkRect& devRect) {
66 GrAAFillRectBatch::Geometry geometry;
67 geometry.fRect = rect;
68 geometry.fViewMatrix = viewMatrix;
69 geometry.fDevRect = devRect;
70 geometry.fColor = color;
71
72 return GrAAFillRectBatch::Create(geometry);
73 }
74
75 GrBatch* CreateStrokeBW(GrColor color, 62 GrBatch* CreateStrokeBW(GrColor color,
76 const SkMatrix& viewMatrix, 63 const SkMatrix& viewMatrix,
77 const SkRect& rect, 64 const SkRect& rect,
78 SkScalar strokeWidth, 65 SkScalar strokeWidth,
79 bool snapToPixelCenters) { 66 bool snapToPixelCenters) {
80 GrStrokeRectBatch::Geometry geometry; 67 GrStrokeRectBatch::Geometry geometry;
81 geometry.fColor = color; 68 geometry.fColor = color;
82 geometry.fViewMatrix = viewMatrix; 69 geometry.fViewMatrix = viewMatrix;
83 geometry.fRect = rect; 70 geometry.fRect = rect;
84 geometry.fStrokeWidth = strokeWidth; 71 geometry.fStrokeWidth = strokeWidth;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 viewMatrix.mapRect(&devInside, rects[1]); 142 viewMatrix.mapRect(&devInside, rects[1]);
156 143
157 if (devInside.isEmpty()) { 144 if (devInside.isEmpty()) {
158 return CreateFillAA(color, viewMatrix, devOutside, devOutside); 145 return CreateFillAA(color, viewMatrix, devOutside, devOutside);
159 } 146 }
160 147
161 return create_stroke_aa_batch(color, viewMatrix, devOutside, devOutside, dev Inside, true); 148 return create_stroke_aa_batch(color, viewMatrix, devOutside, devOutside, dev Inside, true);
162 } 149 }
163 150
164 }; 151 };
OLDNEW
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698