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

Unified Diff: src/gpu/GrImmediateDrawTarget.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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/GrImmediateDrawTarget.h ('k') | src/gpu/GrInOrderCommandBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImmediateDrawTarget.cpp
diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5741fefc99c3de5763197900c48e4158c0dbbf4b
--- /dev/null
+++ b/src/gpu/GrImmediateDrawTarget.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrImmediateDrawTarget.h"
+
+#include "GrGpu.h"
+#include "GrPipeline.h"
+#include "GrRenderTarget.h"
+#include "SkRect.h"
+#include "SkTypes.h"
+
+#include "batches/GrDrawBatch.h"
+#include "batches/GrVertexBatch.h"
+
+GrImmediateDrawTarget::GrImmediateDrawTarget(GrDrawContext* dc, GrRenderTarget* rt, GrContext* context)
+ : INHERITED(dc, rt, context)
+// , fBatchTarget(context->foo(), this->getGpu(), rt)
+ , fDrawID(0) {
+}
+
+GrImmediateDrawTarget::~GrImmediateDrawTarget() {
+ this->reset();
+}
+
+void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch) {
+
+#if 0
+ // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so that we can
+ // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch.
+ GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(batch);
+ vertexBatch->prepareDraws(&fBatchTarget);
+ vertexBatch->setNumberOfDraws(fBatchTarget.numberOfDraws());
+
+ fBatchTarget.preFlush();
+ fBatchTarget.flushNext(vertexBatch->numberOfDraws());
+ fBatchTarget.postFlush();
+#endif
+}
+
+void GrImmediateDrawTarget::onReset() {}
+
+void GrImmediateDrawTarget::onFlush() {
+ ++fDrawID;
+}
« no previous file with comments | « src/gpu/GrImmediateDrawTarget.h ('k') | src/gpu/GrInOrderCommandBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698