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

Unified Diff: src/gpu/GrGpuCommandBuffer.cpp

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: remove errant lines Created 4 years, 6 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/GrGpuCommandBuffer.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuCommandBuffer.cpp
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f79cb0f1e61506981c0306dd73342ae642505338
--- /dev/null
+++ b/src/gpu/GrGpuCommandBuffer.cpp
@@ -0,0 +1,45 @@
+/*
+* Copyright 2016 Google Inc.
+*
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE file.
+*/
+
+#include "GrGpuCommandBuffer.h"
+
+#include "GrGpu.h"
+#include "GrPrimitiveProcessor.h"
+#include "GrRenderTarget.h"
+#include "SkRect.h"
+
+void GrGpuCommandBuffer::submit(const SkIRect& bounds) {
+ this->gpu()->handleDirtyContext();
+ this->onSubmit(bounds);
+}
+
+void GrGpuCommandBuffer::clear(const SkIRect& rect, GrColor color, GrRenderTarget* renderTarget) {
+ SkASSERT(renderTarget);
+ SkASSERT(SkIRect::MakeWH(renderTarget->width(), renderTarget->height()).contains(rect));
+ this->onClear(renderTarget, rect, color);
+}
+
+void GrGpuCommandBuffer::clearStencilClip(const SkIRect& rect,
+ bool insideClip,
+ GrRenderTarget* renderTarget) {
+ SkASSERT(renderTarget);
+ this->onClearStencilClip(renderTarget, rect, insideClip);
+}
+
+
+bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrMesh* mesh,
+ int meshCount) {
+ if (primProc.numAttribs() > this->gpu()->caps()->maxVertexAttributes()) {
+ this->gpu()->stats()->incNumFailedDraws();
+ return false;
+ }
+ this->onDraw(pipeline, primProc, mesh, meshCount);
+ return true;
+}
+
« no previous file with comments | « src/gpu/GrGpuCommandBuffer.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698