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

Unified Diff: src/gpu/GrDrawContext.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 | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index c67f6f48bff07d0057921eccf9dfbe51e6781253..f86e7834f0dc06bec6bda1ccfab5879fa71189dc 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -20,7 +20,7 @@
#include "batches/GrBatch.h"
#include "batches/GrDrawAtlasBatch.h"
#include "batches/GrDrawVerticesBatch.h"
-#include "batches/GrStrokeRectBatch.h"
+#include "batches/GrRectBatchFactory.h"
#include "SkGr.h"
#include "SkRSXform.h"
@@ -329,15 +329,10 @@ void GrDrawContext::drawRect(GrRenderTarget* rt,
}
if (width >= 0) {
- GrStrokeRectBatch::Geometry geometry;
- geometry.fViewMatrix = viewMatrix;
- geometry.fColor = color;
- geometry.fRect = rect;
- geometry.fStrokeWidth = width;
-
// Non-AA hairlines are snapped to pixel centers to make which pixels are hit deterministic
bool snapToPixelCenters = (0 == width && !rt->isUnifiedMultisampled());
- SkAutoTUnref<GrBatch> batch(GrStrokeRectBatch::Create(geometry, snapToPixelCenters));
+ SkAutoTUnref<GrBatch> batch(GrRectBatchFactory::CreateStrokeBW(color, viewMatrix, rect,
+ width, snapToPixelCenters));
// Depending on sub-pixel coordinates and the particular GPU, we may lose a corner of
// hairline rects. We jam all the vertices to pixel centers to avoid this, but not when MSAA
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698