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

Unified Diff: src/gpu/batches/GrDrawBatch.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/GrDrawAtlasBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawBatch.h
diff --git a/src/gpu/batches/GrDrawBatch.h b/src/gpu/batches/GrDrawBatch.h
index 8ac758eca0f52c47ea57d53abdd279a9242c7f20..bbebe5b98cfeda0392abe93e8457176742b755a6 100644
--- a/src/gpu/batches/GrDrawBatch.h
+++ b/src/gpu/batches/GrDrawBatch.h
@@ -14,10 +14,32 @@
struct GrInitInvariantOutput;
/**
+ * GrDrawBatches are flushed in two phases (preDraw, and draw). In preDraw uploads to GrGpuResources
+ * and draws are determined and scheduled. They are issued in the draw phase. GrBatchToken is used
+ * to sequence the uploads relative to each other and to draws.
+ **/
+
+typedef uint64_t GrBatchToken;
+
+class GrBatchUploader : public SkRefCnt {
+public:
+ class TextureUploader;
+
+ GrBatchUploader(GrBatchToken lastUploadToken) : fLastUploadToken(lastUploadToken) {}
+ GrBatchToken lastUploadToken() const { return fLastUploadToken; }
+ virtual void upload(TextureUploader*)=0;
+
+private:
+ GrBatchToken fLastUploadToken;
+};
+
+/**
* Base class for GrBatches that draw. These batches have a GrPipeline installed by GrDrawTarget.
*/
class GrDrawBatch : public GrBatch {
public:
+ class Target;
+
GrDrawBatch();
~GrDrawBatch() override;
@@ -41,8 +63,12 @@ private:
*/
virtual void initBatchTracker(const GrPipelineOptimizations&) = 0;
- SkAlignedSTStorage<1, GrPipeline> fPipelineStorage;
- bool fPipelineInstalled;
+protected:
+ SkTArray<SkAutoTUnref<GrBatchUploader>, true> fInlineUploads;
+
+private:
+ SkAlignedSTStorage<1, GrPipeline> fPipelineStorage;
+ bool fPipelineInstalled;
typedef GrBatch INHERITED;
};
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698