WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
107342
Clean up device scale factor with Skia GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=107342
Summary
Clean up device scale factor with Skia GraphicsContext
Tien-Ren Chen
Reported
2013-01-18 16:59:32 PST
Clean up device scale factor with Skia GraphicsContext
Attachments
Patch
(260.66 KB, patch)
2013-01-18 17:16 PST
,
Tien-Ren Chen
no flags
Details
Formatted Diff
Diff
Patch
(260.72 KB, patch)
2013-01-18 17:27 PST
,
Tien-Ren Chen
no flags
Details
Formatted Diff
Diff
Patch
(254.89 KB, patch)
2013-01-18 18:29 PST
,
Tien-Ren Chen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Tien-Ren Chen
Comment 1
2013-01-18 17:16:51 PST
Created
attachment 183580
[details]
Patch
Tien-Ren Chen
Comment 2
2013-01-18 17:27:50 PST
Created
attachment 183581
[details]
Patch
WebKit Review Bot
Comment 3
2013-01-18 17:30:27 PST
Attachment 183581
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/edit..." exit_code: 1 LayoutTests/platform/chromium-mac-snowleopard/editing/spelling/grammar-markers-hidpi-composited-expected.png:0: Have to enable auto props in the subversion config file (/home/alancutter/.subversion/config "enable-auto-props = yes"). Have to set the svn:mime-type in the subversion config file (/home/alancutter/.subversion/config "*.png = svn:mime-type=image/png"). [image/png] [5] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Nico Weber
Comment 4
2013-01-18 17:55:31 PST
Comment on
attachment 183581
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=183581&action=review
> Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:615 > + int rasterScaleFactor = static_cast<int>(lroundf(effectiveScaleComponent(platformContext()->getTotalMatrix())));
This isn't able to differentiate between page zoom (user hits cmd-+ a few times) and device scale, is it? Like, if I zoom in often enough on a lowdpi screen to get >= 2x zoom, will spell marker size double all of a sudden?
Tien-Ren Chen
Comment 5
2013-01-18 18:02:23 PST
(In reply to
comment #4
)
> (From update of
attachment 183581
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=183581&action=review
> > > Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp:615 > > + int rasterScaleFactor = static_cast<int>(lroundf(effectiveScaleComponent(platformContext()->getTotalMatrix()))); > > This isn't able to differentiate between page zoom (user hits cmd-+ a few times) and device scale, is it? Like, if I zoom in often enough on a lowdpi screen to get >= 2x zoom, will spell marker size double all of a sudden?
Hmm, I think you're right. It would look bad if the appearance suddenly changes. My purpose was to make sure composited layer also get high resolution grammar markers. Then I guess the correct way to do it is to set the platform device scale factor somewhere near GraphicsLayerChromium::paint(). I'll discuss with compositor guys to figure out what is the best place.
Nico Weber
Comment 6
2013-01-18 18:09:53 PST
> My purpose was to make sure composited layer also get high resolution grammar markers. Then I guess the correct way to do it is to set the platform device scale factor somewhere near GraphicsLayerChromium::paint(). I'll discuss with compositor guys to figure out what is the best place.
That sounds like a better approach. Thanks!
Tien-Ren Chen
Comment 7
2013-01-18 18:29:31 PST
Created
attachment 183589
[details]
Patch
WebKit Review Bot
Comment 8
2013-01-18 18:33:17 PST
Attachment 183589
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/edit..." exit_code: 1 LayoutTests/platform/chromium-mac-snowleopard/editing/spelling/grammar-markers-hidpi-composited-expected.png:0: Have to enable auto props in the subversion config file (/home/alancutter/.subversion/config "enable-auto-props = yes"). Have to set the svn:mime-type in the subversion config file (/home/alancutter/.subversion/config "*.png = svn:mime-type=image/png"). [image/png] [5] Total errors found: 1 in 13 files If any of these errors are false positives, please file a bug against check-webkit-style.
Nico Weber
Comment 9
2013-01-18 18:34:10 PST
Comment on
attachment 183589
[details]
Patch This looks correct. lgtm, but I'm not a reviewer.
Nico Weber
Comment 10
2013-01-18 18:34:46 PST
(Make sure you appease the style bot though! Here's what it says: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/edit..." exit_code: 1 LayoutTests/platform/chromium-mac-snowleopard/editing/spelling/grammar-markers-hidpi-composited-expected.png:0: Have to enable auto props in the subversion config file (/home/alancutter/.subversion/config "enable-auto-props = yes"). Have to set the svn:mime-type in the subversion config file (/home/alancutter/.subversion/config "*.png = svn:mime-type=image/png"). [image/png] [5] Total errors found: 1 in 13 files )
Dana Jansens
Comment 11
2013-01-18 18:35:42 PST
Comment on
attachment 183589
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=183589&action=review
> Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:846 > + context.platformApplyDeviceScaleFactor(deviceScaleFactor());
Is this also correct when WebSettings::applyDeviceScaleFactorInCompositor is true?
Tien-Ren Chen
Comment 12
2013-01-18 18:38:52 PST
Hi Enne, I'm trying to set correct platform context device scale factor for composited layers, which is necessary for some decorations(such as grammar markers) to render correctly in high-resolution. I'm setting it in GraphicsLayerChromium's implementation of GraphicsContextPainter::paint(), does that sounds reasonable for you? Personally I find it logically wrong because it should be the underlying backend(the compositor) to decide the device scale factor on the GraphicsContext, not the content being rasterized(the GraphicsLayer). However it is the most simplistic way to make it work (GraphicsLayer::deviceScaleFactor() comes in handy). Do you have a better idea?
Tien-Ren Chen
Comment 13
2013-01-18 18:40:08 PST
(In reply to
comment #11
)
> (From update of
attachment 183589
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=183589&action=review
> > > Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:846 > > + context.platformApplyDeviceScaleFactor(deviceScaleFactor()); > > Is this also correct when WebSettings::applyDeviceScaleFactorInCompositor is true?
Yes, platformApplyDeviceScaleFactor doesn't change the matrix. It is its intended use. :)
Dana Jansens
Comment 14
2013-01-18 18:44:27 PST
Comment on
attachment 183589
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=183589&action=review
>>> Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp:846 >>> + context.platformApplyDeviceScaleFactor(deviceScaleFactor()); >> >> Is this also correct when WebSettings::applyDeviceScaleFactorInCompositor is true? > > Yes, platformApplyDeviceScaleFactor doesn't change the matrix. It is its intended use. :)
Ok thanks, this looks pretty reasonable to me.
Darin Adler
Comment 15
2013-04-09 09:41:14 PDT
Comment on
attachment 183589
[details]
Patch Skia-specific.
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