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

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

Issue 10984004: Use a singleton 1x1 offscreen surface for all TextureImageTransportSurface instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add the 1x1 surface into GpuChannelManager. 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
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 c6d28e09004edc0673978e1aedc434bd9f414c49..8e95c869193e490bb9b05461f8af68b04b40b597 100644
--- a/content/common/gpu/texture_image_transport_surface.cc
+++ b/content/common/gpu/texture_image_transport_surface.cc
@@ -88,8 +88,8 @@ 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())
+ surface_ = manager->AllocMakeCurrentSurface();
+ if (!surface_)
return false;
if (!helper_->Initialize())
@@ -108,8 +108,8 @@ void TextureImageTransportSurface::Destroy() {
ReleaseParentStub();
}
- if (surface_.get()) {
- surface_->Destroy();
+ if (surface_) {
+ helper_->manager()->ReleaseMakeCurrentSurface();
surface_ = NULL;
}
@@ -202,11 +202,11 @@ void* TextureImageTransportSurface::GetShareHandle() {
}
void* TextureImageTransportSurface::GetDisplay() {
- return surface_.get() ? surface_->GetDisplay() : NULL;
+ return surface_ ? surface_->GetDisplay() : NULL;
}
void* TextureImageTransportSurface::GetConfig() {
- return surface_.get() ? surface_->GetConfig() : NULL;
+ return surface_ ? surface_->GetConfig() : NULL;
}
void TextureImageTransportSurface::OnResize(gfx::Size size) {
@@ -344,7 +344,7 @@ gfx::Size TextureImageTransportSurface::GetSize() {
}
void* TextureImageTransportSurface::GetHandle() {
- return surface_.get() ? surface_->GetHandle() : NULL;
+ return surface_ ? surface_->GetHandle() : NULL;
}
unsigned TextureImageTransportSurface::GetFormat() {

Powered by Google App Engine
This is Rietveld 408576698