| 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 GrCaps; |
| 14 class GrDrawTarget; | 15 class GrDrawTarget; |
| 15 class GrStencilAttachment; | 16 class GrStencilAttachment; |
| 16 class GrRenderTargetPriv; | 17 class GrRenderTargetPriv; |
| 17 | 18 |
| 18 /** | 19 /** |
| 19 * GrRenderTarget represents a 2D buffer of pixels that can be rendered to. | 20 * GrRenderTarget represents a 2D buffer of pixels that can be rendered to. |
| 20 * A context's render target is set by setRenderTarget(). Render targets are | 21 * A context's render target is set by setRenderTarget(). Render targets are |
| 21 * created by a createTexture with the kRenderTarget_SurfaceFlag flag. | 22 * created by a createTexture with the kRenderTarget_SurfaceFlag flag. |
| 22 * Additionally, GrContext provides methods for creating GrRenderTargets | 23 * Additionally, GrContext provides methods for creating GrRenderTargets |
| 23 * that wrap externally created render targets. | 24 * that wrap externally created render targets. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Checked when this object is asked to attach a stencil buffer. | 149 // Checked when this object is asked to attach a stencil buffer. |
| 149 virtual bool canAttemptStencilAttachment() const = 0; | 150 virtual bool canAttemptStencilAttachment() const = 0; |
| 150 | 151 |
| 151 // Provides access to functions that aren't part of the public API. | 152 // Provides access to functions that aren't part of the public API. |
| 152 GrRenderTargetPriv renderTargetPriv(); | 153 GrRenderTargetPriv renderTargetPriv(); |
| 153 const GrRenderTargetPriv renderTargetPriv() const; | 154 const GrRenderTargetPriv renderTargetPriv() const; |
| 154 | 155 |
| 155 void setLastDrawTarget(GrDrawTarget* dt); | 156 void setLastDrawTarget(GrDrawTarget* dt); |
| 156 GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; } | 157 GrDrawTarget* getLastDrawTarget() { return fLastDrawTarget; } |
| 157 | 158 |
| 159 static SampleConfig ComputeSampleConfig(const GrCaps& caps, int sampleCnt); |
| 160 |
| 158 protected: | 161 protected: |
| 159 GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, | 162 GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, |
| 160 SampleConfig sampleConfig, GrStencilAttachment* stencil = nul
lptr) | 163 SampleConfig sampleConfig, GrStencilAttachment* stencil = nul
lptr) |
| 161 : INHERITED(gpu, desc) | 164 : INHERITED(gpu, desc) |
| 162 , fStencilAttachment(stencil) | 165 , fStencilAttachment(stencil) |
| 163 , fSampleConfig(sampleConfig) | 166 , fSampleConfig(sampleConfig) |
| 164 , fLastDrawTarget(nullptr) { | 167 , fLastDrawTarget(nullptr) { |
| 165 fResolveRect.setLargestInverted(); | 168 fResolveRect.setLargestInverted(); |
| 166 } | 169 } |
| 167 | 170 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 191 // This back-pointer is required so that we can add a dependancy between | 194 // This back-pointer is required so that we can add a dependancy between |
| 192 // the drawTarget used to create the current contents of this renderTarget | 195 // the drawTarget used to create the current contents of this renderTarget |
| 193 // and the drawTarget of a destination renderTarget to which this one is bei
ng drawn. | 196 // and the drawTarget of a destination renderTarget to which this one is bei
ng drawn. |
| 194 GrDrawTarget* fLastDrawTarget; | 197 GrDrawTarget* fLastDrawTarget; |
| 195 | 198 |
| 196 typedef GrSurface INHERITED; | 199 typedef GrSurface INHERITED; |
| 197 }; | 200 }; |
| 198 | 201 |
| 199 | 202 |
| 200 #endif | 203 #endif |
| OLD | NEW |