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

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

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/GrDrawBatch.h ('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.cpp
diff --git a/src/gpu/batches/GrDrawBatch.cpp b/src/gpu/batches/GrDrawBatch.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5e5d41247ab356daf9b22117f1625dc99ccbcd6e
--- /dev/null
+++ b/src/gpu/batches/GrDrawBatch.cpp
@@ -0,0 +1,27 @@
+/*
+ * 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 "GrDrawBatch.h"
+
+GrDrawBatch::GrDrawBatch() : fPipelineInstalled(false) { }
+
+GrDrawBatch::~GrDrawBatch() {
+ if (fPipelineInstalled) {
+ this->pipeline()->~GrPipeline();
+ }
+}
+
+bool GrDrawBatch::installPipeline(const GrPipeline::CreateArgs& args) {
+ GrPipelineOptimizations opts;
+ void* location = fPipelineStorage.get();
+ if (!GrPipeline::CreateAt(location, args, &opts)) {
+ return false;
+ }
+ this->initBatchTracker(opts);
+ fPipelineInstalled = true;
+ return true;
+}
« no previous file with comments | « src/gpu/batches/GrDrawBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698