OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 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 GrImmediateDrawTarget_DEFINED |
| 9 #define GrImmediateDrawTarget_DEFINED |
| 10 |
| 11 #include "GrDrawTarget.h" |
| 12 |
| 13 #include "GrBatchTarget.h" |
| 14 |
| 15 /** |
| 16 * A debug GrDrawTarget which immediately flushes every command it receives |
| 17 */ |
| 18 class GrImmediateDrawTarget : public GrClipTarget { |
| 19 public: |
| 20 |
| 21 /** |
| 22 * Creates a GrImmediateDrawTarget |
| 23 * |
| 24 * @param context the context object that owns this draw buffer. |
| 25 */ |
| 26 GrImmediateDrawTarget(GrContext* context); |
| 27 |
| 28 ~GrImmediateDrawTarget() override; |
| 29 |
| 30 // tracking for draws |
| 31 DrawToken getCurrentDrawToken() override { return DrawToken(this, fDrawID);
} |
| 32 |
| 33 void clearStencilClip(const SkIRect& rect, |
| 34 bool insideClip, |
| 35 GrRenderTarget* renderTarget) override; |
| 36 |
| 37 void discard(GrRenderTarget*) override; |
| 38 |
| 39 private: |
| 40 void onReset() override; |
| 41 void onFlush() override; |
| 42 |
| 43 // overrides from GrDrawTarget |
| 44 void onDrawBatch(GrBatch*, const PipelineInfo&) override; |
| 45 void onStencilPath(const GrPipelineBuilder&, |
| 46 const GrPathProcessor*, |
| 47 const GrPath*, |
| 48 const GrScissorState&, |
| 49 const GrStencilSettings&) override { |
| 50 SkFAIL("Only batch implemented\n"); |
| 51 } |
| 52 void onDrawPath(const GrPathProcessor*, |
| 53 const GrPath*, |
| 54 const GrStencilSettings&, |
| 55 const PipelineInfo&) override { |
| 56 SkFAIL("Only batch implemented\n"); |
| 57 } |
| 58 void onDrawPaths(const GrPathProcessor*, |
| 59 const GrPathRange*, |
| 60 const void* indices, |
| 61 PathIndexType, |
| 62 const float transformValues[], |
| 63 PathTransformType, |
| 64 int count, |
| 65 const GrStencilSettings&, |
| 66 const PipelineInfo&) override { |
| 67 SkFAIL("Only batch implemented\n"); |
| 68 } |
| 69 void onClear(const SkIRect* rect, |
| 70 GrColor color, |
| 71 bool canIgnoreRect, |
| 72 GrRenderTarget* renderTarget) override; |
| 73 void onCopySurface(GrSurface* dst, |
| 74 GrSurface* src, |
| 75 const SkIRect& srcRect, |
| 76 const SkIPoint& dstPoint) override; |
| 77 |
| 78 bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } |
| 79 |
| 80 bool SK_WARN_UNUSED_RESULT setupPipelineAndShouldDraw(GrPipeline*, |
| 81 const GrDrawTarget::Pi
pelineInfo&); |
| 82 |
| 83 void recordXferBarrierIfNecessary(const GrPipeline*); |
| 84 |
| 85 GrBatchTarget fBatchTarget; |
| 86 uint32_t fDrawID; |
| 87 |
| 88 typedef GrClipTarget INHERITED; |
| 89 }; |
| 90 |
| 91 #endif |
OLD | NEW |