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

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

Issue 1286043004: Make GrVertexBatch objects hold their own draws during GrDrawTarget flush (Closed) Base URL: https://skia.googlesource.com/skia.git@m
Patch Set: forward decl 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/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTestBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStrokeRectBatch.cpp
diff --git a/src/gpu/batches/GrStrokeRectBatch.cpp b/src/gpu/batches/GrStrokeRectBatch.cpp
index 649ba01ddda8d2811abcf7993fac62b2e63f9fe0..766302bf5b5b251b52a0163b2a224099ec432a67 100644
--- a/src/gpu/batches/GrStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrStrokeRectBatch.cpp
@@ -7,6 +7,7 @@
#include "GrStrokeRectBatch.h"
#include "GrBatchTest.h"
+#include "GrBatchFlushState.h"
#include "SkRandom.h"
GrStrokeRectBatch::GrStrokeRectBatch(const Geometry& geometry, bool snapToPixelCenters) {
@@ -65,8 +66,7 @@ static void init_stroke_rect_strip(SkPoint verts[10], const SkRect& rect, SkScal
verts[9] = verts[1];
}
-
-void GrStrokeRectBatch::generateGeometry(GrBatchTarget* batchTarget) {
+void GrStrokeRectBatch::onPrepareDraws(Target* target) {
SkAutoTUnref<const GrGeometryProcessor> gp;
{
using namespace GrDefaultGeoProcFactory;
@@ -79,7 +79,7 @@ void GrStrokeRectBatch::generateGeometry(GrBatchTarget* batchTarget) {
this->viewMatrix()));
}
- batchTarget->initDraw(gp, this->pipeline());
+ target->initDraw(gp, this->pipeline());
size_t vertexStride = gp->getVertexStride();
@@ -95,8 +95,7 @@ void GrStrokeRectBatch::generateGeometry(GrBatchTarget* batchTarget) {
const GrVertexBuffer* vertexBuffer;
int firstVertex;
- void* verts = batchTarget->makeVertSpace(vertexStride, vertexCount,
- &vertexBuffer, &firstVertex);
+ void* verts = target->makeVertexSpace(vertexStride, vertexCount, &vertexBuffer, &firstVertex);
if (!verts) {
SkDebugf("Could not allocate vertices\n");
@@ -123,7 +122,7 @@ void GrStrokeRectBatch::generateGeometry(GrBatchTarget* batchTarget) {
GrVertices vertices;
vertices.init(primType, vertexBuffer, firstVertex, vertexCount);
- batchTarget->draw(vertices);
+ target->draw(vertices);
}
#ifdef GR_TEST_UTILS
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.h ('k') | src/gpu/batches/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698