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

Unified Diff: content/common/gpu/gpu_channel_manager.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: Minor polish - consistently use the get() accessor. 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/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index be60a19413468e7bca9090760b360de78b511651..1da6aecf2f3c82608fc57654592fc22c5d557c85 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -38,6 +38,10 @@ GpuChannelManager::GpuChannelManager(ChildThread* gpu_child_thread,
GpuChannelManager::~GpuChannelManager() {
gpu_channels_.clear();
+ if (default_offscreen_surface_.get()) {
+ default_offscreen_surface_->Destroy();
+ default_offscreen_surface_ = NULL;
+ }
}
gpu::gles2::ProgramCache* GpuChannelManager::program_cache() {
@@ -175,3 +179,11 @@ void GpuChannelManager::LoseAllContexts() {
void GpuChannelManager::OnLoseAllContexts() {
gpu_channels_.clear();
}
+
+gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
+ if (!default_offscreen_surface_.get()) {
+ default_offscreen_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
+ false, gfx::Size(1, 1));
+ }
+ return default_offscreen_surface_.get();
+}
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698