WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
92794
[chromium] deviceViewportSize cleanup
https://bugs.webkit.org/show_bug.cgi?id=92794
Summary
[chromium] deviceViewportSize cleanup
Alexandre Elias
Reported
2012-07-31 15:17:13 PDT
[chromium] deviceViewportSize cleanup
Attachments
Patch
(17.13 KB, patch)
2012-07-31 15:29 PDT
,
Alexandre Elias
no flags
Details
Formatted Diff
Diff
Patch
(46.78 KB, patch)
2012-08-01 15:57 PDT
,
Alexandre Elias
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Alexandre Elias
Comment 1
2012-07-31 15:29:10 PDT
Created
attachment 155646
[details]
Patch
Alexandre Elias
Comment 2
2012-07-31 15:30:01 PDT
I haven't updated all the tests yet, I'll do it when this change is confirmed OK.
WebKit Review Bot
Comment 3
2012-07-31 15:33:48 PDT
Please wait for approval from
abarth@webkit.org
,
dglazkov@chromium.org
,
fishd@chromium.org
,
jamesr@chromium.org
or
tkent@chromium.org
before submitting, as this patch contains changes to the Chromium public API. See also
https://trac.webkit.org/wiki/ChromiumWebKitAPI
.
WebKit Review Bot
Comment 4
2012-07-31 15:59:14 PDT
Comment on
attachment 155646
[details]
Patch
Attachment 155646
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/13390950
Adrienne Walker
Comment 5
2012-08-01 12:53:32 PDT
Comment on
attachment 155646
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155646&action=review
> Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:-808 > if (CCLayerImpl* clipLayer = m_rootScrollLayerImpl->parent()) { > - if (clipLayer->masksToBounds()) > + // Compensate for non-overlay scrollbars. > + if (clipLayer->masksToBounds()) { > viewBounds = clipLayer->bounds(); > + viewBounds.scale(m_deviceScaleFactor); > + } > } > viewBounds.scale(1 / m_pageScaleDelta); > - viewBounds.scale(m_deviceScaleFactor);
I don't understand how this math is consistent with your ChangeLog description. If layoutViewportSize * deviceScale != deviceViewportSize, then why can you multiply clipLayer bounds * deviceScale to be clipped physical pixels?
> Source/WebKit/chromium/src/WebLayerTreeView.cpp:118 > + if (deviceViewportSize().isEmpty() && !layoutViewportSize().isEmpty()) { > + IntSize deviceViewportSize = layoutViewportSize(); > + deviceViewportSize.scale(deviceScaleFactor); > + setViewportSize(layoutViewportSize(), deviceViewportSize); > + }
Re: temporary scaffolding. Are you sure that setDeviceScaleFactor is always called after setViewportSize?
Alexandre Elias
Comment 6
2012-08-01 15:57:22 PDT
Created
attachment 155910
[details]
Patch Changed scaffolding, updated unit tests
Alexandre Elias
Comment 7
2012-08-01 15:57:53 PDT
(In reply to
comment #5
)
> (From update of
attachment 155646
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=155646&action=review
> > > Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:-808 > > if (CCLayerImpl* clipLayer = m_rootScrollLayerImpl->parent()) { > > - if (clipLayer->masksToBounds()) > > + // Compensate for non-overlay scrollbars. > > + if (clipLayer->masksToBounds()) { > > viewBounds = clipLayer->bounds(); > > + viewBounds.scale(m_deviceScaleFactor); > > + } > > } > > viewBounds.scale(1 / m_pageScaleDelta); > > - viewBounds.scale(m_deviceScaleFactor); > > I don't understand how this math is consistent with your ChangeLog description. If layoutViewportSize * deviceScale != deviceViewportSize, then why can you multiply clipLayer bounds * deviceScale to be clipped physical pixels?
I was also uncertain about this part, but I've convinced myself that it's correct. clipLayer bounds still remains (and has to remain) closely related to deviceViewportSize. Multiplying it by deviceScaleFactor will do the right thing.
> > > Source/WebKit/chromium/src/WebLayerTreeView.cpp:118 > > + if (deviceViewportSize().isEmpty() && !layoutViewportSize().isEmpty()) { > > + IntSize deviceViewportSize = layoutViewportSize(); > > + deviceViewportSize.scale(deviceScaleFactor); > > + setViewportSize(layoutViewportSize(), deviceViewportSize); > > + } > > Re: temporary scaffolding. Are you sure that setDeviceScaleFactor is always called after setViewportSize?
You're right, it seems that in Aura setDeviceScaleFactor is never called at all, and it's relying on the default value of 1. I changed the scaffolding appropriately.
Adrienne Walker
Comment 8
2012-08-01 16:26:02 PDT
Comment on
attachment 155910
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=155910&action=review
> Source/WebKit/chromium/src/WebLayerTreeView.cpp:100 > + if (!deviceViewportSize.isEmpty()) > + m_private->layerTreeHost()->setViewportSize(layoutViewportSize, deviceViewportSize); > + else > + m_private->layerTreeHost()->setViewportSize(layoutViewportSize, layoutViewportSize);
I know it's just temporary, but you need to handle non-1 device scale factors to not break Aura in the meantime. Would it be easier to just ignore this deviceViewportSize parameter in all cases until the Chromium side of this change lands, and just call m_private->layerTreeHost()->setViewportSize whenever layoutViewportSize or deviceScale changes?
Alexandre Elias
Comment 9
2012-08-01 16:28:39 PDT
The root compositor in Aura currently has its own device scale implementation and does not rely on the CC functionality. I tested with Linux Aura with "--force-device-scale-factor=2 --force-compositing-mode" and the display looked the same as without my patch.
Adrienne Walker
Comment 10
2012-08-01 17:37:52 PDT
(In reply to
comment #9
)
> The root compositor in Aura currently has its own device scale implementation and does not rely on the CC functionality. I tested with Linux Aura with "--force-device-scale-factor=2 --force-compositing-mode" and the display looked the same as without my patch.
I don't understand how that could be. With --force-device-scale-factor=2, layoutViewport != deviceViewport. The deviceViewportSize is used for setting the root surface content rect, so this seems like it could cause visibility or occlusion errors.
Alexandre Elias
Comment 11
2012-08-01 18:52:58 PDT
The renderer compositor uses the WebViewImpl call I changed as part of this patch. For the browser compositor, there is no call to WebLayerTreeView::setDeviceScaleFactor anywhere in the chromium repository.
Adrienne Walker
Comment 12
2012-08-02 09:17:47 PDT
Comment on
attachment 155910
[details]
Patch (In reply to
comment #11
)
> The renderer compositor uses the WebViewImpl call I changed as part of this patch. For the browser compositor, there is no call to WebLayerTreeView::setDeviceScaleFactor anywhere in the chromium repository.
Thanks for being patient with my worries about breaking changes. I misunderstood how device scale worked for the browser compositor. R=me.
WebKit Review Bot
Comment 13
2012-08-02 17:51:55 PDT
Comment on
attachment 155910
[details]
Patch Clearing flags on attachment: 155910 Committed
r124543
: <
http://trac.webkit.org/changeset/124543
>
WebKit Review Bot
Comment 14
2012-08-02 17:52:01 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug