Chromium Code Reviews| Index: content/common/gpu/texture_image_transport_surface.cc |
| diff --git a/content/common/gpu/texture_image_transport_surface.cc b/content/common/gpu/texture_image_transport_surface.cc |
| index 789c38a3908f91859320e3d3dec5e124e93ff50b..41f2d6645577acda712561394072a8453dae44e6 100644 |
| --- a/content/common/gpu/texture_image_transport_surface.cc |
| +++ b/content/common/gpu/texture_image_transport_surface.cc |
| @@ -17,6 +17,7 @@ |
| #include "gpu/command_buffer/service/context_group.h" |
| #include "gpu/command_buffer/service/gpu_scheduler.h" |
| #include "gpu/command_buffer/service/texture_manager.h" |
| +#include "ui/gl/gl_surface_egl.h" |
| using gpu::gles2::ContextGroup; |
| using gpu::gles2::TextureManager; |
| @@ -88,7 +89,9 @@ bool TextureImageTransportSurface::Initialize() { |
| texture.info, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| } |
| - if (!helper_->Initialize()) |
| + surface_ = new gfx::PbufferGLSurfaceEGL(false, gfx::Size(1, 1)); |
|
piman
2012/09/18 00:19:42
This'll break because we don't have EGL on all pla
no sievers
2012/09/18 00:41:27
Done.
|
| + if (!helper_->Initialize() || |
| + !surface_->Initialize()) |
| return false; |
| const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| @@ -104,6 +107,11 @@ void TextureImageTransportSurface::Destroy() { |
| ReleaseParentStub(); |
| } |
| + if (surface_.get()) { |
| + surface_->Destroy(); |
| + surface_ = NULL; |
| + } |
| + |
| helper_->Destroy(); |
| } |
| @@ -112,7 +120,7 @@ bool TextureImageTransportSurface::Resize(const gfx::Size&) { |
| } |
| bool TextureImageTransportSurface::IsOffscreen() { |
| - return parent_stub_ ? parent_stub_->surface()->IsOffscreen() : true; |
| + return true; |
| } |
| bool TextureImageTransportSurface::OnMakeCurrent(gfx::GLContext* context) { |
| @@ -193,11 +201,11 @@ void* TextureImageTransportSurface::GetShareHandle() { |
| } |
| void* TextureImageTransportSurface::GetDisplay() { |
| - return parent_stub_ ? parent_stub_->surface()->GetDisplay() : NULL; |
| + return surface_.get() ? surface_->GetDisplay() : NULL; |
| } |
| void* TextureImageTransportSurface::GetConfig() { |
| - return parent_stub_ ? parent_stub_->surface()->GetConfig() : NULL; |
| + return surface_.get() ? surface_->GetConfig() : NULL; |
| } |
| void TextureImageTransportSurface::OnResize(gfx::Size size) { |
| @@ -335,11 +343,11 @@ gfx::Size TextureImageTransportSurface::GetSize() { |
| } |
| void* TextureImageTransportSurface::GetHandle() { |
| - return parent_stub_ ? parent_stub_->surface()->GetHandle() : NULL; |
| + return surface_.get() ? surface_->GetHandle() : NULL; |
| } |
| unsigned TextureImageTransportSurface::GetFormat() { |
| - return parent_stub_ ? parent_stub_->surface()->GetFormat() : 0; |
| + return surface_ ? surface_->GetFormat() : 0; |
| } |
| void TextureImageTransportSurface::OnSetFrontSurfaceIsProtected( |