OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrRenderTarget_DEFINED | 8 #ifndef GrRenderTarget_DEFINED |
9 #define GrRenderTarget_DEFINED | 9 #define GrRenderTarget_DEFINED |
10 | 10 |
11 #include "GrSurface.h" | 11 #include "GrSurface.h" |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 | 13 |
14 class GrStencilAttachment; | 14 class GrStencilAttachment; |
15 class GrRenderTargetPriv; | 15 class GrRenderTargetPriv; |
16 | 16 |
17 /** | 17 /** |
18 * GrRenderTarget represents a 2D buffer of pixels that can be rendered to. | 18 * GrRenderTarget represents a 2D buffer of pixels that can be rendered to. |
19 * A context's render target is set by setRenderTarget(). Render targets are | 19 * A context's render target is set by setRenderTarget(). Render targets are |
20 * created by a createTexture with the kRenderTarget_SurfaceFlag flag. | 20 * created by a createTexture with the kRenderTarget_SurfaceFlag flag. |
21 * Additionally, GrContext provides methods for creating GrRenderTargets | 21 * Additionally, GrContext provides methods for creating GrRenderTargets |
22 * that wrap externally created render targets. | 22 * that wrap externally created render targets. |
23 */ | 23 */ |
24 class GrRenderTarget : virtual public GrSurface { | 24 class GrRenderTarget : virtual public GrSurface { |
25 public: | 25 public: |
26 SK_DECLARE_INST_COUNT(GrRenderTarget) | |
27 | |
28 // GrSurface overrides | 26 // GrSurface overrides |
29 GrRenderTarget* asRenderTarget() override { return this; } | 27 GrRenderTarget* asRenderTarget() override { return this; } |
30 const GrRenderTarget* asRenderTarget() const override { return this; } | 28 const GrRenderTarget* asRenderTarget() const override { return this; } |
31 | 29 |
32 // GrRenderTarget | 30 // GrRenderTarget |
33 /** | 31 /** |
34 * On some hardware it is possible for a render target to have multisampling | 32 * On some hardware it is possible for a render target to have multisampling |
35 * only in certain buffers. | 33 * only in certain buffers. |
36 * Enforce only two legal sample configs. | 34 * Enforce only two legal sample configs. |
37 * kUnified_SampleConfig signifies multisampling in both color and stencil | 35 * kUnified_SampleConfig signifies multisampling in both color and stencil |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 GrStencilAttachment* fStencilAttachment; | 164 GrStencilAttachment* fStencilAttachment; |
167 SampleConfig fSampleConfig; | 165 SampleConfig fSampleConfig; |
168 | 166 |
169 SkIRect fResolveRect; | 167 SkIRect fResolveRect; |
170 | 168 |
171 typedef GrSurface INHERITED; | 169 typedef GrSurface INHERITED; |
172 }; | 170 }; |
173 | 171 |
174 | 172 |
175 #endif | 173 #endif |
OLD | NEW |