OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrGLGpuCommandBuffer_DEFINED | 8 #ifndef GrGLGpuCommandBuffer_DEFINED |
9 #define GrGLGpuCommandBuffer_DEFINED | 9 #define GrGLGpuCommandBuffer_DEFINED |
10 | 10 |
11 #include "GrGpuCommandBuffer.h" | 11 #include "GrGpuCommandBuffer.h" |
12 | 12 |
13 class GrGLGpu; | 13 #include "GrGLGpu.h" |
14 | 14 |
15 class GrGLGpuCommandBuffer : public GrGpuCommandBuffer { | 15 class GrGLGpuCommandBuffer : public GrGpuCommandBuffer { |
bsalomon
2016/06/20 16:51:14
Comment that this is a passthrough back to the GL
egdaniel
2016/06/22 15:26:57
Done.
| |
16 public: | 16 public: |
17 GrGLGpuCommandBuffer(GrGLGpu* gpu) /*: fGpu(gpu)*/ {} | 17 GrGLGpuCommandBuffer(GrGLGpu* gpu) : fGpu(gpu) {} |
18 | 18 |
19 virtual ~GrGLGpuCommandBuffer() {} | 19 virtual ~GrGLGpuCommandBuffer() {} |
20 | 20 |
21 void end() override {} | 21 void end() override {} |
22 | 22 |
23 void submit() override {} | 23 void discard(GrRenderTarget* rt) override { fGpu->discard(rt); } |
24 | 24 |
25 private: | 25 private: |
26 // commented out to appease clang compiler warning about unused private fiel d | 26 GrGpu* gpu() override { return fGpu; } |
27 // GrGLGpu* fGpu; | 27 |
28 void onSubmit(const SkIRect& bounds) override {} | |
29 | |
30 void onDraw(const GrPipeline& pipeline, | |
31 const GrPrimitiveProcessor& primProc, | |
32 const GrMesh* mesh, | |
33 int meshCount) override { | |
34 fGpu->draw(pipeline, primProc, mesh, meshCount); | |
35 } | |
36 | |
37 void onClear(GrRenderTarget* rt, const SkIRect& rect, GrColor color) overrid e { | |
38 fGpu->clear(rect, color, rt); | |
39 } | |
40 | |
41 void onClearStencilClip(GrRenderTarget* rt, const SkIRect& rect, bool inside Clip) override { | |
42 fGpu->clearStencilClip(rect, insideClip, rt); | |
43 } | |
44 | |
45 GrGLGpu* fGpu; | |
28 | 46 |
29 typedef GrGpuCommandBuffer INHERITED; | 47 typedef GrGpuCommandBuffer INHERITED; |
30 }; | 48 }; |
31 | 49 |
32 #endif | 50 #endif |
33 | 51 |
OLD | NEW |