https://bugs.webkit.org/show_bug.cgi?id=92327
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 20:33:56 +0000 (20:33 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 20:33:56 +0000 (20:33 +0000)
commit1c81217a6c329c285e942162ebd0759d75fa791c
tree8c571c6bd329eb797e0152a61743ef002c7cb676
parent5da7094447f073f9b6e3e0cfe02359f6ea760f08
https://bugs.webkit.org/show_bug.cgi?id=92327
-webkit-background-clip:text is blurry in WebKit 1 apps when
deviceScaleFactor > 1
-and corresponding-
<rdar://problem/11683788>

Reviewed by Simon Fraser.

Source/WebCore:

The bug here is that the code to make createCompatibleBuffer() HiDPI-savvy
assumed that the deviceScaleFactor would always be baked into the CTM of the
GraphicsContext. But that is NOT the case in WebKit 1.

createCompatibleBuffer() is used for clip text and gradients.

Now getCTM() takes a parameter indicating whether the result should definitely
include the device scale, or if it should possibly included the device scale,
which is the option that matches old behavior.
* platform/graphics/GraphicsContext.h:
(GraphicsContext):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/openvg/GraphicsContextOpenVG.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::getCTM):
* platform/graphics/wx/GraphicsContextWx.cpp:
(WebCore::GraphicsContext::getCTM):

Actually use the new parameter in the CG implementation. Use CG API to get a
matrix that definitely includes the device scale when that is required.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::getCTM):

Remove some symbol cruft that doesn't seem to require a replacement.
* WebCore.exp.in:

Use DefinitelyIncludeDeviceScale when getting the CTM in the buggy spot.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::createCompatibleBuffer):

The ImageBuffer for gradients is created using createCompatibleBuffer(), and since
createCompatibleBuffer() now uses getCTM(DefinitelyIncludeDeviceScale) to
determine appropriate sizing, drawPattern() should use that same matrix to
determine pattern sizing.
* platform/graphics/GeneratorGeneratedImage.cpp:
(WebCore::GeneratorGeneratedImage::drawPattern):

LayoutTests:

* fast/hidpi/gradient-with-scaled-ancestor.html: Added.
* platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.png: Added.
* platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/hidpi/gradient-with-scaled-ancestor.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp