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

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

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.cpp ('k') | src/gpu/batches/GrVertexBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrTestBatch.h
diff --git a/src/gpu/batches/GrTestBatch.h b/src/gpu/batches/GrTestBatch.h
index f72ea6143d2040fdb6b04c21ac969e24fa32b400..085b184a28639e917d4d86c22aad486bbea644a8 100644
--- a/src/gpu/batches/GrTestBatch.h
+++ b/src/gpu/batches/GrTestBatch.h
@@ -8,7 +8,7 @@
#ifndef GrTestBatch_DEFINED
#define GrTestBatch_DEFINED
-#include "GrBatchTarget.h"
+#include "GrBatchFlushState.h"
#include "GrGeometryProcessor.h"
#include "GrVertexBuffer.h"
@@ -49,12 +49,6 @@ public:
fBatch.fCoverageIgnored = !opt.readsCoverage();
}
- void generateGeometry(GrBatchTarget* batchTarget) override {
- batchTarget->initDraw(fGeometryProcessor, this->pipeline());
-
- this->onGenerateGeometry(batchTarget);
- }
-
protected:
GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
fGeometryProcessor.reset(SkRef(gp));
@@ -65,6 +59,11 @@ protected:
const GrGeometryProcessor* geometryProcessor() const { return fGeometryProcessor; }
private:
+ void onPrepareDraws(Target* target) override {
+ target->initDraw(fGeometryProcessor, this->pipeline());
+ this->generateGeometry(target);
+ }
+
virtual Geometry* geoData(int index) = 0;
virtual const Geometry* geoData(int index) const = 0;
@@ -72,7 +71,7 @@ private:
return false;
}
- virtual void onGenerateGeometry(GrBatchTarget* batchTarget) = 0;
+ virtual void generateGeometry(Target*) = 0;
struct BatchTracker {
GrColor fColor;
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.cpp ('k') | src/gpu/batches/GrVertexBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698