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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawTarget.h » ('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 c4716196b9c266c8a91c99d3fef08639e34814f7..303361114655bf9fdfdfe590b3ce212be35dd1a5 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -304,7 +304,7 @@ void GrDrawContext::drawRect(GrRenderTarget* rt,
width, viewMatrix, color);
if (doAA) {
- SkAutoTUnref<GrBatch> batch;
+ SkAutoTUnref<GrDrawBatch> batch;
if (width >= 0) {
batch.reset(GrRectBatchFactory::CreateStrokeAA(color, viewMatrix, rect, devBoundRect,
*strokeInfo));
@@ -318,8 +318,8 @@ void GrDrawContext::drawRect(GrRenderTarget* rt,
if (width >= 0) {
// Non-AA hairlines are snapped to pixel centers to make which pixels are hit deterministic
bool snapToPixelCenters = (0 == width && !rt->isUnifiedMultisampled());
- SkAutoTUnref<GrBatch> batch(GrRectBatchFactory::CreateStrokeBW(color, viewMatrix, rect,
- width, snapToPixelCenters));
+ SkAutoTUnref<GrDrawBatch> 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
@@ -391,10 +391,10 @@ void GrDrawContext::drawVertices(GrRenderTarget* rt,
GrDrawVerticesBatch::Geometry geometry;
geometry.fColor = paint.getColor();
- SkAutoTUnref<GrBatch> batch(GrDrawVerticesBatch::Create(geometry, primitiveType, viewMatrix,
- positions, vertexCount, indices,
- indexCount, colors, texCoords,
- bounds));
+ SkAutoTUnref<GrDrawBatch> batch(GrDrawVerticesBatch::Create(geometry, primitiveType, viewMatrix,
+ positions, vertexCount, indices,
+ indexCount, colors, texCoords,
+ bounds));
fDrawTarget->drawBatch(pipelineBuilder, batch);
}
@@ -419,8 +419,8 @@ void GrDrawContext::drawAtlas(GrRenderTarget* rt,
GrDrawAtlasBatch::Geometry geometry;
geometry.fColor = paint.getColor();
- SkAutoTUnref<GrBatch> batch(GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount,
- xform, texRect, colors));
+ SkAutoTUnref<GrDrawBatch> batch(GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount,
+ xform, texRect, colors));
fDrawTarget->drawBatch(pipelineBuilder, batch);
}
@@ -601,7 +601,7 @@ static bool is_nested_rects(const SkMatrix& viewMatrix,
}
void GrDrawContext::drawBatch(GrRenderTarget* rt, const GrClip& clip,
- const GrPaint& paint, GrBatch* batch) {
+ const GrPaint& paint, GrDrawBatch* batch) {
RETURN_IF_ABANDONED
AutoCheckFlush acf(fContext);
@@ -649,9 +649,8 @@ void GrDrawContext::drawPath(GrRenderTarget* rt,
SkRect rects[2];
if (is_nested_rects(viewMatrix, path, strokeInfo, rects)) {
- SkAutoTUnref<GrBatch> batch(GrRectBatchFactory::CreateFillNestedRectsAA(color,
- viewMatrix,
- rects));
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillNestedRectsAA(
+ color, viewMatrix, rects));
fDrawTarget->drawBatch(pipelineBuilder, batch);
return;
}
@@ -772,6 +771,6 @@ bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) {
return true;
}
-void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch) {
+void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch) {
fDrawTarget->drawBatch(*pipelineBuilder, batch);
}
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698