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

Unified Diff: content/browser/renderer_host/accelerated_surface_container_manager_mac.cc

Issue 9958100: Unobfuscate RWHVMac accelerated compositing code path by separating it from plugin code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 9 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/browser/renderer_host/accelerated_surface_container_manager_mac.cc
diff --git a/content/browser/renderer_host/accelerated_surface_container_manager_mac.cc b/content/browser/renderer_host/accelerated_surface_container_manager_mac.cc
index eb2757c4b18ca281fbdc485a7fd8c7dacf1735d9..ed88d3dbc757aebf7c53ff27a346ad058bbacf44 100644
--- a/content/browser/renderer_host/accelerated_surface_container_manager_mac.cc
+++ b/content/browser/renderer_host/accelerated_surface_container_manager_mac.cc
@@ -10,10 +10,7 @@
#include "ui/gfx/rect.h"
AcceleratedSurfaceContainerManagerMac::AcceleratedSurfaceContainerManagerMac()
- : current_id_(0),
- root_container_(NULL),
- root_container_handle_(gfx::kNullPluginWindow),
- gpu_rendering_active_(false) {
+ : current_id_(0) {
}
AcceleratedSurfaceContainerManagerMac::
@@ -29,10 +26,7 @@ AcceleratedSurfaceContainerManagerMac::AllocateFakePluginWindowHandle(
gfx::PluginWindowHandle res =
static_cast<gfx::PluginWindowHandle>(++current_id_);
plugin_window_to_container_map_.insert(std::make_pair(res, container));
- if (root) {
- root_container_ = container;
- root_container_handle_ = res;
- }
+ DCHECK(!root);
return res;
}
@@ -41,29 +35,11 @@ void AcceleratedSurfaceContainerManagerMac::DestroyFakePluginWindowHandle(
base::AutoLock lock(lock_);
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
- if (container) {
- if (container == root_container_) {
- root_container_ = NULL;
- root_container_handle_ = gfx::kNullPluginWindow;
- }
+ if (container)
delete container;
- }
plugin_window_to_container_map_.erase(id);
}
-bool AcceleratedSurfaceContainerManagerMac::IsRootContainer(
- gfx::PluginWindowHandle id) const {
- return root_container_handle_ != gfx::kNullPluginWindow &&
- root_container_handle_ == id;
-}
-
-void AcceleratedSurfaceContainerManagerMac::
- set_gpu_rendering_active(bool active) {
- if (gpu_rendering_active_ && !active)
- SetRootSurfaceInvalid();
- gpu_rendering_active_ = active;
-}
-
void AcceleratedSurfaceContainerManagerMac::SetSizeAndIOSurface(
gfx::PluginWindowHandle id,
int32 width,
@@ -157,19 +133,10 @@ void AcceleratedSurfaceContainerManagerMac::SetSurfaceWasPaintedTo(
container->set_was_painted_to(surface_handle, update_rect);
}
-void AcceleratedSurfaceContainerManagerMac::SetRootSurfaceInvalid() {
- base::AutoLock lock(lock_);
- if (root_container_)
- root_container_->set_surface_invalid();
-}
-
bool AcceleratedSurfaceContainerManagerMac::SurfaceShouldBeVisible(
gfx::PluginWindowHandle id) const {
base::AutoLock lock(lock_);
- if (IsRootContainer(id) && !gpu_rendering_active_)
- return false;
-
AcceleratedSurfaceContainerMac* container = MapIDToContainer(id);
return container && container->ShouldBeVisible();
}

Powered by Google App Engine
This is Rietveld 408576698