diff options
-rw-r--r-- | content/browser/gpu/gpu_data_manager_impl.cc | 19 | ||||
-rw-r--r-- | content/browser/gpu/gpu_data_manager_impl.h | 10 | ||||
-rw-r--r-- | content/browser/plugin_process_host.cc | 4 | ||||
-rw-r--r-- | ui/base/ui_base_switches.cc | 4 | ||||
-rw-r--r-- | ui/base/ui_base_switches.h | 1 | ||||
-rw-r--r-- | webkit/plugins/npapi/plugin_host.cc | 36 |
6 files changed, 26 insertions, 48 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 3c49377..53f91e9 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -19,7 +19,6 @@ #include "content/public/browser/gpu_data_manager_observer.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" -#include "ui/base/ui_base_switches.h" #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_switches.h" #include "webkit/plugins/plugin_switches.h" @@ -238,24 +237,6 @@ void GpuDataManagerImpl::AppendGpuCommandLine( } } -void GpuDataManagerImpl::AppendPluginCommandLine( - CommandLine* command_line) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK(command_line); - -#if defined(OS_MACOSX) - uint32 flags = GetGpuFeatureType(); - if ((flags & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableAcceleratedCompositing)) { - if (!command_line->HasSwitch( - switches::kDisableCompositedCoreAnimationPlugins)) - command_line->AppendSwitch( - switches::kDisableCompositedCoreAnimationPlugins); - } -#endif -} - void GpuDataManagerImpl::SetGpuFeatureType(GpuFeatureType feature_type) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UpdateGpuFeatureType(feature_type); diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index 7683373..3c665d1 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -46,18 +46,14 @@ class CONTENT_EXPORT GpuDataManagerImpl void AddLogMessage(Value* msg); - // Insert disable-feature switches corresponding to preliminary gpu feature - // flags into the renderer process command line. + // Inserting disable-feature switches into renderer process command-line + // in correspondence to preliminary gpu feature flags. void AppendRendererCommandLine(CommandLine* command_line); - // Insert switches into gpu process command line: kUseGL, + // Inserting switches into gpu process command-line: kUseGL, // kDisableGLMultisampling. void AppendGpuCommandLine(CommandLine* command_line); - // Insert switches into plugin process command line: - // kDisableCoreAnimationPlugins. - void AppendPluginCommandLine(CommandLine* command_line); - // This gets called when switching GPU might have happened. void HandleGpuSwitch(); diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index f355012..7a976e0 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -23,7 +23,6 @@ #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "content/browser/browser_child_process_host_impl.h" -#include "content/browser/gpu/gpu_data_manager_impl.h" #include "content/browser/plugin_service_impl.h" #include "content/common/child_process_host_impl.h" #include "content/common/plugin_messages.h" @@ -221,7 +220,6 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { switches::kDisableBreakpad, #if defined(OS_MACOSX) switches::kDisableCompositedCoreAnimationPlugins, - switches::kDisableCoreAnimationPlugins, #endif switches::kDisableLogging, switches::kEnableDCHECK, @@ -242,8 +240,6 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, arraysize(kSwitchNames)); - GpuDataManagerImpl::GetInstance()->AppendPluginCommandLine(cmd_line); - // If specified, prepend a launcher program to the command line. if (!plugin_launcher.empty()) cmd_line->PrependWrapper(plugin_launcher); diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc index b4c1ca3..9e106fc 100644 --- a/ui/base/ui_base_switches.cc +++ b/ui/base/ui_base_switches.cc @@ -66,10 +66,6 @@ const char kTouchOptimizedUIDisabled[] = "disabled"; #if defined(OS_MACOSX) const char kDisableCompositedCoreAnimationPlugins[] = "disable-composited-core-animation-plugins"; -// Disables using core animation in plugins. This is triggered when accelerated -// compositing is disabled. See http://crbug.com/122430 -const char kDisableCoreAnimationPlugins[] = - "disable-core-animation-plugins"; #endif #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h index 7f8de82..c8f3bc7 100644 --- a/ui/base/ui_base_switches.h +++ b/ui/base/ui_base_switches.h @@ -36,7 +36,6 @@ UI_EXPORT extern const char kTouchOptimizedUIEnabled[]; // convenient place where it can be shared between // src/webkit/plugins/npapi/ and src/content/plugin/ . UI_EXPORT extern const char kDisableCompositedCoreAnimationPlugins[]; -UI_EXPORT extern const char kDisableCoreAnimationPlugins[]; #endif #if defined(TOOLKIT_VIEWS) && defined(OS_LINUX) diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc index 23977e2..d8a17bb 100644 --- a/webkit/plugins/npapi/plugin_host.cc +++ b/webkit/plugins/npapi/plugin_host.cc @@ -54,15 +54,11 @@ static PluginInstance* FindInstance(NPP id) { } #if defined(OS_MACOSX) -// Returns true if Core Animation plugins are supported. This requires that the -// OS supports shared accelerated surfaces via IOSurface. This is true on Snow -// Leopard and higher. -static bool SupportsCoreAnimationPlugins() { +// Returns true if the OS supports shared accelerated surfaces via IOSurface. +// This is true on Snow Leopard and higher. +static bool SupportsSharingAcceleratedSurfaces() { if (base::mac::IsOSLeopardOrEarlier()) return false; - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableCoreAnimationPlugins)) - return false; // We also need to be running with desktop GL and not the software // OSMesa renderer in order to share accelerated surfaces between // processes. @@ -813,10 +809,23 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { rv = NPERR_NO_ERROR; break; } - case NPNVsupportsInvalidatingCoreAnimationBool: case NPNVsupportsCoreAnimationBool: { + // We only support the Core Animation model on 10.6 and higher + // TODO(stuartmorgan): Once existing CA plugins have implemented the + // invalidating version, remove support for this one. + NPBool* supports_model = reinterpret_cast<NPBool*>(value); + *supports_model = webkit::npapi::SupportsSharingAcceleratedSurfaces() ? + true : false; + rv = NPERR_NO_ERROR; + break; + } + case NPNVsupportsInvalidatingCoreAnimationBool: { + // The composited code path for this model only works on 10.6 and higher. + // The old direct-to-screen code path supports 10.5. NPBool* supports_model = reinterpret_cast<NPBool*>(value); - *supports_model = webkit::npapi::SupportsCoreAnimationPlugins(); + bool composited = webkit::npapi::UsingCompositedCoreAnimationPlugins(); + *supports_model = composited ? + webkit::npapi::SupportsSharingAcceleratedSurfaces() : true; rv = NPERR_NO_ERROR; break; } @@ -834,7 +843,6 @@ NPError NPN_GetValue(NPP id, NPNVariable variable, void* value) { case NPNVsupportsCompositingCoreAnimationPluginsBool: { NPBool* supports_compositing = reinterpret_cast<NPBool*>(value); *supports_compositing = - webkit::npapi::SupportsCoreAnimationPlugins() && webkit::npapi::UsingCompositedCoreAnimationPlugins(); rv = NPERR_NO_ERROR; break; @@ -901,9 +909,11 @@ NPError NPN_SetValue(NPP id, NPPVariable variable, void* value) { case NPPVpluginDrawingModel: { int model = reinterpret_cast<int>(value); if (model == NPDrawingModelCoreGraphics || - ((model == NPDrawingModelInvalidatingCoreAnimation || - model == NPDrawingModelCoreAnimation) && - webkit::npapi::SupportsCoreAnimationPlugins())) { + (model == NPDrawingModelInvalidatingCoreAnimation && + (webkit::npapi::SupportsSharingAcceleratedSurfaces() || + !webkit::npapi::UsingCompositedCoreAnimationPlugins())) || + (model == NPDrawingModelCoreAnimation && + webkit::npapi::SupportsSharingAcceleratedSurfaces())) { plugin->set_drawing_model(static_cast<NPDrawingModel>(model)); return NPERR_NO_ERROR; } |