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

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: 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/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index be60a19413468e7bca9090760b360de78b511651..4774476f6d4539f45d4d61196ee8bc155fbcec47 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -175,3 +175,25 @@ void GpuChannelManager::LoseAllContexts() {
void GpuChannelManager::OnLoseAllContexts() {
gpu_channels_.clear();
}
+
+gfx::GLSurface* GpuChannelManager::AllocMakeCurrentSurface() {
+ if (make_current_surface_.get()) {
+ make_current_surface_->AddRef();
+ } else {
+ make_current_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(
+ false, gfx::Size(1, 1));
+ }
+ return make_current_surface_.get();
+}
+
+void GpuChannelManager::ReleaseMakeCurrentSurface() {
+ if (make_current_surface_.get()) {
+ if (make_current_surface_->HasOneRef()) {
piman 2012/09/25 00:12:18 This is bogus, because you don't have a way to kno
hshi1 2012/09/25 00:26:34 Done.
+ make_current_surface_->Destroy();
+ make_current_surface_ = NULL;
+ } else {
+ make_current_surface_->Release();
+ }
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698