| 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 12 matching lines...) Expand all Loading... |
| 23 class GrRenderTarget : virtual public GrSurface { | 23 class GrRenderTarget : virtual public GrSurface { |
| 24 public: | 24 public: |
| 25 SK_DECLARE_INST_COUNT(GrRenderTarget) | 25 SK_DECLARE_INST_COUNT(GrRenderTarget) |
| 26 | 26 |
| 27 // GrSurface overrides | 27 // GrSurface overrides |
| 28 GrRenderTarget* asRenderTarget() SK_OVERRIDE { return this; } | 28 GrRenderTarget* asRenderTarget() SK_OVERRIDE { return this; } |
| 29 const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { return this; } | 29 const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { return this; } |
| 30 | 30 |
| 31 // GrRenderTarget | 31 // GrRenderTarget |
| 32 /** | 32 /** |
| 33 * If this RT is multisampled, this is the multisample buffer | |
| 34 * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL) | |
| 35 */ | |
| 36 virtual GrBackendObject getRenderTargetHandle() const = 0; | |
| 37 | |
| 38 /** | |
| 39 * If this RT is multisampled, this is the buffer it is resolved to. | |
| 40 * Otherwise, same as getRenderTargetHandle(). | |
| 41 * (In GL a separate FBO ID is used for the MSAA and resolved buffers) | |
| 42 * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL) | |
| 43 */ | |
| 44 virtual GrBackendObject getRenderTargetResolvedHandle() const = 0; | |
| 45 | |
| 46 /** | |
| 47 * @return true if the surface is multisampled, false otherwise | 33 * @return true if the surface is multisampled, false otherwise |
| 48 */ | 34 */ |
| 49 bool isMultisampled() const { return 0 != fDesc.fSampleCnt; } | 35 bool isMultisampled() const { return 0 != fDesc.fSampleCnt; } |
| 50 | 36 |
| 51 /** | 37 /** |
| 52 * @return the number of samples-per-pixel or zero if non-MSAA. | 38 * @return the number of samples-per-pixel or zero if non-MSAA. |
| 53 */ | 39 */ |
| 54 int numSamples() const { return fDesc.fSampleCnt; } | 40 int numSamples() const { return fDesc.fSampleCnt; } |
| 55 | 41 |
| 56 /** | 42 /** |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 107 |
| 122 private: | 108 private: |
| 123 GrStencilBuffer* fStencilBuffer; | 109 GrStencilBuffer* fStencilBuffer; |
| 124 | 110 |
| 125 SkIRect fResolveRect; | 111 SkIRect fResolveRect; |
| 126 | 112 |
| 127 typedef GrSurface INHERITED; | 113 typedef GrSurface INHERITED; |
| 128 }; | 114 }; |
| 129 | 115 |
| 130 #endif | 116 #endif |
| OLD | NEW |