Timothy Liang | e70604e | 2018-07-19 09:49:46 -0400 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrMtlGpuCommandBuffer_DEFINED |
| 9 | #define GrMtlGpuCommandBuffer_DEFINED |
| 10 | |
| 11 | #include "GrGpuCommandBuffer.h" |
| 12 | |
| 13 | class GrMtlGpu; |
| 14 | class GrMtlRenderTarget; |
| 15 | |
| 16 | class GrMtlGpuTextureCommandBuffer : public GrGpuTextureCommandBuffer { |
| 17 | public: |
| 18 | GrMtlGpuTextureCommandBuffer(GrMtlGpu* gpu, GrTexture* texture, GrSurfaceOrigin origin) |
| 19 | : INHERITED(texture, origin) |
| 20 | , fGpu(gpu) { |
| 21 | // Silence unused var warning |
| 22 | (void)fGpu; |
| 23 | } |
| 24 | |
| 25 | ~GrMtlGpuTextureCommandBuffer() override {} |
| 26 | |
| 27 | void copy(GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, |
| 28 | const SkIPoint& dstPoint) override {} |
| 29 | |
| 30 | void insertEventMarker(const char* msg) override {} |
| 31 | |
| 32 | private: |
| 33 | void submit() override {} |
| 34 | |
| 35 | GrMtlGpu* fGpu; |
| 36 | |
| 37 | typedef GrGpuTextureCommandBuffer INHERITED; |
| 38 | }; |
| 39 | |
| 40 | class GrMtlGpuRTCommandBuffer : public GrGpuRTCommandBuffer { |
| 41 | public: |
| 42 | GrMtlGpuRTCommandBuffer(GrMtlGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin, |
| 43 | const GrGpuRTCommandBuffer::LoadAndStoreInfo& colorInfo, |
| 44 | const GrGpuRTCommandBuffer::StencilLoadAndStoreInfo& stencilInfo) |
| 45 | : INHERITED(rt, origin) |
| 46 | , fGpu(gpu) |
| 47 | , fColorLoadAndStoreInfo(colorInfo) |
| 48 | , fStencilLoadAndStoreInfo(stencilInfo) { |
| 49 | // Silence unused var warning |
| 50 | (void)fColorLoadAndStoreInfo; |
| 51 | (void)fStencilLoadAndStoreInfo; |
| 52 | } |
| 53 | |
| 54 | ~GrMtlGpuRTCommandBuffer() override {} |
| 55 | |
| 56 | void begin() override {} |
| 57 | void end() override {} |
| 58 | |
| 59 | void discard() override {} |
| 60 | |
| 61 | void insertEventMarker(const char* msg) override {} |
| 62 | |
| 63 | void inlineUpload(GrOpFlushState* state, GrDeferredTextureUploadFn& upload) override {} |
| 64 | |
| 65 | void copy(GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, |
| 66 | const SkIPoint& dstPoint) override {} |
| 67 | |
| 68 | void submit() override {} |
| 69 | |
| 70 | private: |
| 71 | GrGpu* gpu() override { return fGpu; } |
| 72 | |
| 73 | void onDraw(const GrPrimitiveProcessor& primProc, |
| 74 | const GrPipeline& pipeline, |
| 75 | const GrPipeline::FixedDynamicState* fixedDynamicState, |
| 76 | const GrPipeline::DynamicStateArrays* dynamicStateArrays, |
| 77 | const GrMesh mesh[], |
| 78 | int meshCount, |
| 79 | const SkRect& bounds) override {} |
| 80 | |
| 81 | void onClear(const GrFixedClip& clip, GrColor color) override {} |
| 82 | |
| 83 | void onClearStencilClip(const GrFixedClip& clip, bool insideStencilMask) override {} |
| 84 | |
| 85 | GrMtlGpu* fGpu; |
| 86 | GrGpuRTCommandBuffer::LoadAndStoreInfo fColorLoadAndStoreInfo; |
| 87 | GrGpuRTCommandBuffer::StencilLoadAndStoreInfo fStencilLoadAndStoreInfo; |
| 88 | |
| 89 | typedef GrGpuRTCommandBuffer INHERITED; |
| 90 | }; |
| 91 | |
| 92 | #endif |
| 93 | |