Diff
Modified: branches/safari-536.26-branch/LayoutTests/ChangeLog (124659 => 124660)
--- branches/safari-536.26-branch/LayoutTests/ChangeLog 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/LayoutTests/ChangeLog 2012-08-03 22:04:04 UTC (rev 124660)
@@ -1,5 +1,23 @@
2012-08-02 Lucas Forschler <[email protected]>
+ Merge 123912
+
+ 2012-07-27 Beth Dakin <[email protected]>
+
+ 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.
+
+ * 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.
+
+2012-08-02 Lucas Forschler <[email protected]>
+
Merge 122293
2012-07-10 Shinya Kawanaka <[email protected]>
Copied: branches/safari-536.26-branch/LayoutTests/fast/hidpi/gradient-with-scaled-ancestor.html (from rev 123912, trunk/LayoutTests/fast/hidpi/gradient-with-scaled-ancestor.html) (0 => 124660)
--- branches/safari-536.26-branch/LayoutTests/fast/hidpi/gradient-with-scaled-ancestor.html (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/fast/hidpi/gradient-with-scaled-ancestor.html 2012-08-03 22:04:04 UTC (rev 124660)
@@ -0,0 +1,3 @@
+<div style="-webkit-transform:scale(1.5); -webkit-transform-origin:top left;">
+<div style="height:300px;width:300px;background-image:-webkit-repeating-linear-gradient(top left, red 10%, blue 30%);border:1px solid">
+</div>
Copied: branches/safari-536.26-branch/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.png (from rev 123912, trunk/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.png)
(Binary files differ)
Copied: branches/safari-536.26-branch/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt (from rev 123912, trunk/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt) (0 => 124660)
--- branches/safari-536.26-branch/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt (rev 0)
+++ branches/safari-536.26-branch/LayoutTests/platform/mac/fast/hidpi/gradient-with-scaled-ancestor-expected.txt 2012-08-03 22:04:04 UTC (rev 124660)
@@ -0,0 +1,8 @@
+layer at (0,0) size 1184x585
+ RenderView at (0,0) size 800x585
+layer at (0,0) size 800x585
+ RenderBlock {HTML} at (0,0) size 800x585
+ RenderBody {BODY} at (8,8) size 784x569
+layer at (8,8) size 784x302
+ RenderBlock {DIV} at (0,0) size 784x302
+ RenderBlock {DIV} at (0,0) size 302x302 [border: (1px solid #000000)]
Modified: branches/safari-536.26-branch/Source/WebCore/ChangeLog (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/ChangeLog 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/ChangeLog 2012-08-03 22:04:04 UTC (rev 124660)
@@ -1,5 +1,62 @@
2012-08-02 Lucas Forschler <[email protected]>
+ Merge 123912
+
+ 2012-07-27 Beth Dakin <[email protected]>
+
+ 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.
+
+ 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):
+
+2012-08-02 Lucas Forschler <[email protected]>
+
Merge 122293
2012-07-10 Shinya Kawanaka <[email protected]>
Modified: branches/safari-536.26-branch/Source/WebCore/WebCore.exp.in (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/WebCore.exp.in 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/WebCore.exp.in 2012-08-03 22:04:04 UTC (rev 124660)
@@ -1319,7 +1319,6 @@
__ZNK7WebCore15GraphicsContext15platformContextEv
__ZNK7WebCore15GraphicsContext16paintingDisabledEv
__ZNK7WebCore15GraphicsContext20updatingControlTintsEv
-__ZNK7WebCore15GraphicsContext6getCTMEv
__ZNK7WebCore15ProgressTracker17estimatedProgressEv
__ZNK7WebCore15ProtectionSpace10serverTypeEv
__ZNK7WebCore15ProtectionSpace26receivesCredentialSecurelyEv
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -54,7 +54,7 @@
m_generator->adjustParametersForTiledDrawing(adjustedSize, adjustedSrcRect);
// Factor in the destination context's scale to generate at the best resolution
- AffineTransform destContextCTM = destContext->getCTM();
+ AffineTransform destContextCTM = destContext->getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
double xScale = fabs(destContextCTM.xScale());
double yScale = fabs(destContextCTM.yScale());
AffineTransform adjustedPatternCTM = patternTransform;
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -759,7 +759,7 @@
// resolution than one pixel per unit. Also set up a corresponding scale factor on the
// graphics context.
- AffineTransform transform = getCTM();
+ AffineTransform transform = getCTM(DefinitelyIncludeDeviceScale);
IntSize scaledSize(static_cast<int>(ceil(size.width() * transform.xScale())), static_cast<int>(ceil(size.height() * transform.yScale())));
OwnPtr<ImageBuffer> buffer = ImageBuffer::create(scaledSize, 1, ColorSpaceDeviceRGB, isAcceleratedContext() ? Accelerated : Unaccelerated);
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.h (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.h 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/GraphicsContext.h 2012-08-03 22:04:04 UTC (rev 124660)
@@ -413,8 +413,10 @@
void concatCTM(const AffineTransform&);
void setCTM(const AffineTransform&);
- AffineTransform getCTM() const;
+ enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
+ AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
+
#if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
// This is needed when using accelerated-compositing in software mode, like in TextureMapper.
void concat3DTransform(const TransformationMatrix&);
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -191,7 +191,7 @@
delete m_data;
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -1294,12 +1294,18 @@
m_data->m_userToDeviceTransformKnownToBeIdentity = false;
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
{
if (paintingDisabled())
return AffineTransform();
- return AffineTransform(CGContextGetCTM(platformContext()));
+ // The CTM usually includes the deviceScaleFactor except in WebKit 1 when the
+ // content is non-composited, since the scale factor is integrated at a lower
+ // level. To guarantee the deviceScale is included, we can use this CG API.
+ if (includeScale == DefinitelyIncludeDeviceScale)
+ return CGContextGetUserSpaceToDeviceSpaceTransform(platformContext());
+
+ return CGContextGetCTM(platformContext());
}
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect, RoundingMode roundingMode)
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -67,7 +67,7 @@
return m_data->baseSurface();
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -280,7 +280,7 @@
return m_data->p();
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -736,7 +736,7 @@
platformContext()->didDrawPath(path, paint);
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -1492,7 +1492,7 @@
GradientFill(dc, tv.data(), tv.size(), mesh.data(), mesh.size(), vertical ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H);
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();
Modified: branches/safari-536.26-branch/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp (124659 => 124660)
--- branches/safari-536.26-branch/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp 2012-08-03 22:03:20 UTC (rev 124659)
+++ branches/safari-536.26-branch/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp 2012-08-03 22:04:04 UTC (rev 124660)
@@ -475,7 +475,7 @@
clip(path);
}
-AffineTransform GraphicsContext::getCTM() const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
{
if (paintingDisabled())
return AffineTransform();