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

Side by Side Diff: content/common/gpu/texture_image_transport_surface.cc

Issue 16431008: TextureImageTransportSurface: Don't recreate the backbuffer on Resize if it's supposed to be discar… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/texture_image_transport_surface.h" 5 #include "content/common/gpu/texture_image_transport_surface.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void* TextureImageTransportSurface::GetConfig() { 154 void* TextureImageTransportSurface::GetConfig() {
155 return surface_.get() ? surface_->GetConfig() : NULL; 155 return surface_.get() ? surface_->GetConfig() : NULL;
156 } 156 }
157 157
158 void TextureImageTransportSurface::OnResize(gfx::Size size, 158 void TextureImageTransportSurface::OnResize(gfx::Size size,
159 float scale_factor) { 159 float scale_factor) {
160 DCHECK_GE(size.width(), 1); 160 DCHECK_GE(size.width(), 1);
161 DCHECK_GE(size.height(), 1); 161 DCHECK_GE(size.height(), 1);
162 current_size_ = size; 162 current_size_ = size;
163 scale_factor_ = scale_factor; 163 scale_factor_ = scale_factor;
164 CreateBackTexture(); 164 if (backbuffer_suggested_allocation_)
165 CreateBackTexture();
165 } 166 }
166 167
167 void TextureImageTransportSurface::OnWillDestroyStub() { 168 void TextureImageTransportSurface::OnWillDestroyStub() {
168 DCHECK(helper_->stub()->decoder()->GetGLContext()->IsCurrent(NULL)); 169 DCHECK(helper_->stub()->decoder()->GetGLContext()->IsCurrent(NULL));
169 helper_->stub()->RemoveDestructionObserver(this); 170 helper_->stub()->RemoveDestructionObserver(this);
170 171
171 // We are losing the stub owning us, this is our last chance to clean up the 172 // We are losing the stub owning us, this is our last chance to clean up the
172 // resources we allocated in the stub's context. 173 // resources we allocated in the stub's context.
173 ReleaseBackTexture(); 174 ReleaseBackTexture();
174 ReleaseFrontTexture(); 175 ReleaseFrontTexture();
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 451
451 #ifndef NDEBUG 452 #ifndef NDEBUG
452 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER); 453 GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER);
453 if (status != GL_FRAMEBUFFER_COMPLETE) { 454 if (status != GL_FRAMEBUFFER_COMPLETE) {
454 DLOG(FATAL) << "Framebuffer incomplete: " << status; 455 DLOG(FATAL) << "Framebuffer incomplete: " << status;
455 } 456 }
456 #endif 457 #endif
457 } 458 }
458 459
459 } // namespace content 460 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698