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 GrGLTexture_DEFINED | 9 #ifndef GrGLTexture_DEFINED |
10 #define GrGLTexture_DEFINED | 10 #define GrGLTexture_DEFINED |
(...skipping 15 matching lines...) Expand all Loading... |
26 void invalidate() { memset(this, 0xff, sizeof(TexParams)); } | 26 void invalidate() { memset(this, 0xff, sizeof(TexParams)); } |
27 }; | 27 }; |
28 | 28 |
29 struct IDDesc { | 29 struct IDDesc { |
30 GrGLuint fTextureID; | 30 GrGLuint fTextureID; |
31 bool fIsWrapped; | 31 bool fIsWrapped; |
32 }; | 32 }; |
33 | 33 |
34 GrGLTexture(GrGpuGL*, const GrSurfaceDesc&, const IDDesc&); | 34 GrGLTexture(GrGpuGL*, const GrSurfaceDesc&, const IDDesc&); |
35 | 35 |
36 virtual ~GrGLTexture() { this->release(); } | |
37 | |
38 virtual GrBackendObject getTextureHandle() const SK_OVERRIDE; | 36 virtual GrBackendObject getTextureHandle() const SK_OVERRIDE; |
39 | 37 |
40 virtual void textureParamsModified() SK_OVERRIDE { fTexParams.invalidate();
} | 38 virtual void textureParamsModified() SK_OVERRIDE { fTexParams.invalidate();
} |
41 | 39 |
42 // These functions are used to track the texture parameters associated with
the texture. | 40 // These functions are used to track the texture parameters associated with
the texture. |
43 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ | 41 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ |
44 *timestamp = fTexParamsTimestamp; | 42 *timestamp = fTexParamsTimestamp; |
45 return fTexParams; | 43 return fTexParams; |
46 } | 44 } |
47 | 45 |
(...skipping 19 matching lines...) Expand all Loading... |
67 | 65 |
68 private: | 66 private: |
69 TexParams fTexParams; | 67 TexParams fTexParams; |
70 GrGpu::ResetTimestamp fTexParamsTimestamp; | 68 GrGpu::ResetTimestamp fTexParamsTimestamp; |
71 GrGLuint fTextureID; | 69 GrGLuint fTextureID; |
72 | 70 |
73 typedef GrTexture INHERITED; | 71 typedef GrTexture INHERITED; |
74 }; | 72 }; |
75 | 73 |
76 #endif | 74 #endif |
OLD | NEW |