Bug 94935 - [chromium] High-DIP pixel test output should be the correct size and also work with --force-compositing-mode
Summary: [chromium] High-DIP pixel test output should be the correct size and also wor...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: alexst
URL:
Keywords:
: 93647 (view as bug list)
Depends on:
Blocks: 90192
  Show dependency treegraph
 
Reported: 2012-08-24 07:04 PDT by alexst
Modified: 2012-08-29 15:58 PDT (History)
7 users (show)

See Also:


Attachments
Patch (580.31 KB, patch)
2012-08-24 08:59 PDT, alexst
no flags Details | Formatted Diff | Diff
Patch (580.12 KB, patch)
2012-08-28 13:55 PDT, alexst
no flags Details | Formatted Diff | Diff
Patch (580.11 KB, patch)
2012-08-29 07:03 PDT, alexst
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alexst 2012-08-24 07:04:31 PDT
We need to output the results of hidpi tests ad device resolution, not layout resolution.
Comment 1 alexst 2012-08-24 08:59:35 PDT
Created attachment 160431 [details]
Patch
Comment 2 Terry Anderson 2012-08-24 10:36:41 PDT
Comment on attachment 160431 [details]
Patch

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

> LayoutTests/ChangeLog:9
> +        marking the files on other platforms as expected to fail until I can update them later 

Won't the expected render tree dumps also need to be updated since the size has changed from 800x600 to 1600x1200?
Comment 3 alexst 2012-08-24 10:50:55 PDT
Render tree should remain the same because the sizes in it are in px which are angular units and could map to different pixel resolutions depending on the device scale factor.
Comment 4 Terry Anderson 2012-08-24 10:59:52 PDT
*** Bug 93647 has been marked as a duplicate of this bug. ***
Comment 5 Dirk Pranke 2012-08-28 11:16:21 PDT
This patch looks plausible to me but I'm not close to how we're trying to handle the hidpi stuff.

James, does this look good to you?
Comment 6 Alexandre Elias 2012-08-28 11:26:23 PDT
Comment on attachment 160431 [details]
Patch

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

> Tools/DumpRenderTree/chromium/WebViewHost.cpp:1876
> +        int scaledX = static_cast<int>(static_cast<float>(m_paintRect.x) * deviceScaleFactor);

Seems odd to multiply here.  How about multiplying widgetSize by deviceScaleFactor instead?
Comment 7 alexst 2012-08-28 11:39:02 PDT
(In reply to comment #6)
> (From update of attachment 160431 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=160431&action=review
> 
> > Tools/DumpRenderTree/chromium/WebViewHost.cpp:1876
> > +        int scaledX = static_cast<int>(static_cast<float>(m_paintRect.x) * deviceScaleFactor);
> 
> Seems odd to multiply here.  How about multiplying widgetSize by deviceScaleFactor instead?

Well, m_paintRect is in layout units as well, so doing it after the invalidate rect math was done seemed like the least invasive change.
Comment 8 Alexandre Elias 2012-08-28 12:23:45 PDT
OK, seems reasonable.  In that case, I suggest moving the conversion into WebViewHost::paintRect instead.  Also, please use ceiling for the size scaling or you would miss a pixel for deviceScaleFactor = 1.5.
Comment 9 alexst 2012-08-28 13:55:57 PDT
Created attachment 161052 [details]
Patch
Comment 10 alexst 2012-08-28 14:26:33 PDT
(In reply to comment #8)
> OK, seems reasonable.  In that case, I suggest moving the conversion into WebViewHost::paintRect instead.  Also, please use ceiling for the size scaling or you would miss a pixel for deviceScaleFactor = 1.5.

Very good point, I added the ceil. Although, is it actually the case that it is used throughout the codebase? For example WebViewImpl seems to clamp when it scales the device viewport. I want to make sure I am not missing something and we are consistent.
Comment 11 Alexandre Elias 2012-08-28 14:43:04 PDT
The one in WebViewImpl is unfinished code. It doesn't make much sense to infer deviceViewportSize from layoutSize anyway (there is no way to get it correct -- the inference should be in the other direction).

For invalidation paint rects, it's definitely better to err on the side of bigger invalidations.
Comment 12 Alexandre Elias 2012-08-28 14:45:09 PDT
Comment on attachment 161052 [details]
Patch

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

> Tools/DumpRenderTree/chromium/WebViewHost.cpp:1844
> +    int scaledX = static_cast<int>(ceil(static_cast<float>(rect.x) * deviceScaleFactor));

Now you're losing a pixel in the other direction.  Please use a plain cast for the offset.
Comment 13 alexst 2012-08-28 14:48:58 PDT
(In reply to comment #12)
> (From update of attachment 161052 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=161052&action=review
> 
> > Tools/DumpRenderTree/chromium/WebViewHost.cpp:1844
> > +    int scaledX = static_cast<int>(ceil(static_cast<float>(rect.x) * deviceScaleFactor));
> 
> Now you're losing a pixel in the other direction.  Please use a plain cast for the offset.
Comment 14 alexst 2012-08-28 14:51:31 PDT
(In reply to comment #12)
> (From update of attachment 161052 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=161052&action=review
> 
> > Tools/DumpRenderTree/chromium/WebViewHost.cpp:1844
> > +    int scaledX = static_cast<int>(ceil(static_cast<float>(rect.x) * deviceScaleFactor));
> 
> Now you're losing a pixel in the other direction.  Please use a plain cast for the offset.

D'oh! Copy/paste, I'll address. thanks.
Comment 15 alexst 2012-08-29 07:03:45 PDT
Created attachment 161217 [details]
Patch
Comment 16 Alexandre Elias 2012-08-29 11:19:41 PDT
Looks good to me, thanks.  Someone with review power can r+.
Comment 17 WebKit Review Bot 2012-08-29 15:58:54 PDT
Comment on attachment 161217 [details]
Patch

Clearing flags on attachment: 161217

Committed r127061: <http://trac.webkit.org/changeset/127061>
Comment 18 WebKit Review Bot 2012-08-29 15:58:57 PDT
All reviewed patches have been landed.  Closing bug.