Unreviewed, rolling out r191324.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Oct 2015 02:43:59 +0000 (02:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Oct 2015 02:43:59 +0000 (02:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150352

Shadowing CTM's state is not necessary (Requested by litherum
on #webkit).

Reverted changeset:

"Host GraphicsContext's CTM inside GraphicsContextState"
https://bugs.webkit.org/show_bug.cgi?id=150146
http://trac.webkit.org/changeset/191324

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191326 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h
Source/WebCore/platform/graphics/transforms/AffineTransform.h
Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h

index dab22a678b7885f502badcfb65515296482161e6..215f0440359e9ced82bbd7c8bedf59e521a78da4 100644 (file)
@@ -1,3 +1,17 @@
+2015-10-19  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r191324.
+        https://bugs.webkit.org/show_bug.cgi?id=150352
+
+        Shadowing CTM's state is not necessary (Requested by litherum
+        on #webkit).
+
+        Reverted changeset:
+
+        "Host GraphicsContext's CTM inside GraphicsContextState"
+        https://bugs.webkit.org/show_bug.cgi?id=150146
+        http://trac.webkit.org/changeset/191324
+
 2015-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Host GraphicsContext's CTM inside GraphicsContextState
index a8e49baa280bdb6eda93d34a6db4ea75bb1d4a0b..2b4a2f799f9f50525d9e98b5610c1c45d54aaa3e 100644 (file)
@@ -142,87 +142,6 @@ void GraphicsContext::restore()
     restorePlatformState();
 }
 
-void GraphicsContext::concatCTM(const AffineTransform& other)
-{
-    if (paintingDisabled())
-        return;
-
-    checkCTMInvariants();
-
-    m_state.ctm *= other;
-    concatPlatformCTM(other);
-
-    checkCTMInvariants();
-}
-
-void GraphicsContext::scale(float x, float y)
-{
-    if (paintingDisabled())
-        return;
-
-    checkCTMInvariants();
-
-    m_state.ctm.scale(x, y);
-    scalePlatformCTM(x, y);
-
-    checkCTMInvariants();
-}
-
-void GraphicsContext::rotate(float angle)
-{
-    if (paintingDisabled())
-        return;
-
-    checkCTMInvariants();
-
-    m_state.ctm.rotate(rad2deg(angle));
-    rotatePlatformCTM(angle);
-
-    checkCTMInvariants();
-}
-
-void GraphicsContext::translate(float x, float y)
-{
-    if (paintingDisabled())
-        return;
-
-    checkCTMInvariants();
-
-    m_state.ctm.translate(x, y);
-    translatePlatformCTM(x, y);
-
-    checkCTMInvariants();
-}
-
-void GraphicsContext::setCTM(const AffineTransform& other)
-{
-    if (paintingDisabled())
-        return;
-
-    checkCTMInvariants();
-
-    m_state.ctm = other;
-    setPlatformCTM(other);
-
-    checkCTMInvariants();
-}
-
-AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
-{
-    if (paintingDisabled())
-        return AffineTransform();
-
-    AffineTransform result;
-    if (includeScale == DefinitelyIncludeDeviceScale)
-        result = m_state.userToDeviceSpaceCTM * m_state.ctm;
-    else
-        result = m_state.ctm;
-
-    ASSERT(result.isEssentiallyEqualTo(getPlatformCTM(includeScale)));
-
-    return result;
-}
-
 void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace)
 {
     if (paintingDisabled())
@@ -376,8 +295,6 @@ void GraphicsContext::beginTransparencyLayer(float opacity)
 {
     beginPlatformTransparencyLayer(opacity);
     ++m_transparencyCount;
-
-    resetPlatformCTM();
 }
 
 void GraphicsContext::endTransparencyLayer()
@@ -737,8 +654,7 @@ void GraphicsContext::platformApplyDeviceScaleFactor(float)
 
 void GraphicsContext::applyDeviceScaleFactor(float deviceScaleFactor)
 {
-    scale(deviceScaleFactor, deviceScaleFactor);
-
+    scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
     platformApplyDeviceScaleFactor(deviceScaleFactor);
 }
 
index 78afb0727ab300b9bcf1c897e47aa61835e9ce62..1a9f995835a292aa96cb7f97b67e6fd6a6ac4499 100644 (file)
@@ -156,9 +156,6 @@ struct GraphicsContextState {
     CompositeOperator compositeOperator { CompositeSourceOver };
     BlendMode blendMode { BlendModeNormal };
 
-    AffineTransform userToDeviceSpaceCTM;
-    AffineTransform ctm;
-
     bool shouldAntialias : 1;
     bool shouldSmoothFonts : 1;
     bool antialiasedFontDilationEnabled : 1;
@@ -423,25 +420,18 @@ public:
     void canvasClip(const Path&, WindRule = RULE_EVENODD);
     void clipOut(const Path&);
 
-    WEBCORE_EXPORT void scale(const FloatSize& size) { scale(size.width(), size.height()); }
+    WEBCORE_EXPORT void scale(const FloatSize&);
     void rotate(float angleInRadians);
     void translate(const FloatSize& size) { translate(size.width(), size.height()); }
-    WEBCORE_EXPORT void scale(float x, float y);
     WEBCORE_EXPORT void translate(float x, float y);
 
     void setURLForRect(const URL&, const IntRect&);
 
-    void checkCTMInvariants() const
-    {
-        ASSERT(getCTM(DefinitelyIncludeDeviceScale).isEssentiallyEqualTo(getPlatformCTM(DefinitelyIncludeDeviceScale)));
-        ASSERT(getCTM(PossiblyIncludeDeviceScale).isEssentiallyEqualTo(getPlatformCTM(PossiblyIncludeDeviceScale)));
-    }
     void concatCTM(const AffineTransform&);
     void setCTM(const AffineTransform&);
-    void resetPlatformCTM();
 
     enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
-    AffineTransform getCTM(IncludeDeviceScale = PossiblyIncludeDeviceScale) const;
+    AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
 
 #if ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
     // This is needed when using accelerated-compositing in software mode, like in TextureMapper.
@@ -555,13 +545,6 @@ private:
     void setPlatformAlpha(float);
     void setPlatformCompositeOperation(CompositeOperator, BlendMode = BlendModeNormal);
 
-    void concatPlatformCTM(const AffineTransform&);
-    void scalePlatformCTM(float x, float y);
-    void rotatePlatformCTM(float);
-    void translatePlatformCTM(float, float);
-    void setPlatformCTM(const AffineTransform&);
-    AffineTransform getPlatformCTM(IncludeDeviceScale = PossiblyIncludeDeviceScale) const; // This is only computed to ASSERT() that the GraphicsContextState agrees with the underlying platform.
-
     void beginPlatformTransparencyLayer(float opacity);
     void endPlatformTransparencyLayer();
     static bool supportsTransparencyLayers();
index 002a09f7d4baca3e0c0dc350fc0f4b360414a49e..1db775c3a72b9c1ecf1018183a48cbdfb9d91a44 100644 (file)
@@ -133,7 +133,7 @@ public:
 
     enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
 
-    virtual PassNativeImagePtr nativeImageForCurrentFrame() { return nullptr; }
+    virtual PassNativeImagePtr nativeImageForCurrentFrame() { return 0; }
     virtual ImageOrientation orientationForCurrentFrame() { return ImageOrientation(); }
 
     // Accessors for native image formats.
index bc842f9265f0152f53e7f7bf25dfb154dc5a5441..93fb30c7e1a76022ff3c5580d4ce7949354c8cb7 100644 (file)
@@ -194,15 +194,7 @@ void GraphicsContext::platformDestroy()
     delete m_data;
 }
 
-void GraphicsContext::resetPlatformCTM()
-{
-    if (platformContext())
-        m_state.ctm = getPlatformCTM();
-    else
-        m_state.ctm.makeIdentity();
-}
-
-AffineTransform GraphicsContext::getPlatformCTM(IncludeDeviceScale) const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
 {
     if (paintingDisabled())
         return AffineTransform();
@@ -719,14 +711,14 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingM
     return result;
 }
 
-void GraphicsContext::translatePlatformCTM(float x, float y)
+void GraphicsContext::translate(float x, float y)
 {
     if (paintingDisabled())
         return;
 
     cairo_t* cr = platformContext()->cr();
     cairo_translate(cr, x, y);
-    m_data->translatePlatformCTM(x, y);
+    m_data->translate(x, y);
 }
 
 void GraphicsContext::setPlatformFillColor(const Color&, ColorSpace)
@@ -781,7 +773,7 @@ void GraphicsContext::setURLForRect(const URL&, const IntRect&)
     notImplemented();
 }
 
