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

Unified Diff: content/common/gpu/texture_image_transport_surface.cc

Issue 10916355: Use PBuffer to make TextureImageTransportSurface current. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/texture_image_transport_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « content/common/gpu/texture_image_transport_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698