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

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

Issue 1353683003: Move StrokeRectBatches into .cpp files (Closed) Base URL: https://skia.googlesource.com/skia.git@statics
Patch Set: tweaks Created 5 years, 3 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/GrNonAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrRectBatchFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrRectBatchFactory.h
diff --git a/src/gpu/batches/GrRectBatchFactory.h b/src/gpu/batches/GrRectBatchFactory.h
index 3de8c020f25ab31ed0eb0ab6b906b14a3ab59956..fbbc66acbcc345fb704bd660cb3068d43e51991b 100644
--- a/src/gpu/batches/GrRectBatchFactory.h
+++ b/src/gpu/batches/GrRectBatchFactory.h
@@ -11,9 +11,10 @@
#include "GrAAFillRectBatch.h"
#include "GrColor.h"
#include "GrNonAAFillRectBatch.h"
+#include "GrNonAAStrokeRectBatch.h"
+#include "SkMatrix.h"
class GrBatch;
-class SkMatrix;
struct SkRect;
class SkStrokeRec;
@@ -27,7 +28,12 @@ inline GrDrawBatch* CreateNonAAFill(GrColor color,
const SkRect& rect,
const SkRect* localRect,
const SkMatrix* localMatrix) {
- return GrNonAAFillRectBatch::Create(color, viewMatrix, rect, localRect, localMatrix);
+ if (viewMatrix.hasPerspective() || (localMatrix && localMatrix->hasPerspective())) {
+ return GrNonAAFillRectBatch::CreateWithPerspective(color, viewMatrix, rect, localRect,
+ localMatrix);
+ } else {
+ return GrNonAAFillRectBatch::Create(color, viewMatrix, rect, localRect, localMatrix);
+ }
}
inline GrDrawBatch* CreateAAFill(GrColor color,
@@ -45,11 +51,13 @@ inline GrDrawBatch* CreateAAFill(GrColor color,
return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRect);
}
-GrDrawBatch* CreateNonAAStroke(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- SkScalar strokeWidth,
- bool snapToPixelCenters);
+inline GrDrawBatch* CreateNonAAStroke(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ SkScalar strokeWidth,
+ bool snapToPixelCenters) {
+ return GrNonAAStrokeRectBatch::Create(color, viewMatrix, rect, strokeWidth, snapToPixelCenters);
+}
GrDrawBatch* CreateAAStroke(GrColor,
const SkMatrix& viewMatrix,
« no previous file with comments | « src/gpu/batches/GrNonAAStrokeRectBatch.cpp ('k') | src/gpu/batches/GrRectBatchFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698