-void GraphicsContext::concatPlatformCTM(const AffineTransform& transform)
+void GraphicsContext::concatCTM(const AffineTransform& transform)
 {
     if (paintingDisabled())
         return;
@@ -789,10 +781,10 @@ void GraphicsContext::concatPlatformCTM(const AffineTransform& transform)
     cairo_t* cr = platformContext()->cr();
     const cairo_matrix_t matrix = cairo_matrix_t(transform);
     cairo_transform(cr, &matrix);
-    m_data->concatPlatformCTM(transform);
+    m_data->concatCTM(transform);
 }
 
-void GraphicsContext::setPlatformCTM(const AffineTransform& transform)
+void GraphicsContext::setCTM(const AffineTransform& transform)
 {
     if (paintingDisabled())
         return;
@@ -800,7 +792,7 @@ void GraphicsContext::setPlatformCTM(const AffineTransform& transform)
     cairo_t* cr = platformContext()->cr();
     const cairo_matrix_t matrix = cairo_matrix_t(transform);
     cairo_set_matrix(cr, &matrix);
-    m_data->setPlatformCTM(transform);
+    m_data->setCTM(transform);
 }
 
 void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
@@ -1011,22 +1003,22 @@ void GraphicsContext::clipOut(const Path& path)
     cairo_set_fill_rule(cr, savedFillRule);
 }
 
