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

Unified Diff: src/gpu/batches/GrRectBatchFactory.cpp

Issue 1282283002: Move GrStrokeRectBatch creation to behind factory (Closed) Base URL: https://skia.googlesource.com/skia.git@batchfactory2
Patch Set: feedback inc 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrRectBatchFactory.cpp
diff --git a/src/gpu/batches/GrRectBatchFactory.cpp b/src/gpu/batches/GrRectBatchFactory.cpp
index b41561209e1c19239d4f35a37aa7df34dc6bba82..e2597d2a66e2bfcc16cdd4fba59e529168b34abf 100644
--- a/src/gpu/batches/GrRectBatchFactory.cpp
+++ b/src/gpu/batches/GrRectBatchFactory.cpp
@@ -8,14 +8,15 @@
#include "GrRectBatchFactory.h"
#include "GrRectBatch.h"
+#include "GrStrokeRectBatch.h"
namespace GrRectBatchFactory {
-GrBatch* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
+GrBatch* CreateFillBW(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
GrRectBatch::Geometry geometry;
geometry.fColor = color;
geometry.fViewMatrix = viewMatrix;
@@ -38,4 +39,17 @@ GrBatch* Create(GrColor color,
return GrRectBatch::Create(geometry);
}
+GrBatch* CreateStrokeBW(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ SkScalar strokeWidth,
+ bool snapToPixelCenters) {
+ GrStrokeRectBatch::Geometry geometry;
+ geometry.fColor = color;
+ geometry.fViewMatrix = viewMatrix;
+ geometry.fRect = rect;
+ geometry.fStrokeWidth = strokeWidth;
+ return GrStrokeRectBatch::Create(geometry, snapToPixelCenters);
+}
+
};
« 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