| 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 | 8 |
| 9 #ifndef GrGLRenderTarget_DEFINED | 9 #ifndef GrGLRenderTarget_DEFINED |
| 10 #define GrGLRenderTarget_DEFINED | 10 #define GrGLRenderTarget_DEFINED |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 enum { kUnresolvableFBOID = 0 }; | 24 enum { kUnresolvableFBOID = 0 }; |
| 25 | 25 |
| 26 struct IDDesc { | 26 struct IDDesc { |
| 27 GrGLuint fRTFBOID; | 27 GrGLuint fRTFBOID; |
| 28 GrBackendObjectOwnership fRTFBOOwnership; | 28 GrBackendObjectOwnership fRTFBOOwnership; |
| 29 GrGLuint fTexFBOID; | 29 GrGLuint fTexFBOID; |
| 30 GrGLuint fMSColorRenderbufferID; | 30 GrGLuint fMSColorRenderbufferID; |
| 31 bool fIsMixedSampled; | 31 bool fIsMixedSampled; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 static GrGLRenderTarget* CreateWrapped(GrGLGpu*, | 34 static sk_sp<GrGLRenderTarget> MakeWrapped(GrGLGpu*, |
| 35 const GrSurfaceDesc&, | 35 const GrSurfaceDesc&, |
| 36 const IDDesc&, | 36 const IDDesc&, |
| 37 int stencilBits); | 37 int stencilBits); |
| 38 | 38 |
| 39 void setViewport(const GrGLIRect& rect) { fViewport = rect; } | 39 void setViewport(const GrGLIRect& rect) { fViewport = rect; } |
| 40 const GrGLIRect& getViewport() const { return fViewport; } | 40 const GrGLIRect& getViewport() const { return fViewport; } |
| 41 | 41 |
| 42 // The following two functions return the same ID when a | 42 // The following two functions return the same ID when a |
| 43 // texture/render target is multisampled, and different IDs when | 43 // texture/render target is multisampled, and different IDs when |
| 44 // it is. | 44 // it is. |
| 45 // FBO ID used to render into | 45 // FBO ID used to render into |
| 46 GrGLuint renderFBOID() const { return fRTFBOID; } | 46 GrGLuint renderFBOID() const { return fRTFBOID; } |
| 47 // FBO ID that has texture ID attached. | 47 // FBO ID that has texture ID attached. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 GrGLIRect fViewport; | 107 GrGLIRect fViewport; |
| 108 | 108 |
| 109 // onGpuMemorySize() needs to know the VRAM footprint of the FBO(s). However
, abandon and | 109 // onGpuMemorySize() needs to know the VRAM footprint of the FBO(s). However
, abandon and |
| 110 // release zero out the IDs and the cache needs to know the size even after
those actions. | 110 // release zero out the IDs and the cache needs to know the size even after
those actions. |
| 111 size_t fGpuMemorySize; | 111 size_t fGpuMemorySize; |
| 112 | 112 |
| 113 typedef GrRenderTarget INHERITED; | 113 typedef GrRenderTarget INHERITED; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 #endif | 116 #endif |
| OLD | NEW |