-void GraphicsContext::rotatePlatformCTM(float radians)
+void GraphicsContext::rotate(float radians)
 {
     if (paintingDisabled())
         return;
 
     cairo_rotate(platformContext()->cr(), radians);
-    m_data->rotatePlatformCTM(radians);
+    m_data->rotate(radians);
 }
 
-void GraphicsContext::scalePlatformCTM(float x, float y)
+void GraphicsContext::scale(const FloatSize& size)
 {
     if (paintingDisabled())
         return;
 
-    cairo_scale(platformContext()->cr(), x, y);
-    m_data->scalePlatformCTM(x, y);
+    cairo_scale(platformContext()->cr(), size.width(), size.height());
+    m_data->scale(size);
 }
 
 void GraphicsContext::clipOut(const FloatRect& r)
index 38cdeb3ed30fdaff59c0e441f2de130e36406265..b2d25d6a7ec5f05a810b56bd814c27db06f95a34 100644 (file)
@@ -67,24 +67,24 @@ public:
     void flush();
     void clip(const FloatRect&);
     void clip(const Path&);
-    void scalePlatformCTM(float, float);
-    void rotatePlatformCTM(float);
-    void translatePlatformCTM(float, float);
-    void concatPlatformCTM(const AffineTransform&);
-    void setPlatformCTM(const AffineTransform&);
+    void scale(const FloatSize&);
+    void rotate(float);
+    void translate(float, float);
+    void concatCTM(const AffineTransform&);
+    void setCTM(const AffineTransform&);
     void syncContext(cairo_t* cr);
 #else
     // On everything else, we do nothing.
-    void save() { }
-    void restore() { }
-    void flush() { }
-    void clip(const FloatRect&) { }
-    void clip(const Path&) { }
-    void scalePlatformCTM(float, float) { }
-    void rotatePlatformCTM(float) { }
-    void translatePlatformCTM(float, float) { }
-    void concatPlatformCTM(const AffineTransform&) { }
-    void setPlatformCTM(const AffineTransform&) { }
+    void save() {}
+    void restore() {}
+    void flush() {}
+    void clip(const FloatRect&) {}
+    void clip(const Path&) {}
+    void scale(const FloatSize&) {}
+    void rotate(float) {}
+    void translate(float, float) {}
+    void concatCTM(const AffineTransform&) {}
+    void setCTM(const AffineTransform&) {}
     void syncContext(cairo_t*) { }
 #endif
 
