⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98762 in webkit


Ignore:
Timestamp:
Oct 28, 2011, 2:26:57 PM (15 years ago)
Author:
Simon Fraser
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r98757 r98762  
     12011-10-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove Leopard-only code from GraphicsLayerCA
     4        https://bugs.webkit.org/show_bug.cgi?id=71141
     5
     6        Reviewed by Chris Marrin.
     7
     8        Remove !HAVE_MODERN_QUARTZCORE code, which was only
     9        used on Leopard. updateContentsTransform() became a no-op,
     10        so could be removed.
     11
     12        * platform/graphics/ca/GraphicsLayerCA.cpp:
     13        (WebCore::getValueFunctionNameForTransformOperation):
     14        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
     15        (WebCore::GraphicsLayerCA::addAnimation):
     16        (WebCore::GraphicsLayerCA::updateGeometry):
     17        (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
     18        (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
     19        (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
     20        (WebCore::GraphicsLayerCA::defaultContentsOrientation):
     21        (WebCore::GraphicsLayerCA::updateOpacityOnLayer):
     22        * platform/graphics/ca/GraphicsLayerCA.h:
     23
    1242011-10-28  Adrienne Walker  <enne@google.com>
    225
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r98735 r98762  
    4949
    5050using namespace std;
    51 
    52 #define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
    5351
    5452namespace WebCore {
     
    172170}
    173171
    174 #if HAVE_MODERN_QUARTZCORE
    175172static PlatformCAAnimation::ValueFunctionType getValueFunctionNameForTransformOperation(TransformOperation::OperationType transformType)
    176173{
     
    205202    }
    206203}
    207 #endif
    208204
    209205static String propertyIdToString(AnimatedPropertyID property)
     
    256252    m_layer = PlatformCALayer::create(PlatformCALayer::LayerTypeWebLayer, this);
    257253
    258 #if !HAVE_MODERN_QUARTZCORE
    259     setContentsOrientation(defaultContentsOrientation());
    260 #endif
    261 
    262254    updateDebugIndicators();
    263255    noteLayerPropertyChanged(ContentsScaleChanged);
     
    627619    if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2)
    628620        return false;
    629 
    630 #if !HAVE_MODERN_QUARTZCORE
    631     // Older versions of QuartzCore do not handle opacity in transform layers properly, so we will
    632     // always do software animation in that case.
    633     if (valueList.property() == AnimatedPropertyOpacity)
    634         return false;
    635 #endif
    636621
    637622    // CoreAnimation does not handle the steps() timing function. Fall back
     
    11451130        }
    11461131    }
    1147 
    1148     // Contents transform may depend on height.
    1149     updateContentsTransform();
    11501132}
    11511133
     
    19421924    basicAnim->setTimingFunction(timingFunction);
    19431925
    1944 #if HAVE_MODERN_QUARTZCORE
    19451926    PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
    19461927    if (valueFunction != PlatformCAAnimation::NoValueFunction)
    19471928        basicAnim->setValueFunction(valueFunction);
    1948 #endif
    19491929
    19501930    return true;
     
    20071987    keyframeAnim->setTimingFunctions(timingFunctions);
    20081988
    2009 #if HAVE_MODERN_QUARTZCORE
    20101989    PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType);
    20111990    if (valueFunction != PlatformCAAnimation::NoValueFunction)
    20121991        keyframeAnim->setValueFunction(valueFunction);
    2013 #endif
     1992
    20141993    return true;
    20151994}
     
    21702149    }
    21712150#endif
    2172    
    2173     if (useTiledLayer) {
    2174 #if !HAVE_MODERN_QUARTZCORE
    2175         // Tiled layer has issues with flipped coordinates.
    2176         setContentsOrientation(CompositingCoordinatesTopDown);
    2177 #endif
    2178     } else {
    2179 #if !HAVE_MODERN_QUARTZCORE
    2180         setContentsOrientation(GraphicsLayerCA::defaultContentsOrientation());
    2181 #endif
    2182     }
    21832151
    21842152    m_layer->adoptSublayers(oldLayer.get());
     
    21942162    if (oldLayer->superlayer())
    21952163        oldLayer->superlayer()->replaceSublayer(oldLayer.get(), m_layer.get());
    2196 
    2197     updateContentsTransform();
    21982164
    21992165    updateGeometry(pageScaleFactor, positionRelativeToBase);
     
    22262192GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayerCA::defaultContentsOrientation() const
    22272193{
    2228 #if !HAVE_MODERN_QUARTZCORE
    2229     // Older QuartzCore does not support -geometryFlipped, so we manually flip the root
    2230     // layer geometry, and then flip the contents of each layer back so that the CTM for CG
    2231     // is unflipped, allowing it to do the correct font auto-hinting.
    2232     return CompositingCoordinatesBottomUp;
    2233 #else
    22342194    return CompositingCoordinatesTopDown;
    2235 #endif
    2236 }
    2237 
    2238 void GraphicsLayerCA::updateContentsTransform()
    2239 {
    2240 #if !HAVE_MODERN_QUARTZCORE
    2241     if (contentsOrientation() == CompositingCoordinatesBottomUp) {
    2242         CGAffineTransform contentsTransform = CGAffineTransformMakeScale(1, -1);
    2243         contentsTransform = CGAffineTransformTranslate(contentsTransform, 0, -m_layer->bounds().size().height());
    2244         m_layer->setContentsTransform(TransformationMatrix(contentsTransform));
    2245     }
    2246 #endif
    22472195}
    22482196
     
    24902438void GraphicsLayerCA::updateOpacityOnLayer()
    24912439{
    2492 #if !HAVE_MODERN_QUARTZCORE
    2493     // Distribute opacity either to our own layer or to our children. We pass in the
    2494     // contribution from our parent(s).
    2495     distributeOpacity(parent() ? parent()->accumulatedOpacity() : 1);
    2496 #else
    24972440    primaryLayer()->setOpacity(m_opacity);
    24982441
     
    25072450       
    25082451    }
    2509 #endif
    25102452}
    25112453
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r98735 r98762  
    199199
    200200    CompositingCoordinatesOrientation defaultContentsOrientation() const;
    201     void updateContentsTransform();
    202201   
    203202    void setupContentsLayer(PlatformCALayer*);
Note: See TracChangeset for help on using the changeset viewer.