Title: [98762] trunk/Source/WebCore
Revision
98762
Author
simon.fra...@apple.com
Date
2011-10-28 14:26:57 -0700 (Fri, 28 Oct 2011)

Log Message

Remove Leopard-only code from GraphicsLayerCA
https://bugs.webkit.org/show_bug.cgi?id=71141

Reviewed by Chris Marrin.

Remove !HAVE_MODERN_QUARTZCORE code, which was only
used on Leopard. updateContentsTransform() became a no-op,
so could be removed.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::getValueFunctionNameForTransformOperation):
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::updateGeometry):
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
(WebCore::GraphicsLayerCA::defaultContentsOrientation):
(WebCore::GraphicsLayerCA::updateOpacityOnLayer):
* platform/graphics/ca/GraphicsLayerCA.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98761 => 98762)


--- trunk/Source/WebCore/ChangeLog	2011-10-28 21:17:12 UTC (rev 98761)
+++ trunk/Source/WebCore/ChangeLog	2011-10-28 21:26:57 UTC (rev 98762)
@@ -1,3 +1,26 @@
+2011-10-28  Simon Fraser  <simon.fra...@apple.com>
+
+        Remove Leopard-only code from GraphicsLayerCA
+        https://bugs.webkit.org/show_bug.cgi?id=71141
+
+        Reviewed by Chris Marrin.
+
+        Remove !HAVE_MODERN_QUARTZCORE code, which was only
+        used on Leopard. updateContentsTransform() became a no-op,
+        so could be removed.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::getValueFunctionNameForTransformOperation):
+        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+        (WebCore::GraphicsLayerCA::addAnimation):
+        (WebCore::GraphicsLayerCA::updateGeometry):
+        (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
+        (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
+        (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+        (WebCore::GraphicsLayerCA::defaultContentsOrientation):
+        (WebCore::GraphicsLayerCA::updateOpacityOnLayer):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+
 2011-10-28  Adrienne Walker  <e...@google.com>
 
         [chromium] Implicitly skip render surfaces that won't be drawn

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (98761 => 98762)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-10-28 21:17:12 UTC (rev 98761)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-10-28 21:26:57 UTC (rev 98762)
@@ -49,8 +49,6 @@
 
 using namespace std;
 
-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
-
 namespace WebCore {
 
 // The threshold width or height above which a tiled layer will be used. This should be
@@ -171,7 +169,6 @@
     }
 }
 
-#if HAVE_MODERN_QUARTZCORE
 static PlatformCAAnimation::ValueFunctionType getValueFunctionNameForTransformOperation(TransformOperation::OperationType transformType)
 {
     // Use literal strings to avoid link-time dependency on those symbols.
@@ -204,7 +201,6 @@
         return PlatformCAAnimation::NoValueFunction;
     }
 }
-#endif
 
 static String propertyIdToString(AnimatedPropertyID property)
 {
@@ -255,10 +251,6 @@
 {
     m_layer = PlatformCALayer::create(PlatformCALayer::LayerTypeWebLayer, this);
 
-#if !HAVE_MODERN_QUARTZCORE
-    setContentsOrientation(defaultContentsOrientation());
-#endif
-
     updateDebugIndicators();
     noteLayerPropertyChanged(ContentsScaleChanged);
 }
@@ -627,13 +619,6 @@
     if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
         return false;
 
-#if !HAVE_MODERN_QUARTZCORE
-    // Older versions of QuartzCore do not handle opacity in transform layers properly, so we will
-    // always do software animation in that case.
-    if (valueList.property() == AnimatedPropertyOpacity)
-        return false;
-#endif
-
     // CoreAnimation does not handle the steps() timing function. Fall back
     // to software animation in that case.
     if (animationHasStepsTimingFunction(valueList, anim))
@@ -1144,9 +1129,6 @@
             clone->setAnchorPoint(scaledAnchorPoint);
         }
     }
-
-    // Contents transform may depend on height.
-    updateContentsTransform();
 }
 
 void GraphicsLayerCA::updateTransform()