index 5477ccd13e88729f1d316e40405836d7cc564fbc..836e96e4cbb267f8efebb705445df661e7753d26 100644 (file)
@@ -104,16 +104,6 @@ CGColorSpaceRef linearRGBColorSpaceRef()
 }
 #endif
 
-void GraphicsContext::resetPlatformCTM()
-{
-    m_state.ctm = CGContextGetCTM(platformContext());
-#if PLATFORM(WIN) || PLATFORM(IOS)
-    m_state.userToDeviceSpaceCTM = static_cast<AffineTransform>(CGContextGetUserSpaceToDeviceSpaceTransform(platformContext())) * m_state.ctm.inverse();
-#else
-    m_state.userToDeviceSpaceCTM = CGContextGetDefaultUserSpaceToDeviceSpaceTransform(platformContext());
-#endif
-}
-
 void GraphicsContext::platformInit(CGContextRef cgContext)
 {
     m_data = new GraphicsContextPlatformPrivate(cgContext);
@@ -123,7 +113,6 @@ void GraphicsContext::platformInit(CGContextRef cgContext)
         setPlatformFillColor(fillColor(), fillColorSpace());
         setPlatformStrokeColor(strokeColor(), strokeColorSpace());
         setPlatformStrokeThickness(strokeThickness());
-        resetPlatformCTM();
     }
 }
 
@@ -165,7 +154,7 @@ void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSi
         return;
 
     CGContextRef context = platformContext();
-    GraphicsContextStateSaver stateSaver(*this);
+    CGContextStateSaver stateSaver(context);
 
 #if PLATFORM(IOS)
     // Anti-aliasing is on by default on the iPhone. Need to turn it off when drawing images.
@@ -279,7 +268,7 @@ void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const
         return;
 
     CGContextRef context = platformContext();
-    GraphicsContextStateSaver stateSaver(*this);
+    CGContextStateSaver stateSaver(context);
     CGContextClipToRect(context, destRect);
 
     setPlatformCompositeOperation(op, blendMode);
@@ -681,7 +670,7 @@ void GraphicsContext::fillPath(const Path& path)
             FloatRect rect = path.fastBoundingRect();
             FloatSize layerSize = getCTM().mapSize(rect.size());
 
-            CGLayerRef layer = CGLayerCreateWithContext(context, layerSize, nullptr);
+            CGLayerRef layer = CGLayerCreateWithContext(context, layerSize, 0);
             CGContextRef layerContext = CGLayerGetContext(layer);
 
             CGContextScaleCTM(layerContext, layerSize.width() / rect.width(), layerSize.height() / rect.height());
@@ -1264,52 +1253,52 @@ void GraphicsContext::clipOut(const Path& path)
     CGContextEOClip(platformContext());
 }
 
