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

Issue 1513053002: WIP - Gutterless resize on Windows

Created:
5 years ago by ericrk
Modified:
5 years ago
Reviewers:
piman
CC:
chromium-reviews, tdanderson+views_chromium.org, sadrul, yusukes+watch_chromium.org, vmpstr+watch_chromium.org, Ian Vollick, tfarina, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, shuchen+watch_chromium.org, piman+watch_chromium.org, kalyank, cc-bugs_chromium.org, James Su, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This CL generalizes the WindowResizeHelper which was used on mac to support windows (and other impls as well). This class provides a nested run loop which can be used to produce a frame while something is blocking our main run loop (for instance, during WM_SIZE on windows). I'll add a follow-up patch to handle linux, which should be able to share most of this, but likely needs some custom logic. With this in place, our guttering is much much less. There are two follow-ups which make guttering very hard to notice: - Change the contents web view background to match the window background, so we don't draw jarring black bars when the browser gets ahead of the renderer. - Change the toolbar strip at the top to not indicate that it is transparent. This currently causes us to clear the background to black, and this black strip is visible when we get the very small amount of guttering we're left with. BUG= CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : feedback #

Patch Set 4 : feedback #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -557 lines) Patch
M base/threading/thread_restrictions.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/frame/contents_web_view.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 2 chunks +6 lines, -3 lines 0 comments Download
M content/browser/compositor/browser_compositor_view_mac.mm View 1 3 chunks +3 lines, -3 lines 0 comments Download
M content/browser/gpu/browser_gpu_channel_host_factory.h View 1 2 1 chunk +1 line, -0 lines 1 comment Download
M content/browser/gpu/browser_gpu_channel_host_factory.cc View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
A + content/browser/renderer_host/render_widget_resize_helper.h View 1 4 chunks +7 lines, -7 lines 0 comments Download
A + content/browser/renderer_host/render_widget_resize_helper.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
D content/browser/renderer_host/render_widget_resize_helper_mac.h View 1 1 chunk +0 lines, -48 lines 0 comments Download
D content/browser/renderer_host/render_widget_resize_helper_mac.cc View 1 1 chunk +0 lines, -46 lines 0 comments Download
M content/common/gpu/client/gpu_channel_host.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/common/gpu/client/gpu_channel_host.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/content_browser.gypi View 1 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/accelerated_widget_mac/BUILD.gn View 1 1 chunk +0 lines, -2 lines 0 comments Download
M ui/accelerated_widget_mac/accelerated_widget_mac.gyp View 1 1 chunk +0 lines, -2 lines 0 comments Download
D ui/accelerated_widget_mac/window_resize_helper_mac.h View 1 1 chunk +0 lines, -82 lines 0 comments Download
D ui/accelerated_widget_mac/window_resize_helper_mac.cc View 1 1 chunk +0 lines, -318 lines 0 comments Download
M ui/aura/window_tree_host.cc View 1 3 chunks +13 lines, -2 lines 0 comments Download
M ui/base/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M ui/base/ui_base.gyp View 1 1 chunk +2 lines, -0 lines 0 comments Download
A + ui/base/window_resize_helper.h View 1 5 chunks +14 lines, -14 lines 0 comments Download
A + ui/base/window_resize_helper.cc View 1 4 chunks +12 lines, -12 lines 0 comments Download
M ui/compositor/compositor.h View 1 2 3 3 chunks +21 lines, -0 lines 0 comments Download
M ui/compositor/compositor.cc View 1 2 3 3 chunks +36 lines, -0 lines 2 comments Download
M ui/views/cocoa/bridged_native_widget.h View 1 1 chunk +1 line, -1 line 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 3 chunks +3 lines, -3 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_win.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc View 1 2 3 chunks +35 lines, -0 lines 1 comment Download

Messages

Total messages: 7 (3 generated)
ericrk
Here's a first WIP for drastically reducing guttering on windows. Let me know how this ...
5 years ago (2015-12-10 23:08:43 UTC) #4
piman
Feedback in a few places. I think this CL would handle the UI resize, but ...
5 years ago (2015-12-11 07:53:12 UTC) #5
ericrk
Thanks for the feedback! I think it's best to save the renderer sync part for ...
5 years ago (2015-12-15 00:25:03 UTC) #6
piman
5 years ago (2015-12-15 07:15:36 UTC) #7
https://codereview.chromium.org/1513053002/diff/60001/content/browser/gpu/bro...
File content/browser/gpu/browser_gpu_channel_host_factory.h (right):

https://codereview.chromium.org/1513053002/diff/60001/content/browser/gpu/bro...
content/browser/gpu/browser_gpu_channel_host_factory.h:34:
scoped_refptr<base::SingleThreadTaskRunner> TaskRunner() override;
nit: GetMainThreadTaskRunner() ? To parallel GetIOThreadTaskRunner.

https://codereview.chromium.org/1513053002/diff/60001/ui/compositor/composito...
File ui/compositor/compositor.cc (right):

https://codereview.chromium.org/1513053002/diff/60001/ui/compositor/composito...
ui/compositor/compositor.cc:58: // thread.
We have only one thread on the browser side now, so no need to post the task.

Actually you probably don't want to post the task, otherwise you could have a
race where the swap buffer callback arrives before you got a chance to execute
this task.

https://codereview.chromium.org/1513053002/diff/60001/ui/compositor/composito...
ui/compositor/compositor.cc:484: weak_ptr_factory_.GetWeakPtr()));
You don't need to post the task any more (see above).

https://codereview.chromium.org/1513053002/diff/60001/ui/views/widget/desktop...
File ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc (right):

https://codereview.chromium.org/1513053002/diff/60001/ui/views/widget/desktop...
ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc:968: const int
kPaintMsgTimeoutMS = 55;
Any specific reason for 55 vs 50?
My gut feeling is that we should use the same value on all platforms, unless
there is a good reason not to.

Powered by Google App Engine
This is Rietveld 408576698