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

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..c6d28e09004edc0673978e1aedc434bd9f414c49 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -88,6 +88,10 @@ bool TextureImageTransportSurface::Initialize() {
texture.info, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
+ surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1));
+ if (!surface_.get())
+ return false;
+
if (!helper_->Initialize())
return false;
@@ -104,6 +108,11 @@ void TextureImageTransportSurface::Destroy() {
ReleaseParentStub();
}
+ if (surface_.get()) {
+ surface_->Destroy();
+ surface_ = NULL;
+ }
+
helper_->Destroy();
}
@@ -112,7 +121,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 +202,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 +344,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