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; |
}; |