2009-03-01 Jeremy Moskovich <jeremy@chromium.org>
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Mar 2009 00:41:23 +0000 (00:41 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Mar 2009 00:41:23 +0000 (00:41 +0000)
        Reviewed by Simon Fraser.

        https://bugs.webkit.org/show_bug.cgi?id=24197 and
        https://bugs.webkit.org/show_bug.cgi?id=23512

        The Windows version of cgColor() is conditionally compiled using
        !PLATFORM(MAC) change this to PLATFORM(WIN_OS) so that Chrome
        can use the OS X version instead of the Windows version.

        Also rename cgColor() -> createCGColor()

        No observable change in behavior, so no test.

        * platform/graphics/Color.h:
        * platform/graphics/cg/ColorCG.cpp:
        (WebCore::createCGColor):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::setPlatformShadow):
        * platform/graphics/mac/ColorMac.mm:
        (WebCore::createCGColor):
        * platform/graphics/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::drawFocusRing):
        * platform/graphics/mac/GraphicsLayerCA.mm:
        (WebCore::setLayerBorderColor):
        (WebCore::setLayerBackgroundColor):
        (WebCore::GraphicsLayerCA::setBackgroundColor):
        * platform/graphics/win/GraphicsContextCGWin.cpp:
        (WebCore::GraphicsContext::drawFocusRing):
        * svg/graphics/filters/cg/SVGFEHelpersCg.mm:
        (WebCore::ciColor):

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

WebCore/ChangeLog
WebCore/platform/graphics/Color.h
WebCore/platform/graphics/cg/ColorCG.cpp
WebCore/platform/graphics/cg/GraphicsContextCG.cpp
WebCore/platform/graphics/mac/ColorMac.mm
WebCore/platform/graphics/mac/GraphicsContextMac.mm
WebCore/platform/graphics/mac/GraphicsLayerCA.mm
WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
WebCore/svg/graphics/filters/cg/SVGFEHelpersCg.mm

index c79b8b38a64d67e97f88a201b16dd8bae14cf728..ddbcb6d8dca53d630296ed67e104712be4438a1c 100644 (file)
@@ -1,3 +1,36 @@
+2009-03-01  Jeremy Moskovich  <jeremy@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24197 and
+        https://bugs.webkit.org/show_bug.cgi?id=23512
+
+        The Windows version of cgColor() is conditionally compiled using
+        !PLATFORM(MAC) change this to PLATFORM(WIN_OS) so that Chrome
+        can use the OS X version instead of the Windows version.
+
+        Also rename cgColor() -> createCGColor()
+
+        No observable change in behavior, so no test.
+
+        * platform/graphics/Color.h:
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::createCGColor):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+        * platform/graphics/mac/ColorMac.mm:
+        (WebCore::createCGColor):
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::setLayerBorderColor):
+        (WebCore::setLayerBackgroundColor):
+        (WebCore::GraphicsLayerCA::setBackgroundColor):
+        * platform/graphics/win/GraphicsContextCGWin.cpp:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * svg/graphics/filters/cg/SVGFEHelpersCg.mm:
+        (WebCore::ciColor):
+
 2009-03-01  David Levin  <levin@chromium.org>
 
         Reviewed by Alexey Proskuryakov.
index aef10edc32246af6b15efddb8682eb9753b71ef7..f8b9ad3e3bd3308aed95b052133de34b6700146c 100644 (file)
@@ -147,7 +147,7 @@ inline bool operator!=(const Color& a, const Color& b)
 Color focusRingColor();
 
 #if PLATFORM(CG)
-CGColorRef cgColor(const Color&);
+CGColorRef createCGColor(const Color&);
 #endif
 
 } // namespace WebCore
index 48ce9f25ee7792c76430d0900c3f9939cbbb28ba..0465c0bf6c417c9fdabfb7497a34595f1b045c53 100644 (file)
@@ -67,9 +67,9 @@ Color::Color(CGColorRef color)
     m_color = makeRGBA(r * 255, g * 255, b * 255, a * 255);
 }
 
-#if !PLATFORM(MAC)
+#if PLATFORM(WIN_OS)
 
-CGColorRef cgColor(const Color& c)
+CGColorRef createCGColor(const Color& c)
 {
     CGColorRef color = NULL;
     CMProfileRef prof = NULL;
@@ -89,7 +89,7 @@ CGColorRef cgColor(const Color& c)
     return color;
 }
 
-#endif // !PLATFORM(MAC)
+#endif // PLATFORM(WIN_OS)
 
 }
 
