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 17 matching lines...) Expand all Loading... |
28 GrGLint rbid, | 28 GrGLint rbid, |
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 this->registerWithCache(); | 35 this->registerWithCache(); |
36 } | 36 } |
37 | 37 |
38 virtual ~GrGLStencilBuffer(); | |
39 | |
40 GrGLuint renderbufferID() const { | 38 GrGLuint renderbufferID() const { |
41 return fRenderbufferID; | 39 return fRenderbufferID; |
42 } | 40 } |
43 | 41 |
44 const Format& format() const { return fFormat; } | 42 const Format& format() const { return fFormat; } |
45 | 43 |
46 protected: | 44 protected: |
47 // overrides of GrResource | 45 // overrides of GrResource |
48 virtual void onRelease() SK_OVERRIDE; | 46 virtual void onRelease() SK_OVERRIDE; |
49 virtual void onAbandon() SK_OVERRIDE; | 47 virtual void onAbandon() SK_OVERRIDE; |
50 | 48 |
51 private: | 49 private: |
52 virtual size_t onGpuMemorySize() const SK_OVERRIDE; | 50 virtual size_t onGpuMemorySize() const SK_OVERRIDE; |
53 | 51 |
54 Format fFormat; | 52 Format fFormat; |
55 // may be zero for external SBs associated with external RTs | 53 // may be zero for external SBs associated with external RTs |
56 // (we don't require the client to give us the id, just tell | 54 // (we don't require the client to give us the id, just tell |
57 // us how many bits of stencil there are). | 55 // us how many bits of stencil there are). |
58 GrGLuint fRenderbufferID; | 56 GrGLuint fRenderbufferID; |
59 | 57 |
60 typedef GrStencilBuffer INHERITED; | 58 typedef GrStencilBuffer INHERITED; |
61 }; | 59 }; |
62 | 60 |
63 #endif | 61 #endif |
OLD | NEW |