https://bugs.webkit.org/show_bug.cgi?id=67415
Text drawn via -webkit-background-clip:text is blurry at device scale factors >1.0
-and corresponding-
<rdar://problem/10060379>
Reviewed by Darin Adler.
New helper function RenderBoxModelObject scales the mask image by the
deviceScaleFactor to get an image of the appropriate resolution. It also scales
the image's GraphicsContext so that the clip is set up on the same scale. Back in
paintFillLayerExtended() we still clip the image to the original maskRect to get
everything scaled back to the appropriate size.
* rendering/RenderBoxModelObject.cpp:
(WebCore::createDeviceScaledImageBuffer):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
Make the deviceScaleFactor convenience function just a namespace-level function in
Page rather than a static member or Page.
* page/Page.cpp:
(WebCore::deviceScaleFactor):
* page/Page.h:
Pre-existing callers of Page::deviceScaleFactor(Frame*) must now use
WebCore::deviceScaleFactor(Frame*)
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageSizeForError):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::drawPlatformResizerImage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index 07ecb66..f63dd37 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -86,7 +86,7 @@
IntSize imageSize;
if (newImage->willPaintBrokenImage()) {
- float deviceScaleFactor = Page::deviceScaleFactor(frame());
+ float deviceScaleFactor = WebCore::deviceScaleFactor(frame());
pair<Image*, float> brokenImageAndImageScaleFactor = newImage->brokenImage(deviceScaleFactor);
imageSize = brokenImageAndImageScaleFactor.first->size();
imageSize.scale(1 / brokenImageAndImageScaleFactor.second);
@@ -277,7 +277,7 @@
RefPtr<Image> image = m_imageResource->image();
if (m_imageResource->errorOccurred() && !image->isNull() && usableWidth >= image->width() && usableHeight >= image->height()) {
- float deviceScaleFactor = Page::deviceScaleFactor(frame());
+ float deviceScaleFactor = WebCore::deviceScaleFactor(frame());
// Call brokenImage() explicitly to ensure we get the broken image icon at the appropriate resolution.
pair<Image*, float> brokenImageAndImageScaleFactor = m_imageResource->cachedImage()->brokenImage(deviceScaleFactor);
image = brokenImageAndImageScaleFactor.first;