Reviewed by Simon Fraser.
authorcmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 18:55:33 +0000 (18:55 +0000)
committercmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Mar 2009 18:55:33 +0000 (18:55 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=24256

        Added a WebCoreForceSoftwareAnimation flag.

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

WebCore/ChangeLog
WebCore/platform/graphics/mac/GraphicsLayerCA.mm

index 64f684d513f0530150967fb6af37bca0d7d45e5d..84949a31b84e8cc2804b31d27c1d50c339da7729 100644 (file)
@@ -1,3 +1,17 @@
+2009-03-03  Chris Marrin  <cmarrin@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24256
+
+        Added a WebCoreForceSoftwareAnimation flag.
+
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::forceSoftwareAnimation):
+        (WebCore::GraphicsLayerCA::setOpacity):
+        (WebCore::GraphicsLayerCA::animateTransform):
+        (WebCore::GraphicsLayerCA::animateFloat):
+
 2009-03-02  Chris Marrin  <cmarrin@apple.com>
 
         Reviewed by Sam Weinig.
index fd00b683ade3f76ee4d72006c94be6c921d3ce70..b897668f4be1e8e7c9cc13da015b27175be534ac 100644 (file)
@@ -265,6 +265,12 @@ static bool caValueFunctionSupported()
     return sHaveValueFunction;
 }
 
+static bool forceSoftwareAnimation()
+{
+    static bool forceSoftwareAnimation = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebCoreForceSoftwareAnimation"];
+    return forceSoftwareAnimation;
+}
+
 bool GraphicsLayer::graphicsContextsFlipped()
 {
     return true;
@@ -273,13 +279,13 @@ bool GraphicsLayer::graphicsContextsFlipped()
 #ifndef NDEBUG
 bool GraphicsLayer::showDebugBorders()
 {
-    static int showDebugBorders = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebCoreLayerBorders"];
+    static bool showDebugBorders = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebCoreLayerBorders"];
     return showDebugBorders;
 }
 
 bool GraphicsLayer::showRepaintCounter()
 {
-    static int showRepaintCounter = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebCoreLayerRepaintCounter"];
+    static bool showRepaintCounter = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebCoreLayerRepaintCounter"];
     return showRepaintCounter;
 }
 #endif
@@ -809,6 +815,9 @@ void GraphicsLayerCA::setBackfaceVisibility(bool visible)
 
 bool GraphicsLayerCA::setOpacity(float opacity, const Animation* transition, double beginTime)
 {
+    if (forceSoftwareAnimation())
+        return false;
+        
     float clampedOpacity = max(0.0f, min(opacity, 1.0f));
     
     bool opacitiesDiffer = (m_opacity != clampedOpacity);
@@ -899,7 +908,7 @@ void GraphicsLayerCA::setNeedsDisplayInRect(const FloatRect& rect)
 
 bool GraphicsLayerCA::animateTransform(const TransformValueList& valueList, const IntSize& size, const Animation* anim, double beginTime, bool isTransition)
 {
-    if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
+    if (forceSoftwareAnimation() || !anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
         return false;
         
     TransformValueList::FunctionList functionList;
@@ -1016,7 +1025,7 @@ bool GraphicsLayerCA::animateTransform(const TransformValueList& valueList, cons
 
 bool GraphicsLayerCA::animateFloat(AnimatedPropertyID property, const FloatValueList& valueList, const Animation* animation, double beginTime)
 {
-    if (valueList.size() < 2)
+    if (forceSoftwareAnimation() || valueList.size() < 2)
         return false;
         
     // if there is already is an animation for this property and it hasn't changed, ignore it.