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 "GrBatchFlushState.h" | 13 #include "GrBatchFlushState.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 /** | 20 /** |
21 * Creates a GrImmediateDrawTarget | 21 * Creates a GrImmediateDrawTarget |
22 * | 22 * |
23 * @param context the context object that owns this draw buffer. | 23 * @param context the context object that owns this draw buffer. |
24 */ | 24 */ |
25 GrImmediateDrawTarget(GrContext* context); | 25 GrImmediateDrawTarget(GrContext* context); |
26 | 26 |
27 ~GrImmediateDrawTarget() override; | 27 ~GrImmediateDrawTarget() override; |
28 | 28 |
29 void clearStencilClip(const SkIRect& rect, | 29 protected: |
30 bool insideClip, | 30 void onDrawBatch(GrBatch*) override; |
31 GrRenderTarget* renderTarget) override; | |
32 | 31 |
33 private: | 32 private: |
34 void onReset() override; | 33 void onReset() override; |
35 void onFlush() override; | 34 void onFlush() override; |
36 | 35 |
37 // overrides from GrDrawTarget | |
38 void onDrawBatch(GrBatch*) override; | |
39 void onStencilPath(const GrPipelineBuilder&, | 36 void onStencilPath(const GrPipelineBuilder&, |
40 const GrPathProcessor*, | 37 const GrPathProcessor*, |
41 const GrPath*, | 38 const GrPath*, |
42 const GrScissorState&, | 39 const GrScissorState&, |
43 const GrStencilSettings&) override { | 40 const GrStencilSettings&) override { |
44 SkFAIL("Only batch implemented\n"); | 41 SkFAIL("Only batch implemented\n"); |
45 } | 42 } |
46 void onDrawPath(const GrPathProcessor*, | 43 void onDrawPath(const GrPathProcessor*, |
47 const GrPath*, | 44 const GrPath*, |
48 const GrStencilSettings&, | 45 const GrStencilSettings&, |
(...skipping 17 matching lines...) Expand all Loading... |
66 const SkIPoint& dstPoint) override; | 63 const SkIPoint& dstPoint) override; |
67 | 64 |
68 bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } | 65 bool isIssued(uint32_t drawID) override { return drawID != fDrawID; } |
69 | 66 |
70 uint32_t fDrawID; | 67 uint32_t fDrawID; |
71 | 68 |
72 typedef GrClipTarget INHERITED; | 69 typedef GrClipTarget INHERITED; |
73 }; | 70 }; |
74 | 71 |
75 #endif | 72 #endif |
OLD | NEW |