WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
96940
A layout test to verify scaled composited layers have crisp text
https://bugs.webkit.org/show_bug.cgi?id=96940
Summary
A layout test to verify scaled composited layers have crisp text
Dana Jansens
Reported
2012-09-17 12:20:35 PDT
A layout test to verify scaled composited layers have crisp text
Attachments
Patch
(2.11 KB, patch)
2012-09-17 12:21 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(2.15 KB, patch)
2012-09-17 13:01 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(38.51 KB, patch)
2012-10-22 16:05 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(5.10 KB, patch)
2012-10-22 17:34 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(5.40 KB, patch)
2012-10-22 17:45 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(5.47 KB, patch)
2012-10-23 17:13 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch
(6.41 KB, patch)
2012-10-24 09:59 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Patch for landing
(6.52 KB, patch)
2012-10-24 10:32 PDT
,
Dana Jansens
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Dana Jansens
Comment 1
2012-09-17 12:21:17 PDT
Created
attachment 164437
[details]
Patch
James Robinson
Comment 2
2012-09-17 12:39:47 PDT
So the expectation here is that we'd raster at the higher scale instead of applying the transform in the compositor? What behavior would you expect if the scale and translate were applied as one big matrix?
Dana Jansens
Comment 3
2012-09-17 12:43:50 PDT
The expectation is that the contents of the composited layer contain the CSS transform, in exactly the same way as happens for device scale factor. If we had a scale and transform, I would expect the text to be crisp because the backing texture of the layer is scaled, and the compositor would apply the scale+transform during rendering to put crisp text on the screen at the appropriate place.
Dana Jansens
Comment 4
2012-09-17 12:44:39 PDT
(In reply to
comment #3
)
> The expectation is that the contents of the composited layer contain the CSS transform, in exactly the same way as happens for device scale factor. > > If we had a scale and transform, I would expect the text to be crisp because the backing texture of the layer is scaled, and the compositor would apply the scale+transform during rendering to put crisp text on the screen at the appropriate place.
s/transform/translate/ in that second paragraph.
Dana Jansens
Comment 5
2012-09-17 13:01:13 PDT
Created
attachment 164444
[details]
Patch this version of the test uses a translate instead of left/top. we can use this instead if you like.
James Robinson
Comment 6
2012-09-17 13:07:17 PDT
That's not the point. The question here is fundamentally about what scale to raster with when there's a compositor-applied transform. For deviceScale you're right that we should raster at the post-scaled value so we end up 1:1 to screen. For other transforms, it's much less clear what the right thing is. Rastering at the highest scale we see and then trying to downsample in the compositor does produce the highest quality, but uses a lot of time and memory. It sounds like you want to do a peephole optimization for the case where the compositing trigger and scale are on the same element but not address the more general case of a scale on an ancestor. That seems fine, but I'd like you to precisely define what the parameters for this will be. The other case to think about is when a scale is being animated (which is really common) - what scale do you want to raster at?
Dana Jansens
Comment 7
2012-09-17 13:13:46 PDT
(In reply to
comment #6
)
> That's not the point. The question here is fundamentally about what scale to raster with when there's a compositor-applied transform. For deviceScale you're right that we should raster at the post-scaled value so we end up 1:1 to screen. For other transforms, it's much less clear what the right thing is. Rastering at the highest scale we see and then trying to downsample in the compositor does produce the highest quality, but uses a lot of time and memory. It sounds like you want to do a peephole optimization for the case where the compositing trigger and scale are on the same element but not address the more general case of a scale on an ancestor. That seems fine, but I'd like you to precisely define what the parameters for this will be.
Oh! I kinda assumed transform() included the parent but right, it does not. It seems to me that it's a bug if we draw things fuzzy because of a webkit-transform on some ancestor (ie composited layer vs non), and that we should match what the output would look like if it was rendered in the NCCH instead.
> The other case to think about is when a scale is being animated (which is really common) - what scale do you want to raster at?
Right, Nat's concerned about causing a lot of painting, so I am proposing that we don't change the layer's contentsScale until animation completes, so we can avoid invalidations during the animation.
Adrienne Walker
Comment 8
2012-09-17 13:16:36 PDT
Is there any way to just make this a ref test? One has a composited layer with a scale, the other has a scale but goes into the root?
Simon Fraser (smfr)
Comment 9
2012-09-17 17:43:59 PDT
This sounds like a test for
bug 27684
. Why add a test before the bug is fixed?
Dana Jansens
Comment 10
2012-09-17 17:53:20 PDT
The fix for chromium's compositor is happening here:
https://codereview.chromium.org/10915313
Simon Fraser (smfr)
Comment 11
2012-09-17 18:18:11 PDT
Can't we fix it in cross-platform code?
James Robinson
Comment 12
2012-09-17 18:26:17 PDT
That's tricky - the cross-platform code gets a GraphicsContext passed in from the platform-dependent code via GraphicsLayerClient. This context has to be sized + scaled correctly by the compositor implementation. The question then becomes is the compositor implementation or cross-platform code in a better place to decide the scale+size for a given layer. My inclination is it's the mostly compositor implementation, since only it can make intelligent choices about resource use vs. time vs. quality tradeoffs. Cross-platform code can't really have any idea of what the impact of rastering at a higher resolution will be on a given backend or if it'll have any effect as all. That said part of the work could definitely be done in cross-platform code depending on how the exact solution works. For instance, if we want to make any scaling decisions based on animation progress I think doing it in cross-platform code makes sense.
Simon Fraser (smfr)
Comment 13
2012-09-18 10:02:39 PDT
(In reply to
comment #12
)
> That's tricky - the cross-platform code gets a GraphicsContext passed in from the platform-dependent code via GraphicsLayerClient. This context has to be sized + scaled correctly by the compositor implementation.
This is what GraphicsLayer::setContentsScale() is for.
> The question then becomes is the compositor implementation or cross-platform code in a better place to decide the scale+size for a given layer. My inclination is it's the mostly compositor implementation, since only it can make intelligent choices about resource use vs. time vs. quality tradeoffs.
True, but I think the cross-platform code is the best place to compute the ideal scale.
Dana Jansens
Comment 14
2012-10-22 16:05:31 PDT
Created
attachment 170012
[details]
Patch Two tests, one with and one without a surface
Adrienne Walker
Comment 15
2012-10-22 17:05:37 PDT
The font rasterization in that expected image looks really strange to my eyes. Is that really the correct result? Also, consider using a ref test, to check that font rasterization looks the same whether or not you create a render surface or not, and whether or not you create a layer or not.
WebKit Review Bot
Comment 16
2012-10-22 17:07:20 PDT
Comment on
attachment 170012
[details]
Patch
Attachment 170012
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/14500297
New failing tests: platform/chromium/virtual/softwarecompositing/text-on-scaled-layer.html platform/chromium/virtual/softwarecompositing/text-on-scaled-surface.html
Dana Jansens
Comment 17
2012-10-22 17:22:52 PDT
(In reply to
comment #15
)
> The font rasterization in that expected image looks really strange to my eyes. Is that really the correct result?
Probably not, this is from running it on precise. It's not fuzzy, so it's right in that regard.
> Also, consider using a ref test, to check that font rasterization looks the same whether or not you create a render surface or not, and whether or not you create a layer or not.
I'll have to learn about ref tests at last it seems. :)
Dana Jansens
Comment 18
2012-10-22 17:34:04 PDT
Created
attachment 170035
[details]
Patch Reftests instead of pixel results
Dana Jansens
Comment 19
2012-10-22 17:45:59 PDT
Created
attachment 170039
[details]
Patch Add softwarecompositing test expectations
Adrienne Walker
Comment 20
2012-10-22 18:11:00 PDT
I'm confused why these are expected-mismatch and not expected. Isn't the goal here to assert that the text with and without surfaces/layers is identical?
Dana Jansens
Comment 21
2012-10-23 08:27:30 PDT
Oh, I misread, thanks.
Dana Jansens
Comment 22
2012-10-23 17:13:50 PDT
Created
attachment 170272
[details]
Patch Proper ref tests that pass on my local machine
Build Bot
Comment 23
2012-10-23 22:45:01 PDT
Comment on
attachment 170272
[details]
Patch
Attachment 170272
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14569065
New failing tests: media/video-zoom.html compositing/text-on-scaled-layer.html
Dana Jansens
Comment 24
2012-10-24 09:59:46 PDT
Created
attachment 170418
[details]
Patch Add test expectations for mac
Adrienne Walker
Comment 25
2012-10-24 10:01:58 PDT
Comment on
attachment 170418
[details]
Patch R=me.
Dana Jansens
Comment 26
2012-10-24 10:32:47 PDT
Created
attachment 170426
[details]
Patch for landing
WebKit Review Bot
Comment 27
2012-10-24 11:10:44 PDT
Comment on
attachment 170426
[details]
Patch for landing Clearing flags on attachment: 170426 Committed
r132376
: <
http://trac.webkit.org/changeset/132376
>
WebKit Review Bot
Comment 28
2012-10-24 11:10:49 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