diff options
Diffstat (limited to 'chromium/content/browser/gpu/gpu_surface_tracker.cc')
-rw-r--r-- | chromium/content/browser/gpu/gpu_surface_tracker.cc | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/chromium/content/browser/gpu/gpu_surface_tracker.cc b/chromium/content/browser/gpu/gpu_surface_tracker.cc index 350e6f3831c..42ce146dd4d 100644 --- a/chromium/content/browser/gpu/gpu_surface_tracker.cc +++ b/chromium/content/browser/gpu/gpu_surface_tracker.cc @@ -10,57 +10,8 @@ #include "base/logging.h" -#if defined(TOOLKIT_GTK) -#include "base/bind.h" -#include "content/public/browser/browser_thread.h" -#include "ui/gfx/gtk_native_view_id_manager.h" -#endif // defined(TOOLKIT_GTK) - namespace content { -namespace { -#if defined(TOOLKIT_GTK) - -void ReleasePermanentXIDDispatcher( - const gfx::PluginWindowHandle& surface) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - - GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); - manager->ReleasePermanentXID(surface); -} - -// Implementation of SurfaceRef that allows GTK to ref and unref the -// surface with the GtkNativeViewManager. -class SurfaceRefPluginWindow : public GpuSurfaceTracker::SurfaceRef { - public: - SurfaceRefPluginWindow(const gfx::PluginWindowHandle& surface_ref); - private: - virtual ~SurfaceRefPluginWindow(); - gfx::PluginWindowHandle surface_; -}; - -SurfaceRefPluginWindow::SurfaceRefPluginWindow( - const gfx::PluginWindowHandle& surface) - : surface_(surface) { - if (surface_ != gfx::kNullPluginWindow) { - GtkNativeViewManager* manager = GtkNativeViewManager::GetInstance(); - if (!manager->AddRefPermanentXID(surface_)) { - LOG(ERROR) << "Surface " << surface << " cannot be referenced."; - } - } -} - -SurfaceRefPluginWindow::~SurfaceRefPluginWindow() { - if (surface_ != gfx::kNullPluginWindow) { - BrowserThread::PostTask(BrowserThread::UI, - FROM_HERE, - base::Bind(&ReleasePermanentXIDDispatcher, - surface_)); - } -} -#endif // defined(TOOLKIT_GTK) -} // anonymous - GpuSurfaceTracker::GpuSurfaceTracker() : next_surface_id_(1) { GpuSurfaceLookup::InitInstance(this); @@ -134,9 +85,6 @@ void GpuSurfaceTracker::SetSurfaceHandle(int surface_id, DCHECK(surface_map_.find(surface_id) != surface_map_.end()); SurfaceInfo& info = surface_map_[surface_id]; info.handle = handle; -#if defined(TOOLKIT_GTK) - info.surface_ref = new SurfaceRefPluginWindow(handle.handle); -#endif // defined(TOOLKIT_GTK) } gfx::GLSurfaceHandle GpuSurfaceTracker::GetSurfaceHandle(int surface_id) { |