Skip to content

Commit

Permalink
Move overscroll effect from the main thread to the compositor thread
Browse files Browse the repository at this point in the history
Don't handle events on the compositor thread on 10.6 because that
platform behaves differently (but still send the flag to Blink saying that
overscroll is disabled, even on 10.6, since that will have no effect).

BUG=133097

Review URL: https://codereview.chromium.org/831803002

Cr-Commit-Position: refs/heads/master@{#310219}
  • Loading branch information
ccameron-chromium authored and Commit bot committed Jan 7, 2015
1 parent b2edef9 commit a18c23a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableSandboxLogging,
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS)
switches::kEnableThreadedEventHandlingMac,
switches::kDisableThreadedEventHandlingMac,
#endif
#if defined(OS_WIN)
switches::kDisableDirectWrite,
Expand Down
6 changes: 5 additions & 1 deletion content/browser/renderer_host/render_view_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,12 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs(const GURL& url) {
prefs.pinch_overlay_scrollbar_thickness = 10;
}
#if defined(OS_MACOSX)
// This preference has the effect of disabling Blink's elastic overscroll,
// and may be removed when Blink's elastic overscroll implementation is
// removed.
// http://crbug.com/138003
prefs.rubber_banding_on_compositor_thread =
command_line.HasSwitch(switches::kEnableThreadedEventHandlingMac);
!command_line.HasSwitch(switches::kDisableThreadedEventHandlingMac);
#endif
prefs.use_solid_color_scrollbars = ui::IsOverlayScrollbarEnabled();

Expand Down
9 changes: 5 additions & 4 deletions content/public/common/content_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,11 @@ const char kEnableSpeechDispatcher[] = "enable-speech-dispatcher";
const char kDisableCoreAnimationPlugins[] =
"disable-core-animation-plugins";

// Allows input events to be handed on the compositor thread.
// This feature is under development, see http://crbug.com/138003.
extern const char kEnableThreadedEventHandlingMac[] =
"enable-threaded-event-handling-mac";
// Force all input events to be handled by Blink on thread. This will be removed
// once compositor thread events have stuck.
// http://crbug.com/138003
extern const char kDisableThreadedEventHandlingMac[] =
"disable-threaded-event-handling-mac";
#endif

#if defined(OS_WIN)
Expand Down
2 changes: 1 addition & 1 deletion content/public/common/content_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ CONTENT_EXPORT extern const char kEnableSpeechDispatcher[];

#if defined(OS_MACOSX) && !defined(OS_IOS)
extern const char kDisableCoreAnimationPlugins[];
extern const char kEnableThreadedEventHandlingMac[];
extern const char kDisableThreadedEventHandlingMac[];
#endif

#if defined(OS_WIN)
Expand Down
4 changes: 2 additions & 2 deletions content/renderer/render_thread_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ void RenderThreadImpl::Init() {

#if defined(OS_MACOSX) && !defined(OS_IOS)
is_elastic_overscroll_enabled_ =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableThreadedEventHandlingMac) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableThreadedEventHandlingMac) &&
base::mac::IsOSLionOrLater();
#else
is_elastic_overscroll_enabled_ = false;
Expand Down

0 comments on commit a18c23a

Please sign in to comment.