Remove GraphicsContext constructor that takes shouldUseContextColors
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Sep 2014 01:53:47 +0000 (01:53 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Sep 2014 01:53:47 +0000 (01:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136421

Reviewed by Dan Bernstein.

* WebCore.exp.in:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContextState::GraphicsContextState):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::platformInit):
(WebCore::GraphicsContext::drawLinesForText):
As far as I can tell, the last user of this constructor died with WebNSStringDrawing.
Adjust all code to assume shouldUseContextColors=true.

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

index 0f51e42..2664e73 100644 (file)
@@ -1,5 +1,23 @@
 2014-08-31  Tim Horton  <timothy_horton@apple.com>
 
+        Remove GraphicsContext constructor that takes shouldUseContextColors
+        https://bugs.webkit.org/show_bug.cgi?id=136421
+
+        Reviewed by Dan Bernstein.
+
+        * WebCore.exp.in:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContextState::GraphicsContextState):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::platformInit):
+        (WebCore::GraphicsContext::drawLinesForText):
+        As far as I can tell, the last user of this constructor died with WebNSStringDrawing.
+        Adjust all code to assume shouldUseContextColors=true.
+
+2014-08-31  Tim Horton  <timothy_horton@apple.com>
+
         Remove unused ARMv6-specific #if branches in WebCore::canHyphenate
         https://bugs.webkit.org/show_bug.cgi?id=136420
 
index 2628ad7..4d10485 100644 (file)
@@ -546,6 +546,7 @@ __ZN7WebCore15GraphicsContext9clearRectERKNS_9FloatRectE
 __ZN7WebCore15GraphicsContext9drawImageEPNS_5ImageENS_10ColorSpaceERKNS_10FloatPointERKNS_20ImagePaintingOptionsE
 __ZN7WebCore15GraphicsContext9setShadowERKNS_9FloatSizeEfRKNS_5ColorENS_10ColorSpaceE
 __ZN7WebCore15GraphicsContext9translateEff
+__ZN7WebCore15GraphicsContextC1EP9CGContext
 __ZN7WebCore15GraphicsContextD1Ev
 __ZN7WebCore15GraphicsLayerCA10initializeEv
 __ZN7WebCore15GraphicsLayerCA10setFiltersERKNS_16FilterOperationsE
@@ -2246,7 +2247,6 @@ __ZN7WebCore12EventHandler9mouseDownEP7NSEvent
 __ZN7WebCore13getRawCookiesERKNS_21NetworkStorageSessionERKNS_3URLES5_RN3WTF6VectorINS_6CookieELm0ENS6_15CrashOnOverflowEEE
 __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
 __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_3URLES5_
-__ZN7WebCore15GraphicsContextC1EP9CGContext
 __ZN7WebCore15ResourceRequest41updateFromDelegatePreservingOldPropertiesERKS0_
 __ZN7WebCore16FontPlatformDataC1EP6NSFontfbbbNS_15FontOrientationENS_16FontWidthVariantE
 __ZN7WebCore16FontPlatformDataC2EP6NSFontfbbbNS_15FontOrientationENS_16FontWidthVariantE
@@ -2597,7 +2597,6 @@ __ZN7WebCore15GraphicsContext12drawBidiTextERKNS_4FontERKNS_7TextRunERKNS_10Floa
 __ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb
 __ZN7WebCore15GraphicsContext22setEmojiDrawingEnabledEb
 __ZN7WebCore15GraphicsContext23setIsAcceleratedContextEb
-__ZN7WebCore15GraphicsContextC1EP9CGContextb
 __ZN7WebCore15LegacyTileCache14drainLayerPoolEv
 __ZN7WebCore15LegacyTileCache20setLayerPoolCapacityEj
 __ZN7WebCore15ResourceRequest41updateFromDelegatePreservingOldPropertiesERKS0_
index 6eb1216..b93df3c 100644 (file)
@@ -100,21 +100,12 @@ private:
     bool m_interpolationQualityChanged;
 };
 
-#if !PLATFORM(IOS)
 GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext)
     : m_updatingControlTints(false)
     , m_transparencyCount(0)
 {
     platformInit(platformGraphicsContext);
 }