index 684766e75dd17f1d33d787023243ee060875709b..4b8a55597de385ea51e95d38b3866f2eb5bbdda3 100644 (file)
@@ -737,7 +737,7 @@ void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Col
     if (!color.isValid())
         CGContextSetShadow(context, CGSizeMake(width, height), blurRadius);
     else {
-        CGColorRef colorCG = cgColor(color);
+        CGColorRef colorCG = createCGColor(color);
         CGContextSetShadowWithColor(context,
                                     CGSizeMake(width, height),
                                     blurRadius, 
index 9b0f7706fbeab3596963015b320a217f3466f572..d7e26ddda86b1dfbfb6b8fe279770cd5f406040e 100644 (file)
@@ -110,7 +110,7 @@ static CGColorRef CGColorFromNSColor(NSColor* color)
     return cgColor;
 }
 
-CGColorRef cgColor(const Color& c)
+CGColorRef createCGColor(const Color& c)
 {
     // We could directly create a CGColor here, but that would
     // skip any RGB caching the nsColor method does. A direct 
index ae829e2e0bfa8314ef2872f3e49ceec560e90b8d..b79ff38624904b1b0c1de6210e1da5586335b188 100644 (file)
@@ -47,7 +47,7 @@ void GraphicsContext::drawFocusRing(const Color& color)
 
     int radius = (focusRingWidth() - 1) / 2;
     int offset = radius + focusRingOffset();
-    CGColorRef colorRef = color.isValid() ? cgColor(color) : 0;
+    CGColorRef colorRef = color.isValid() ? createCGColor(color) : 0;
 
     CGMutablePathRef focusRingPath = CGPathCreateMutable();
     const Vector<IntRect>& rects = focusRingRects();
index c66d2b79f4cd6435e05129410cdbc26557cba16f..fd00b683ade3f76ee4d72006c94be6c921d3ce70 100644 (file)
@@ -227,7 +227,7 @@ static CAMediaTimingFunction* getCAMediaTimingFunction(const TimingFunction& tim
 #ifndef NDEBUG
 static void setLayerBorderColor(PlatformLayer* layer, const Color& color)
 {
-    CGColorRef borderColor = cgColor(color);
+    CGColorRef borderColor = createCGColor(color);
     [layer setBorderColor:borderColor];
     CGColorRelease(borderColor);
 }
@@ -240,7 +240,7 @@ static void clearBorderColor(PlatformLayer* layer)
 
 static void setLayerBackgroundColor(PlatformLayer* layer, const Color& color)
 {
-    CGColorRef bgColor = cgColor(color);
+    CGColorRef bgColor = createCGColor(color);
     [layer setBackgroundColor:bgColor];
     CGColorRelease(bgColor);
 }
@@ -766,7 +766,7 @@ void GraphicsLayerCA::setBackgroundColor(const Color& color, const Animation* tr
         // Get the current value of the background color from the layer
         CGColorRef fromBackgroundColor = [presLayer backgroundColor];
 
-        CGColorRef bgColor = cgColor(color);
+        CGColorRef bgColor = createCGColor(color);
         setBasicAnimation(AnimatedPropertyBackgroundColor, TransformOperation::NONE, 0, fromBackgroundColor, bgColor, true, transition, beginTime);
         CGColorRelease(bgColor);
     } else {
index 82d044a3851ece9dec1525209d62cb438586840c..da5b503fb4858b2ba8a3af727afa83612f6291c3 100644 (file)
@@ -253,7 +253,7 @@ void GraphicsContext::drawFocusRing(const Color& color)
 
     float radius = (focusRingWidth() - 1) / 2.0f;
     int offset = radius + focusRingOffset();
-    CGColorRef colorRef = color.isValid() ? cgColor(color) : 0;
+    CGColorRef colorRef = color.isValid() ? createCGColor(color) : 0;
 
     CGMutablePathRef focusRingPath = CGPathCreateMutable();
     const Vector<IntRect>& rects = focusRingRects();
index 0f2eb757c875cd2ac6c23ff3cd1283d34d3bd911..399d4c195959d156f24772f293c7a485c4fe9d5e 100644 (file)
@@ -59,7 +59,7 @@ CIVector* getVectorForChannel(ChannelSelectorType channel)
 
 CIColor* ciColor(const Color& c)
 {
-    CGColorRef colorCG = cgColor(c);
+    CGColorRef colorCG = createCGColor(c);
     CIColor* colorCI = [CIColor colorWithCGColor:colorCG];
     CGColorRelease(colorCG);
     return colorCI;