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 class GrGLGpu; | 16 class GrGLGpu; |
17 | 17 |
18 class GrGLTexture : public GrTexture { | 18 class GrGLTexture : public GrTexture { |
19 | 19 |
20 public: | 20 public: |
21 struct TexParams { | 21 struct TexParams { |
22 GrGLenum fMinFilter; | 22 GrGLenum fMinFilter; |
23 GrGLenum fMagFilter; | 23 GrGLenum fMagFilter; |
24 GrGLenum fWrapS; | 24 GrGLenum fWrapS; |
25 GrGLenum fWrapT; | 25 GrGLenum fWrapT; |
| 26 GrGLenum fMaxMipMapLevel; |
26 GrGLenum fSwizzleRGBA[4]; | 27 GrGLenum fSwizzleRGBA[4]; |
27 void invalidate() { memset(this, 0xff, sizeof(TexParams)); } | 28 void invalidate() { memset(this, 0xff, sizeof(TexParams)); } |
28 }; | 29 }; |
29 | 30 |
30 struct IDDesc { | 31 struct IDDesc { |
31 GrGLTextureInfo fInfo; | 32 GrGLTextureInfo fInfo; |
32 GrGpuResource::LifeCycle fLifeCycle; | 33 GrGpuResource::LifeCycle fLifeCycle; |
33 }; | 34 }; |
34 | 35 |
35 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); | 36 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
| 37 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, bool wasMipMapDat
aProvided); |
36 | 38 |
37 GrBackendObject getTextureHandle() const override; | 39 GrBackendObject getTextureHandle() const override; |
38 | 40 |
39 void textureParamsModified() override { fTexParams.invalidate(); } | 41 void textureParamsModified() override { fTexParams.invalidate(); } |
40 | 42 |
41 // These functions are used to track the texture parameters associated with
the texture. | 43 // These functions are used to track the texture parameters associated with
the texture. |
42 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ | 44 const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const
{ |
43 *timestamp = fTexParamsTimestamp; | 45 *timestamp = fTexParamsTimestamp; |
44 return fTexParams; | 46 return fTexParams; |
45 } | 47 } |
(...skipping 30 matching lines...) Expand all Loading... |
76 GrGLTextureInfo fInfo; | 78 GrGLTextureInfo fInfo; |
77 | 79 |
78 // We track this separately from GrGpuResource because this may be both a te
xture and a render | 80 // We track this separately from GrGpuResource because this may be both a te
xture and a render |
79 // target, and the texture may be wrapped while the render target is not. | 81 // target, and the texture may be wrapped while the render target is not. |
80 LifeCycle fTextureIDLifecycle; | 82 LifeCycle fTextureIDLifecycle; |
81 | 83 |
82 typedef GrTexture INHERITED; | 84 typedef GrTexture INHERITED; |
83 }; | 85 }; |
84 | 86 |
85 #endif | 87 #endif |
OLD | NEW |