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

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

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, 9 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/GrGLTexture.h ('k') | no next file » | 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 #include "GrGLTexture.h" 8 #include "GrGLTexture.h"
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "SkTraceMemoryDump.h" 10 #include "SkTraceMemoryDump.h"
11 11
12 #define GPUGL static_cast<GrGLGpu*>(this->getGpu()) 12 #define GPUGL static_cast<GrGLGpu*>(this->getGpu())
13 #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X) 13 #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
14 14
15 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor. 15 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor.
16 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc) 16 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc)
17 : GrSurface(gpu, idDesc.fLifeCycle, desc) 17 : GrSurface(gpu, idDesc.fLifeCycle, desc)
18 , INHERITED(gpu, idDesc.fLifeCycle, desc) { 18 , INHERITED(gpu, idDesc.fLifeCycle, desc, false) {
19 this->init(desc, idDesc);
20 this->registerWithCache();
21 }
22
23 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc,
24 bool wasMipMapDataProvided)
25 : GrSurface(gpu, idDesc.fLifeCycle, desc)
26 , INHERITED(gpu, idDesc.fLifeCycle, desc, wasMipMapDataProvided) {
19 this->init(desc, idDesc); 27 this->init(desc, idDesc);
20 this->registerWithCache(); 28 this->registerWithCache();
21 } 29 }
22 30
23 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived) 31 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived)
24 : GrSurface(gpu, idDesc.fLifeCycle, desc) 32 : GrSurface(gpu, idDesc.fLifeCycle, desc)
25 , INHERITED(gpu, idDesc.fLifeCycle, desc) { 33 , INHERITED(gpu, idDesc.fLifeCycle, desc, false) {
26 this->init(desc, idDesc); 34 this->init(desc, idDesc);
27 } 35 }
28 36
29 void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { 37 void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
30 SkASSERT(0 != idDesc.fInfo.fID); 38 SkASSERT(0 != idDesc.fInfo.fID);
31 fTexParams.invalidate(); 39 fTexParams.invalidate();
32 fTexParamsTimestamp = GrGpu::kExpiredTimestamp; 40 fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
33 fInfo = idDesc.fInfo; 41 fInfo = idDesc.fInfo;
34 fTextureIDLifecycle = idDesc.fLifeCycle; 42 fTextureIDLifecycle = idDesc.fLifeCycle;
35 } 43 }
(...skipping 28 matching lines...) Expand all
64 #endif 72 #endif
65 } 73 }
66 74
67 void GrGLTexture::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, 75 void GrGLTexture::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
68 const SkString& dumpName) const { 76 const SkString& dumpName) const {
69 SkString texture_id; 77 SkString texture_id;
70 texture_id.appendU32(this->textureID()); 78 texture_id.appendU32(this->textureID());
71 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture", 79 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture",
72 texture_id.c_str()); 80 texture_id.c_str());
73 } 81 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLTexture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698