| 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 GrGLStencilBuffer_DEFINED | 9 #ifndef GrGLStencilBuffer_DEFINED |
| 10 #define GrGLStencilBuffer_DEFINED | 10 #define GrGLStencilBuffer_DEFINED |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 int width, int height, | 29 int width, int height, |
| 30 int sampleCnt, | 30 int sampleCnt, |
| 31 const Format& format) | 31 const Format& format) |
| 32 : GrStencilBuffer(gpu, isWrapped, width, height, format.fStencilBits, sa
mpleCnt) | 32 : GrStencilBuffer(gpu, isWrapped, width, height, format.fStencilBits, sa
mpleCnt) |
| 33 , fFormat(format) | 33 , fFormat(format) |
| 34 , fRenderbufferID(rbid) { | 34 , fRenderbufferID(rbid) { |
| 35 } | 35 } |
| 36 | 36 |
| 37 virtual ~GrGLStencilBuffer(); | 37 virtual ~GrGLStencilBuffer(); |
| 38 | 38 |
| 39 virtual size_t sizeInBytes() const SK_OVERRIDE; | 39 virtual size_t gpuMemorySize() const SK_OVERRIDE; |
| 40 | 40 |
| 41 GrGLuint renderbufferID() const { | 41 GrGLuint renderbufferID() const { |
| 42 return fRenderbufferID; | 42 return fRenderbufferID; |
| 43 } | 43 } |
| 44 | 44 |
| 45 const Format& format() const { return fFormat; } | 45 const Format& format() const { return fFormat; } |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 // overrides of GrResource | 48 // overrides of GrResource |
| 49 virtual void onRelease() SK_OVERRIDE; | 49 virtual void onRelease() SK_OVERRIDE; |
| 50 virtual void onAbandon() SK_OVERRIDE; | 50 virtual void onAbandon() SK_OVERRIDE; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 Format fFormat; | 53 Format fFormat; |
| 54 // may be zero for external SBs associated with external RTs | 54 // may be zero for external SBs associated with external RTs |
| 55 // (we don't require the client to give us the id, just tell | 55 // (we don't require the client to give us the id, just tell |
| 56 // us how many bits of stencil there are). | 56 // us how many bits of stencil there are). |
| 57 GrGLuint fRenderbufferID; | 57 GrGLuint fRenderbufferID; |
| 58 | 58 |
| 59 typedef GrStencilBuffer INHERITED; | 59 typedef GrStencilBuffer INHERITED; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 #endif | 62 #endif |
| OLD | NEW |