| 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 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 const SkIRect& getResolveRect() const { return fResolveRect; } | 114 const SkIRect& getResolveRect() const { return fResolveRect; } |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * If the render target is multisampled this will perform a multisample | 117 * If the render target is multisampled this will perform a multisample |
| 118 * resolve. Any pending draws to the target are first flushed. This only | 118 * resolve. Any pending draws to the target are first flushed. This only |
| 119 * applies to render targets that are associated with GrTextures. After the | 119 * applies to render targets that are associated with GrTextures. After the |
| 120 * function returns the GrTexture will contain the resolved pixels. | 120 * function returns the GrTexture will contain the resolved pixels. |
| 121 */ | 121 */ |
| 122 void resolve(); | 122 void resolve(); |
| 123 | 123 |
| 124 /** |
| 125 * Provide a performance hint that the render target's contents are allowed |
| 126 * to become undefined. |
| 127 */ |
| 128 void discard(); |
| 129 |
| 124 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO | 130 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO |
| 125 // 0 in GL), or be unresolvable because the client didn't give us the | 131 // 0 in GL), or be unresolvable because the client didn't give us the |
| 126 // resolve destination. | 132 // resolve destination. |
| 127 enum ResolveType { | 133 enum ResolveType { |
| 128 kCanResolve_ResolveType, | 134 kCanResolve_ResolveType, |
| 129 kAutoResolves_ResolveType, | 135 kAutoResolves_ResolveType, |
| 130 kCantResolve_ResolveType, | 136 kCantResolve_ResolveType, |
| 131 }; | 137 }; |
| 132 virtual ResolveType getResolveType() const = 0; | 138 virtual ResolveType getResolveType() const = 0; |
| 133 | 139 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 162 | 168 |
| 163 GrStencilBuffer* fStencilBuffer; | 169 GrStencilBuffer* fStencilBuffer; |
| 164 GrTexture* fTexture; // not ref'ed | 170 GrTexture* fTexture; // not ref'ed |
| 165 | 171 |
| 166 SkIRect fResolveRect; | 172 SkIRect fResolveRect; |
| 167 | 173 |
| 168 typedef GrSurface INHERITED; | 174 typedef GrSurface INHERITED; |
| 169 }; | 175 }; |
| 170 | 176 |
| 171 #endif | 177 #endif |
| OLD | NEW |