| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 * @return true if the GrRenderTarget requires MSAA resolving | 80 * @return true if the GrRenderTarget requires MSAA resolving |
| 81 */ | 81 */ |
| 82 bool needsResolve() const { return !fResolveRect.isEmpty(); } | 82 bool needsResolve() const { return !fResolveRect.isEmpty(); } |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * Returns a rect bounding the region needing resolving. | 85 * Returns a rect bounding the region needing resolving. |
| 86 */ | 86 */ |
| 87 const SkIRect& getResolveRect() const { return fResolveRect; } | 87 const SkIRect& getResolveRect() const { return fResolveRect; } |
| 88 | 88 |
| 89 /** | 89 /** |
| 90 * If the render target is multisampled this will perform a multisample | |
| 91 * resolve. Any pending draws to the target are first flushed. This only | |
| 92 * applies to render targets that are associated with GrTextures. After the | |
| 93 * function returns the GrTexture will contain the resolved pixels. | |
| 94 */ | |
| 95 void resolve(); | |
| 96 | |
| 97 /** | |
| 98 * Provide a performance hint that the render target's contents are allowed | 90 * Provide a performance hint that the render target's contents are allowed |
| 99 * to become undefined. | 91 * to become undefined. |
| 100 */ | 92 */ |
| 101 void discard(); | 93 void discard(); |
| 102 | 94 |
| 103 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO | 95 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO |
| 104 // 0 in GL), or be unresolvable because the client didn't give us the | 96 // 0 in GL), or be unresolvable because the client didn't give us the |
| 105 // resolve destination. | 97 // resolve destination. |
| 106 enum ResolveType { | 98 enum ResolveType { |
| 107 kCanResolve_ResolveType, | 99 kCanResolve_ResolveType, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 131 | 123 |
| 132 private: | 124 private: |
| 133 GrStencilBuffer* fStencilBuffer; | 125 GrStencilBuffer* fStencilBuffer; |
| 134 | 126 |
| 135 SkIRect fResolveRect; | 127 SkIRect fResolveRect; |
| 136 | 128 |
| 137 typedef GrSurface INHERITED; | 129 typedef GrSurface INHERITED; |
| 138 }; | 130 }; |
| 139 | 131 |
| 140 #endif | 132 #endif |
| OLD | NEW |