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

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

Issue 405023003: Revert of 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: 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);
82 if (!this->isWrapped()) { 83 if (!this->isWrapped()) {
83 if (fTexFBOID) { 84 if (fTexFBOID) {
84 GL_CALL(DeleteFramebuffers(1, &fTexFBOID)); 85 GL_CALL(DeleteFramebuffers(1, &fTexFBOID));
85 } 86 }
86 if (fRTFBOID && fRTFBOID != fTexFBOID) { 87 if (fRTFBOID && fRTFBOID != fTexFBOID) {
87 GL_CALL(DeleteFramebuffers(1, &fRTFBOID)); 88 GL_CALL(DeleteFramebuffers(1, &fRTFBOID));
88 } 89 }
89 if (fMSColorRenderbufferID) { 90 if (fMSColorRenderbufferID) {
90 GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID)); 91 GL_CALL(DeleteRenderbuffers(1, &fMSColorRenderbufferID));
91 } 92 }
92 } 93 }
93 fRTFBOID = 0; 94 fRTFBOID = 0;
94 fTexFBOID = 0; 95 fTexFBOID = 0;
95 fMSColorRenderbufferID = 0; 96 fMSColorRenderbufferID = 0;
96 fTexIDObj.reset(NULL); 97 fTexIDObj.reset(NULL);
97 INHERITED::onRelease(); 98 INHERITED::onRelease();
98 } 99 }
99 100
100 void GrGLRenderTarget::onAbandon() { 101 void GrGLRenderTarget::onAbandon() {
101 fRTFBOID = 0; 102 fRTFBOID = 0;
102 fTexFBOID = 0; 103 fTexFBOID = 0;
103 fMSColorRenderbufferID = 0; 104 fMSColorRenderbufferID = 0;
104 if (NULL != fTexIDObj.get()) { 105 if (NULL != fTexIDObj.get()) {
105 fTexIDObj->abandon(); 106 fTexIDObj->abandon();
106 fTexIDObj.reset(NULL); 107 fTexIDObj.reset(NULL);
107 } 108 }
108 INHERITED::onAbandon(); 109 INHERITED::onAbandon();
109 } 110 }
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