OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |