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

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

Issue 1296483002: Split GrDrawBatch and GrVertexBatch into their own files (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add new files to git 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.h ('k') | src/gpu/batches/GrDrawBatch.cpp » ('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
new file mode 100644
index 0000000000000000000000000000000000000000..8ac758eca0f52c47ea57d53abdd279a9242c7f20
--- /dev/null
+++ b/src/gpu/batches/GrDrawBatch.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDrawBatch_DEFINED
+#define GrDrawBatch_DEFINED
+
+#include "GrBatch.h"
+#include "GrPipeline.h"
+
+struct GrInitInvariantOutput;
+
+/**
+ * Base class for GrBatches that draw. These batches have a GrPipeline installed by GrDrawTarget.
+ */
+class GrDrawBatch : public GrBatch {
+public:
+ GrDrawBatch();
+ ~GrDrawBatch() override;
+
+ virtual void getInvariantOutputColor(GrInitInvariantOutput* out) const = 0;
+ virtual void getInvariantOutputCoverage(GrInitInvariantOutput* out) const = 0;
+
+ const GrPipeline* pipeline() const {
+ SkASSERT(fPipelineInstalled);
+ return reinterpret_cast<const GrPipeline*>(fPipelineStorage.get());
+ }
+
+ bool installPipeline(const GrPipeline::CreateArgs&);
+
+ // TODO no GrPrimitiveProcessors yet read fragment position
+ bool willReadFragmentPosition() const { return false; }
+
+private:
+ /**
+ * initBatchTracker is a hook for the some additional overrides / optimization possibilities
+ * from the GrXferProcessor.
+ */
+ virtual void initBatchTracker(const GrPipelineOptimizations&) = 0;
+
+ SkAlignedSTStorage<1, GrPipeline> fPipelineStorage;
+ bool fPipelineInstalled;
+ typedef GrBatch INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698