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

Unified Diff: src/gpu/gl/GrGLGpuCommandBuffer.h

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/gl/GrGLGpu.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpuCommandBuffer.h
diff --git a/src/gpu/gl/GrGLGpuCommandBuffer.h b/src/gpu/gl/GrGLGpuCommandBuffer.h
index 8925322d4a3decb0384f84b6811886d4fa8661de..0591ffde3bf31eab2d25e6d1c68800e1ac49f2d5 100644
--- a/src/gpu/gl/GrGLGpuCommandBuffer.h
+++ b/src/gpu/gl/GrGLGpuCommandBuffer.h
@@ -10,21 +10,44 @@
#include "GrGpuCommandBuffer.h"
-class GrGLGpu;
+#include "GrGLGpu.h"
class GrGLGpuCommandBuffer : public GrGpuCommandBuffer {
+/**
+ * We do not actually buffer up draws or do any work in the this class for GL. Instead commands
+ * are immediately sent to the gpu to execute. Thus all the commands in this class are simply
+ * pass through functions to corresponding calls in the GrGLGpu class.
+ */
public:
- GrGLGpuCommandBuffer(GrGLGpu* gpu) /*: fGpu(gpu)*/ {}
+ GrGLGpuCommandBuffer(GrGLGpu* gpu) : fGpu(gpu) {}
virtual ~GrGLGpuCommandBuffer() {}
void end() override {}
- void submit() override {}
+ void discard(GrRenderTarget* rt) override { fGpu->discard(rt); }
private:
- // commented out to appease clang compiler warning about unused private field
- // GrGLGpu* fGpu;
+ GrGpu* gpu() override { return fGpu; }
+
+ void onSubmit(const SkIRect& bounds) override {}
+
+ void onDraw(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrMesh* mesh,
+ int meshCount) override {
+ fGpu->draw(pipeline, primProc, mesh, meshCount);
+ }
+
+ void onClear(GrRenderTarget* rt, const SkIRect& rect, GrColor color) override {
+ fGpu->clear(rect, color, rt);
+ }
+
+ void onClearStencilClip(GrRenderTarget* rt, const SkIRect& rect, bool insideClip) override {
+ fGpu->clearStencilClip(rect, insideClip, rt);
+ }
+
+ GrGLGpu* fGpu;
typedef GrGpuCommandBuffer INHERITED;
};
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/vk/GrVkCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698