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

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

Issue 1403123002: Store texture target on GrGLTexture. This is in preparation for using texture targets other than 2D. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: working Created 5 years, 2 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"
(...skipping 12 matching lines...) Expand all
23 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived) 23 GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc, Derived)
24 : GrSurface(gpu, idDesc.fLifeCycle, desc) 24 : GrSurface(gpu, idDesc.fLifeCycle, desc)
25 , INHERITED(gpu, idDesc.fLifeCycle, desc) { 25 , INHERITED(gpu, idDesc.fLifeCycle, desc) {
26 this->init(desc, idDesc); 26 this->init(desc, idDesc);
27 } 27 }
28 28
29 void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) { 29 void GrGLTexture::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
30 SkASSERT(0 != idDesc.fTextureID); 30 SkASSERT(0 != idDesc.fTextureID);
31 fTexParams.invalidate(); 31 fTexParams.invalidate();
32 fTexParamsTimestamp = GrGpu::kExpiredTimestamp; 32 fTexParamsTimestamp = GrGpu::kExpiredTimestamp;
33 fTarget = idDesc.fTarget;
33 fTextureID = idDesc.fTextureID; 34 fTextureID = idDesc.fTextureID;
34 fTextureIDLifecycle = idDesc.fLifeCycle; 35 fTextureIDLifecycle = idDesc.fLifeCycle;
35 } 36 }
36 37
37 void GrGLTexture::onRelease() { 38 void GrGLTexture::onRelease() {
38 if (fTextureID) { 39 if (fTextureID) {
39 if (GrGpuResource::kBorrowed_LifeCycle != fTextureIDLifecycle) { 40 if (GrGpuResource::kBorrowed_LifeCycle != fTextureIDLifecycle) {
40 GL_CALL(DeleteTextures(1, &fTextureID)); 41 GL_CALL(DeleteTextures(1, &fTextureID));
41 } 42 }
42 fTextureID = 0; 43 fTextureID = 0;
(...skipping 10 matching lines...) Expand all
53 return static_cast<GrBackendObject>(this->textureID()); 54 return static_cast<GrBackendObject>(this->textureID());
54 } 55 }
55 56
56 void GrGLTexture::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, 57 void GrGLTexture::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
57 const SkString& dumpName) const { 58 const SkString& dumpName) const {
58 SkString texture_id; 59 SkString texture_id;
59 texture_id.appendU32(this->textureID()); 60 texture_id.appendU32(this->textureID());
60 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture", 61 traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_texture",
61 texture_id.c_str()); 62 texture_id.c_str());
62 } 63 }
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