| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrImmediateDrawTarget_DEFINED | 8 #ifndef GrImmediateDrawTarget_DEFINED |
| 9 #define GrImmediateDrawTarget_DEFINED | 9 #define GrImmediateDrawTarget_DEFINED |
| 10 | 10 |
| 11 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
| 12 | 12 |
| 13 #include "GrBatchTarget.h" | 13 #include "GrBatchTarget.h" |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * A debug GrDrawTarget which immediately flushes every command it receives | 16 * A debug GrDrawTarget which immediately flushes every command it receives |
| 17 */ | 17 */ |
| 18 class GrImmediateDrawTarget : public GrClipTarget { | 18 class GrImmediateDrawTarget : public GrClipTarget { |
| 19 public: | 19 public: |
| 20 | |
| 21 /** | 20 /** |
| 22 * Creates a GrImmediateDrawTarget | 21 * Creates a GrImmediateDrawTarget |
| 23 * | 22 * |
| 24 * @param context the context object that owns this draw buffer. | 23 * @param context the context object that owns this draw buffer. |
| 25 */ | 24 */ |
| 26 GrImmediateDrawTarget(GrContext* context); | 25 GrImmediateDrawTarget(GrContext* context); |
| 27 | 26 |
| 28 ~GrImmediateDrawTarget() override; | 27 ~GrImmediateDrawTarget() override; |
| 29 | 28 |
| 30 void clearStencilClip(const SkIRect& rect, | 29 void clearStencilClip(const SkIRect& rect, |
| 31 bool insideClip, | 30 bool insideClip, |
| 32 GrRenderTarget* renderTarget) override; | 31 GrRenderTarget* renderTarget) override; |
| 33 | 32 |
| 34 void discard(GrRenderTarget*) override; | 33 void discard(GrRenderTarget*) override; |
| 35 | 34 |
| 36 private: | 35 private: |
| 37 void onReset() override; | 36 void onReset() override; |
| 38 void onFlush() override; | 37 void onFlush() override; |
| 39 | 38 |
| 40 // overrides from GrDrawTarget | 39 // overrides from GrDrawTarget |
| 41 void onDrawBatch(GrBatch*, const PipelineInfo&) override; | 40 void onDrawBatch(GrBatch*) override; |
| 42 void onStencilPath(const GrPipelineBuilder&, | 41 void onStencilPath(const GrPipelineBuilder&, |
| 43 const GrPathProcessor*, | 42 const GrPathProcessor*, |
| 44 const GrPath*, | 43 const GrPath*, |
| 45 const GrScissorState&, | 44 const GrScissorState&, |
| 46 const GrStencilSettings&) override { | 45 const GrStencilSettings&) override { |
| 47 SkFAIL("Only batch implemented\n"); | 46 SkFAIL("Only batch implemented\n"); |
| 48 } | 47 } |
| 49 void onDrawPath(const GrPathProcessor*, | 48 void onDrawPath(const GrPathProcessor*, |
| 50 const GrPath*, | 49 const GrPath*, |
| 51 const GrStencilSettings&, | 50 const GrStencilSettings&, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 void onClear(const SkIRect& rect, | 65 void onClear(const SkIRect& rect, |
| 67 GrColor color, | 66 GrColor color, |
| 68 GrRenderTarget* renderTarget) override; | 67 GrRenderTarget* renderTarget) override; |
| 69 void onCopySurface(GrSurface* dst, | 68 void onCopySurface(GrSurface* dst, |
| 70 GrSurface* src, | 69 GrSurface* src, |
| 71 const SkIRect& srcRect, | 70 const SkIRect& srcRect, |
| 72 const SkIPoint& dstPoint) override; | 71 const SkIPoint& dstPoint) override; |
| 73 | 72 |
| 74 bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } | 73 bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } |
| 75 | 74 |
| 76 bool SK_WARN_UNUSED_RESULT setupPipelineAndShouldDraw(void* pipelineAddr, | |
| 77 const GrDrawTarget::Pi
pelineInfo&, | |
| 78 GrPipelineOptimization
s* opts); | |
| 79 | |
| 80 void recordXferBarrierIfNecessary(const GrPipeline*); | |
| 81 | |
| 82 GrBatchTarget fBatchTarget; | 75 GrBatchTarget fBatchTarget; |
| 83 uint32_t fDrawID; | 76 uint32_t fDrawID; |
| 84 | 77 |
| 85 typedef GrClipTarget INHERITED; | 78 typedef GrClipTarget INHERITED; |
| 86 }; | 79 }; |
| 87 | 80 |
| 88 #endif | 81 #endif |
| OLD | NEW |