Bug 158564 - [Threaded Compositor] Content and viewport sizes are mixed
Summary: [Threaded Compositor] Content and viewport sizes are mixed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 154070
  Show dependency treegraph
 
Reported: 2016-06-09 05:56 PDT by Carlos Garcia Campos
Modified: 2016-06-10 05:56 PDT (History)
3 users (show)

See Also:


Attachments
Patch (7.99 KB, patch)
2016-06-09 06:02 PDT, Carlos Garcia Campos
zan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-06-09 05:56:49 PDT
So, in ThreadedCoordinatedLayerTreeHost we have:

 - sizeDidChange: called when the main frame contents size changes, but that changes also the coordinator size
 - viewportSizeChanged: called when the viewport size changes, but doesn't change the coordinator size

this is very confusing not only because we are mixing both sizes, but also because sizeDidChange is used in all other layer tree host implementations as the viewport size.
Comment 1 Carlos Garcia Campos 2016-06-09 06:02:39 PDT
Created attachment 280916 [details]
Patch
Comment 2 Zan Dobersek 2016-06-10 01:19:57 PDT
Comment on attachment 280916 [details]
Patch

OK if Yoon approves.
Comment 3 Gwang Yoon Hwang 2016-06-10 05:24:21 PDT
Comment on attachment 280916 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=280916&action=review

> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:143
> +void ThreadedCoordinatedLayerTreeHost::contentsSizeChanged(const WebCore::IntSize& newSize)

I like this change which makes more clear.

> Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:172
> +void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& size)

But I think it would be better to use viewportSizeChanged, which provide more clear idea.
In this change, we will send same size to the CompositingCoordinator and Compositor which implies
our contents size and viewport sile will be same all the time.
But it is not true when we are in the fixed layout.
Comment 4 Carlos Garcia Campos 2016-06-10 05:29:25 PDT
(In reply to comment #3)
> Comment on attachment 280916 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=280916&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:143
> > +void ThreadedCoordinatedLayerTreeHost::contentsSizeChanged(const WebCore::IntSize& newSize)
> 
> I like this change which makes more clear.
> 
> > Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:172
> > +void ThreadedCoordinatedLayerTreeHost::sizeDidChange(const WebCore::IntSize& size)
> 
> But I think it would be better to use viewportSizeChanged, which provide
> more clear idea.
> In this change, we will send same size to the CompositingCoordinator and
> Compositor which implies
> our contents size and viewport sile will be same all the time.
> But it is not true when we are in the fixed layout.

Current code is what is confusing, because it uses a different name than all other LayerTreeHost implementation, and requires to add #ifdefed code to the drawing area code. There's a check to only update the size when the contents size changes in case of fixed layout.
Comment 5 Carlos Garcia Campos 2016-06-10 05:56:51 PDT
Committed r201923: <http://trac.webkit.org/changeset/201923>