-void GraphicsContext::scalePlatformCTM(float x, float y)
+void GraphicsContext::scale(const FloatSize& size)
 {
     if (paintingDisabled())
         return;
-    CGContextScaleCTM(platformContext(), x, y);
-    m_data->scalePlatformCTM(x, y);
+    CGContextScaleCTM(platformContext(), size.width(), size.height());
+    m_data->scale(size);
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::rotatePlatformCTM(float angle)
+void GraphicsContext::rotate(float angle)
 {
     if (paintingDisabled())
         return;
     CGContextRotateCTM(platformContext(), angle);
-    m_data->rotatePlatformCTM(angle);
+    m_data->rotate(angle);
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::translatePlatformCTM(float x, float y)
+void GraphicsContext::translate(float x, float y)
 {
     if (paintingDisabled())
         return;
     CGContextTranslateCTM(platformContext(), x, y);
-    m_data->translatePlatformCTM(x, y);
+    m_data->translate(x, y);
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::concatPlatformCTM(const AffineTransform& transform)
+void GraphicsContext::concatCTM(const AffineTransform& transform)
 {
     if (paintingDisabled())
         return;
     CGContextConcatCTM(platformContext(), transform);
-    m_data->concatPlatformCTM(transform);
+    m_data->concatCTM(transform);
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::setPlatformCTM(const AffineTransform& transform)
+void GraphicsContext::setCTM(const AffineTransform& transform)
 {
     if (paintingDisabled())
         return;
     CGContextSetCTM(platformContext(), transform);
-    m_data->setPlatformCTM(transform);
+    m_data->setCTM(transform);
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-AffineTransform GraphicsContext::getPlatformCTM(IncludeDeviceScale includeScale) const
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
 {
     if (paintingDisabled())
         return AffineTransform();
index 9dab49568d8ea8fc1780ea350aa1b3f877e28505..8a5e287b4fcd83fa8a5932cc377e9885ac308d25 100644 (file)
@@ -53,16 +53,16 @@ public:
 
 #if PLATFORM(COCOA)
     // These methods do nothing on Mac.
-    void save() { }
-    void restore() { }
-    void flush() { }
-    void clip(const FloatRect&) { }
-    void clip(const Path&) { }
-    void scalePlatformCTM(float, float) { }
-    void rotatePlatformCTM(float) { }
-    void translatePlatformCTM(float, float) { }
-    void concatPlatformCTM(const AffineTransform&) { }
-    void setPlatformCTM(const AffineTransform&) { }
+    void save() {}
+    void restore() {}
+    void flush() {}
+    void clip(const FloatRect&) {}
+    void clip(const Path&) {}
+    void scale(const FloatSize&) {}
+    void rotate(float) {}
+    void translate(float, float) {}
+    void concatCTM(const AffineTransform&) {}
+    void setCTM(const AffineTransform&) {}
 #endif
 
 #if PLATFORM(WIN)
@@ -72,11 +72,11 @@ public:
     void flush();
     void clip(const FloatRect&);
     void clip(const Path&);
-    void scalePlatformCTM(float x, float y);
-    void rotatePlatformCTM(float);
-    void translatePlatformCTM(float, float);
-    void concatPlatformCTM(const AffineTransform&);
-    void setPlatformCTM(const AffineTransform&);
+    void scale(const FloatSize&);
+    void rotate(float);
+    void translate(float, float);
+    void concatCTM(const AffineTransform&);
+    void setCTM(const AffineTransform&);
 
     HDC m_hdc;
     bool m_shouldIncludeChildWindows;
index f1010942ead3f700ed6815c909e248fdb2e07c3b..fab562d92fb3014ddaa4040599be86d27cd58785 100644 (file)
@@ -30,7 +30,6 @@
 #include "PlatformExportMacros.h"
 #include <array>
 #include <wtf/FastMalloc.h>
-#include <wtf/MathExtras.h>
 
 #if USE(CG)
 typedef struct CGAffineTransform CGAffineTransform;
@@ -141,7 +140,6 @@ public:
         return (m_transform[1] == 0 && m_transform[2] == 0) || (m_transform[0] == 0 && m_transform[3] == 0);
     }
 
-    // FIXME: If you compare floats for equality, you're gonna have a bad time. We should delete this.
     bool operator== (const AffineTransform& m2) const
     {
         return (m_transform[0] == m2.m_transform[0]
@@ -154,21 +152,6 @@ public:
 
     bool operator!=(const AffineTransform& other) const { return !(*this == other); }
 
-    bool isEssentiallyEqualTo(const AffineTransform& m2, double epsilon = 0.001) const
-    {
-        // WTF::areEssentiallyEqual() doesn't work well in this case. That function is designed to allow for error
-        // which scales proportionately to the values. However, AffineTransforms are often rotated by pi/2, which
-        // are not exactly representable. This results in AffineTransform components which are close to, but not
-        // exactly equal to, zero. In this case, the error and the value are approximately equal, which leads to
-        // a false negative return.
-        return std::abs(m_transform[0] - m2.m_transform[0]) < epsilon
-            && std::abs(m_transform[1] - m2.m_transform[1]) < epsilon
-            && std::abs(m_transform[2] - m2.m_transform[2]) < epsilon
-            && std::abs(m_transform[3] - m2.m_transform[3]) < epsilon
-            && std::abs(m_transform[4] - m2.m_transform[4]) < epsilon
-            && std::abs(m_transform[5] - m2.m_transform[5]) < epsilon;
-    }
-
     // *this = *this * t (i.e., a multRight)
     AffineTransform& operator*=(const AffineTransform& t)
     {
index 35a792a21c66d614978e2b6c1cb7ce231b37a3b4..54cba34c6d3dfab5459e2845610d8a56f6778256 100644 (file)
@@ -171,24 +171,24 @@ void GraphicsContextPlatformPrivate::clip(const Path&)
     notImplemented();
 }
 
-void GraphicsContextPlatformPrivate::scalePlatformCTM(float x, float y)
+void GraphicsContextPlatformPrivate::scale(const FloatSize& size)
 {
     if (!m_hdc)
         return;
 
-    XFORM xform = TransformationMatrix().scaleNonUniform(x, y);
+    XFORM xform = TransformationMatrix().scaleNonUniform(size.width(), size.height());
     ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
 }
 
 static const double deg2rad = 0.017453292519943295769; // pi/180
 
-void GraphicsContextPlatformPrivate::rotatePlatformCTM(float degreesAngle)
+void GraphicsContextPlatformPrivate::rotate(float degreesAngle)
 {
     XFORM xform = TransformationMatrix().rotate(degreesAngle);
     ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
 }
 
-void GraphicsContextPlatformPrivate::translatePlatformCTM(float x , float y)
+void GraphicsContextPlatformPrivate::translate(float x , float y)
 {
     if (!m_hdc)
         return;
@@ -197,7 +197,7 @@ void GraphicsContextPlatformPrivate::translatePlatformCTM(float x , float y)
     ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
 }
 
-void GraphicsContextPlatformPrivate::concatPlatformCTM(const AffineTransform& transform)
+void GraphicsContextPlatformPrivate::concatCTM(const AffineTransform& transform)
 {
     if (!m_hdc)
         return;
@@ -206,7 +206,7 @@ void GraphicsContextPlatformPrivate::concatPlatformCTM(const AffineTransform& tr
     ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
 }
 
-void GraphicsContextPlatformPrivate::setPlatformCTM(const AffineTransform& transform)
+void GraphicsContextPlatformPrivate::setCTM(const AffineTransform& transform)
 {
     if (!m_hdc)
         return;
index 3eb9e77706f9862b2bc799436faa2e506bc5b64c..5fb052d4567da00bd82de21c9ad6901055d5d919 100644 (file)
@@ -216,13 +216,12 @@ static void drawAtPoint(NSString *string, NSPoint point, NSFont *font, NSColor *
         
         NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
         CGContextRef cgContext = static_cast<CGContextRef>([nsContext graphicsPort]);
+        GraphicsContext graphicsContext(cgContext);    
         
         // Safari doesn't flip the NSGraphicsContext before calling WebKit, yet WebCore requires a flipped graphics context.
         BOOL flipped = [nsContext isFlipped];
         if (!flipped)
             CGContextScaleCTM(cgContext, 1, -1);
-
-        GraphicsContext graphicsContext(cgContext);
             
         FontCascade webCoreFont(FontPlatformData(toCTFont(font), [font pointSize]), Antialiased);
         TextRun run(StringView(buffer.data(), length));
index f14de0dc029cbf1e2256c2615e781dce5be2cde3..9e0397c491a983c38ac4d39aba4000ba425dc746 100644 (file)
@@ -143,8 +143,6 @@ void CGContextSetCTM(CGContextRef, CGAffineTransform);
 void CGContextSetCompositeOperation(CGContextRef, CGCompositeOperation);
 void CGContextSetShouldAntialiasFonts(CGContextRef, bool shouldAntialiasFonts);
 void CGContextResetClip(CGContextRef);
-CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform(CGContextRef);
-CGAffineTransform CGContextGetDefaultUserSpaceToDeviceSpaceTransform(CGContextRef);
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
 void CGContextSetFontDilation(CGContextRef, CGSize);
 void CGContextSetFontRenderingStyle(CGContextRef, CGFontRenderingStyle);