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 |
11 | 11 |
12 #include "GrGpu.h" | 12 #include "GrGpu.h" |
13 #include "GrTexture.h" | 13 #include "GrTexture.h" |
14 #include "GrGLUtil.h" | 14 #include "GrGLUtil.h" |
15 | 15 |
16 | 16 |
17 class GrGLTexture : public GrTexture { | 17 class GrGLTexture : public GrTexture { |
18 | 18 |
19 public: | 19 public: |
20 struct TexParams { | 20 struct TexParams { |
21 GrGLenum fMinFilter; | 21 GrGLenum fMinFilter; |
22 GrGLenum fMagFilter; | 22 GrGLenum fMagFilter; |
23 GrGLenum fWrapS; | 23 GrGLenum fWrapS; |
24 GrGLenum fWrapT; | 24 GrGLenum fWrapT; |
25 GrGLenum fSwizzleRGBA[4]; | 25 GrGLenum fSwizzleRGBA[4]; |
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 GrGpuResource::LifeCycle fLifeCycle; |
32 }; | 32 }; |
33 | 33 |
34 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); | 34 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
35 | 35 |
36 GrBackendObject getTextureHandle() const SK_OVERRIDE; | 36 GrBackendObject getTextureHandle() const SK_OVERRIDE; |
37 | 37 |
38 void textureParamsModified() SK_OVERRIDE { fTexParams.invalidate(); } | 38 void textureParamsModified() SK_OVERRIDE { fTexParams.invalidate(); } |
39 | 39 |
40 // 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. |
41 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ | 41 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ |
(...skipping 27 matching lines...) Expand all Loading... |
69 GrGLuint fTextureID; | 69 GrGLuint fTextureID; |
70 | 70 |
71 // We track this separately from GrGpuResource because this may be both a te
xture and a render | 71 // We track this separately from GrGpuResource because this may be both a te
xture and a render |
72 // target, and the texture may be wrapped while the render target is not. | 72 // target, and the texture may be wrapped while the render target is not. |
73 bool fIsWrapped; | 73 bool fIsWrapped; |
74 | 74 |
75 typedef GrTexture INHERITED; | 75 typedef GrTexture INHERITED; |
76 }; | 76 }; |
77 | 77 |
78 #endif | 78 #endif |
OLD | NEW |