-#else
-GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext, bool shouldUseContextColors)
-    : m_updatingControlTints(false)
-    , m_transparencyCount(0)
-{
-    platformInit(platformGraphicsContext, shouldUseContextColors);
-}
-#endif
 
 GraphicsContext::~GraphicsContext()
 {
index bdbfbb7..c6f861d 100644 (file)
@@ -131,7 +131,6 @@ namespace WebCore {
             , blendMode(BlendModeNormal)
 #if PLATFORM(IOS)
             , emojiDrawingEnabled(true)
-            , shouldUseContextColors(true)
 #endif
             , shouldAntialias(true)
             , shouldSmoothFonts(true)
@@ -176,7 +175,6 @@ namespace WebCore {
 
 #if PLATFORM(IOS)
         bool emojiDrawingEnabled : 1;
-        bool shouldUseContextColors : 1;
 #endif
         bool shouldAntialias : 1;
         bool shouldSmoothFonts : 1;
@@ -223,11 +221,7 @@ namespace WebCore {
     class GraphicsContext {
         WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
     public:
-#if !PLATFORM(IOS)
         WEBCORE_EXPORT GraphicsContext(PlatformGraphicsContext*);
-#else
-        WEBCORE_EXPORT GraphicsContext(PlatformGraphicsContext*, bool shouldUseContextColors = true);
-#endif
         WEBCORE_EXPORT ~GraphicsContext();
 
         WEBCORE_EXPORT PlatformGraphicsContext* platformContext() const;
@@ -550,7 +544,7 @@ namespace WebCore {
         static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle);
 
     private:
-        void platformInit(PlatformGraphicsContext*, bool shouldUseContextColors = false);
+        void platformInit(PlatformGraphicsContext*);
         void platformDestroy();
 
 #if PLATFORM(WIN) && !USE(WINGDI)
index 213e27a..1e3aa75 100644 (file)
@@ -112,24 +112,15 @@ CGColorSpaceRef linearRGBColorSpaceRef()
 }
 #endif
 
-void GraphicsContext::platformInit(CGContextRef cgContext, bool shouldUseContextColors)
+void GraphicsContext::platformInit(CGContextRef cgContext)
 {
     m_data = new GraphicsContextPlatformPrivate(cgContext);
     setPaintingDisabled(!cgContext);
     if (cgContext) {
-#if PLATFORM(IOS)
-        m_state.shouldUseContextColors = shouldUseContextColors;
-        if (shouldUseContextColors) {
-#else
-        UNUSED_PARAM(shouldUseContextColors);
-#endif
         // Make sure the context starts in sync with our state.
         setPlatformFillColor(fillColor(), fillColorSpace());
         setPlatformStrokeColor(strokeColor(), strokeColorSpace());
         setPlatformStrokeThickness(strokeThickness());
-#if PLATFORM(IOS)
-        }
-#endif
     }
 }
 
@@ -1362,19 +1353,13 @@ void GraphicsContext::drawLinesForText(const FloatPoint& point, const DashArray&
             dashBounds.append(CGRectMake(bounds.x() + widths[i], bounds.y() + 2 * bounds.height(), widths[i+1] - widths[i], bounds.height()));
     }
 
-#if PLATFORM(IOS)
-    if (m_state.shouldUseContextColors)
-#endif
-        if (fillColorIsNotEqualToStrokeColor)
-            setCGFillColor(platformContext(), localStrokeColor, strokeColorSpace());
+    if (fillColorIsNotEqualToStrokeColor)
+        setCGFillColor(platformContext(), localStrokeColor, strokeColorSpace());
 
     CGContextFillRects(platformContext(), dashBounds.data(), dashBounds.size());
 
-#if PLATFORM(IOS)
-    if (m_state.shouldUseContextColors)
-#endif
-        if (fillColorIsNotEqualToStrokeColor)
-            setCGFillColor(platformContext(), fillColor(), fillColorSpace());
+    if (fillColorIsNotEqualToStrokeColor)
+        setCGFillColor(platformContext(), fillColor(), fillColorSpace());
 }
 
 void GraphicsContext::setURLForRect(const URL& link, const IntRect& destRect)