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

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

Issue 376703009: Use the GrCacheable ID to eliminate the need for notifications to GrGpuGL when textures and RTs are… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: now with 64 bits Created 6 years, 5 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/GrCacheable.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 #include "GrGLRenderTarget.h" 8 #include "GrGLRenderTarget.h"
9 9
10 #include "GrGpuGL.h" 10 #include "GrGpuGL.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 desc.fIsWrapped, 72 desc.fIsWrapped,
73 NULL, 73 NULL,
74 MakeDesc(kNone_GrTextureFlags, 74 MakeDesc(kNone_GrTextureFlags,
75 viewport.fWidth, viewport.fHeight, 75 viewport.fWidth, viewport.fHeight,
76 desc.fConfig, desc.fSampleCnt, 76 desc.fConfig, desc.fSampleCnt,
77 desc.fOrigin)) { 77 desc.fOrigin)) {
78 this->init(desc, viewport, NULL); 78 this->init(desc, viewport, NULL);
79 } 79 }
80 80
81 void GrGLRenderTarget::onRelease() { 81 void GrGLRenderTarget::onRelease() {
82 GPUGL->notifyRenderTargetDelete(this);
83 if (!this->isWrapped()) { 82 if (!this->isWrapped()) {
84 if (fTexFBOID) { 83 if (fTexFBOID) {
85 GL_CALL(DeleteFramebuffers(1, &fTexFBOID)); 84 GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
86 } 85 }
87 if (fRTFBOID && fRTFBOID != fTexFBOID) { 86 if (fRTFBOID && fRTFBOID != fTexFBOID) {
88 GL_CALL(DeleteFramebuffers(1, &fRTFBOID)); 87 GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
89 } 88 }
90 if (fMSColorRenderbufferID) { 89 if (fMSColorRenderbufferID) {
91 GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID)); 90 GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
92 } 91 }
93 } 92 }
94 fRTFBOID = 0; 93 fRTFBOID = 0;
95 fTexFBOID = 0; 94 fTexFBOID = 0;
96 fMSColorRenderbufferID = 0; 95 fMSColorRenderbufferID = 0;
97 fTexIDObj.reset(NULL); 96 fTexIDObj.reset(NULL);
98 INHERITED::onRelease(); 97 INHERITED::onRelease();
99 } 98 }
100 99
101 void GrGLRenderTarget::onAbandon() { 100 void GrGLRenderTarget::onAbandon() {
102 fRTFBOID = 0; 101 fRTFBOID = 0;
103 fTexFBOID = 0; 102 fTexFBOID = 0;
104 fMSColorRenderbufferID = 0; 103 fMSColorRenderbufferID = 0;
105 if (NULL != fTexIDObj.get()) { 104 if (NULL != fTexIDObj.get()) {
106 fTexIDObj->abandon(); 105 fTexIDObj->abandon();
107 fTexIDObj.reset(NULL); 106 fTexIDObj.reset(NULL);
108 } 107 }
109 INHERITED::onAbandon(); 108 INHERITED::onAbandon();
110 } 109 }
OLDNEW
« no previous file with comments | « src/gpu/GrCacheable.cpp ('k') | src/gpu/gl/GrGLTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698