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 | 20 |
21 /** | 21 /** |
22 * Creates a GrImmediateDrawTarget | 22 * Creates a GrImmediateDrawTarget |
23 * | 23 * |
24 * @param context the context object that owns this draw buffer. | 24 * @param context the context object that owns this draw buffer. |
25 */ | 25 */ |
26 GrImmediateDrawTarget(GrContext* context); | 26 GrImmediateDrawTarget(GrContext* context); |
27 | 27 |
28 ~GrImmediateDrawTarget() override; | 28 ~GrImmediateDrawTarget() override; |
29 | 29 |
30 // tracking for draws | |
31 DrawToken getCurrentDrawToken() override { return DrawToken(this, fDrawID);
} | |
32 | |
33 void clearStencilClip(const SkIRect& rect, | 30 void clearStencilClip(const SkIRect& rect, |
34 bool insideClip, | 31 bool insideClip, |
35 GrRenderTarget* renderTarget) override; | 32 GrRenderTarget* renderTarget) override; |
36 | 33 |
37 void discard(GrRenderTarget*) override; | 34 void discard(GrRenderTarget*) override; |
38 | 35 |
39 private: | 36 private: |
40 void onReset() override; | 37 void onReset() override; |
41 void onFlush() override; | 38 void onFlush() override; |
42 | 39 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 79 |
83 void recordXferBarrierIfNecessary(const GrPipeline*); | 80 void recordXferBarrierIfNecessary(const GrPipeline*); |
84 | 81 |
85 GrBatchTarget fBatchTarget; | 82 GrBatchTarget fBatchTarget; |
86 uint32_t fDrawID; | 83 uint32_t fDrawID; |
87 | 84 |
88 typedef GrClipTarget INHERITED; | 85 typedef GrClipTarget INHERITED; |
89 }; | 86 }; |
90 | 87 |
91 #endif | 88 #endif |
OLD | NEW |