Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: src/gpu/gl/GrGLTexture.h

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Rebasing. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLTexture.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698