@@ -1941,11 +1923,9 @@
     const TimingFunction* timingFunction = timingFunctionForAnimationValue(valueList.at(0), anim);
     basicAnim->setTimingFunction(timingFunction);
 
-#if HAVE_MODERN_QUARTZCORE
     PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
     if (valueFunction != PlatformCAAnimation::NoValueFunction)
         basicAnim->setValueFunction(valueFunction);
-#endif
 
     return true;
 }
@@ -2006,11 +1986,10 @@
         
     keyframeAnim->setTimingFunctions(timingFunctions);
 
-#if HAVE_MODERN_QUARTZCORE
     PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
     if (valueFunction != PlatformCAAnimation::NoValueFunction)
         keyframeAnim->setValueFunction(valueFunction);
-#endif
+
     return true;
 }
 
@@ -2169,17 +2148,6 @@
         m_visibleTileWashLayer = 0;
     }
 #endif
-    
-    if (useTiledLayer) {
-#if !HAVE_MODERN_QUARTZCORE
-        // Tiled layer has issues with flipped coordinates.
-        setContentsOrientation(CompositingCoordinatesTopDown);
-#endif
-    } else {
-#if !HAVE_MODERN_QUARTZCORE
-        setContentsOrientation(GraphicsLayerCA::defaultContentsOrientation());
-#endif
-    }
 
     m_layer->adoptSublayers(oldLayer.get());
 
@@ -2194,8 +2162,6 @@
     if (oldLayer->superlayer())
         oldLayer->superlayer()->replaceSublayer(oldLayer.get(), m_layer.get());
 
-    updateContentsTransform();
-
     updateGeometry(pageScaleFactor, positionRelativeToBase);
     updateTransform();
     updateChildrenTransform();
@@ -2225,27 +2191,9 @@
 
 GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayerCA::defaultContentsOrientation() const
 {
-#if !HAVE_MODERN_QUARTZCORE
-    // Older QuartzCore does not support -geometryFlipped, so we manually flip the root
-    // layer geometry, and then flip the contents of each layer back so that the CTM for CG
-    // is unflipped, allowing it to do the correct font auto-hinting.
-    return CompositingCoordinatesBottomUp;
-#else
     return CompositingCoordinatesTopDown;
-#endif
 }
 
-void GraphicsLayerCA::updateContentsTransform()
-{
-#if !HAVE_MODERN_QUARTZCORE
-    if (contentsOrientation() == CompositingCoordinatesBottomUp) {
-        CGAffineTransform contentsTransform = CGAffineTransformMakeScale(1, -1);
-        contentsTransform = CGAffineTransformTranslate(contentsTransform, 0, -m_layer->bounds().size().height());
-        m_layer->setContentsTransform(TransformationMatrix(contentsTransform));
-    }
-#endif
-}
-
 void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer)
 {
     // Turn off implicit animations on the inner layer.
@@ -2489,11 +2437,6 @@
 
 void GraphicsLayerCA::updateOpacityOnLayer()
 {
-#if !HAVE_MODERN_QUARTZCORE
-    // Distribute opacity either to our own layer or to our children. We pass in the 
-    // contribution from our parent(s).
-    distributeOpacity(parent() ? parent()->accumulatedOpacity() : 1);
-#else
     primaryLayer()->setOpacity(m_opacity);
 
     if (LayerMap* layerCloneMap = primaryLayerClones()) {
@@ -2506,7 +2449,6 @@
         }
         
     }
-#endif
 }
 
 void GraphicsLayerCA::setMaintainsPixelAlignment(bool maintainsAlignment)

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (98761 => 98762)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2011-10-28 21:17:12 UTC (rev 98761)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2011-10-28 21:26:57 UTC (rev 98762)
@@ -198,7 +198,6 @@
     void swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase);
 
     CompositingCoordinatesOrientation defaultContentsOrientation() const;
-    void updateContentsTransform();
     
     void setupContentsLayer(PlatformCALayer*);
     PlatformCALayer* contentsLayer() const { return m_contentsLayer.get(); }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to