Changeset 98762 in webkit
- Timestamp:
- Oct 28, 2011, 2:26:57 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/ca/GraphicsLayerCA.cpp (modified) (13 diffs)
-
platform/graphics/ca/GraphicsLayerCA.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98757 r98762 1 2011-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 1 24 2011-10-28 Adrienne Walker <enne@google.com> 2 25 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r98735 r98762 49 49 50 50 using namespace std; 51 52 #define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))53 51 54 52 namespace WebCore { … … 172 170 } 173 171 174 #if HAVE_MODERN_QUARTZCORE175 172 static PlatformCAAnimation::ValueFunctionType getValueFunctionNameForTransformOperation(TransformOperation::OperationType transformType) 176 173 { … … 205 202 } 206 203 } 207 #endif208 204 209 205 static String propertyIdToString(AnimatedPropertyID property) … … 256 252 m_layer = PlatformCALayer::create(PlatformCALayer::LayerTypeWebLayer, this); 257 253 258 #if !HAVE_MODERN_QUARTZCORE259 setContentsOrientation(defaultContentsOrientation());260 #endif261 262 254 updateDebugIndicators(); 263 255 noteLayerPropertyChanged(ContentsScaleChanged); … … 627 619 if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2) 628 620 return false; 629 630 #if !HAVE_MODERN_QUARTZCORE631 // Older versions of QuartzCore do not handle opacity in transform layers properly, so we will632 // always do software animation in that case.633 if (valueList.property() == AnimatedPropertyOpacity)634 return false;635 #endif636 621 637 622 // CoreAnimation does not handle the steps() timing function. Fall back … … 1145 1130 } 1146 1131 } 1147 1148 // Contents transform may depend on height.1149 updateContentsTransform();1150 1132 } 1151 1133 … … 1942 1924 basicAnim->setTimingFunction(timingFunction); 1943 1925 1944 #if HAVE_MODERN_QUARTZCORE1945 1926 PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType); 1946 1927 if (valueFunction != PlatformCAAnimation::NoValueFunction) 1947 1928 basicAnim->setValueFunction(valueFunction); 1948 #endif1949 1929 1950 1930 return true; … … 2007 1987 keyframeAnim->setTimingFunctions(timingFunctions); 2008 1988 2009 #if HAVE_MODERN_QUARTZCORE2010 1989 PlatformCAAnimation::ValueFunctionType valueFunction = getValueFunctionNameForTransformOperation(transformOpType); 2011 1990 if (valueFunction != PlatformCAAnimation::NoValueFunction) 2012 1991 keyframeAnim->setValueFunction(valueFunction); 2013 #endif 1992 2014 1993 return true; 2015 1994 } … … 2170 2149 } 2171 2150 #endif 2172 2173 if (useTiledLayer) {2174 #if !HAVE_MODERN_QUARTZCORE2175 // Tiled layer has issues with flipped coordinates.2176 setContentsOrientation(CompositingCoordinatesTopDown);2177 #endif2178 } else {2179 #if !HAVE_MODERN_QUARTZCORE2180 setContentsOrientation(GraphicsLayerCA::defaultContentsOrientation());2181 #endif2182 }2183 2151 2184 2152 m_layer->adoptSublayers(oldLayer.get()); … … 2194 2162 if (oldLayer->superlayer()) 2195 2163 oldLayer->superlayer()->replaceSublayer(oldLayer.get(), m_layer.get()); 2196 2197 updateContentsTransform();2198 2164 2199 2165 updateGeometry(pageScaleFactor, positionRelativeToBase); … … 2226 2192 GraphicsLayer::CompositingCoordinatesOrientation GraphicsLayerCA::defaultContentsOrientation() const 2227 2193 { 2228 #if !HAVE_MODERN_QUARTZCORE2229 // Older QuartzCore does not support -geometryFlipped, so we manually flip the root2230 // layer geometry, and then flip the contents of each layer back so that the CTM for CG2231 // is unflipped, allowing it to do the correct font auto-hinting.2232 return CompositingCoordinatesBottomUp;2233 #else2234 2194 return CompositingCoordinatesTopDown; 2235 #endif2236 }2237 2238 void GraphicsLayerCA::updateContentsTransform()2239 {2240 #if !HAVE_MODERN_QUARTZCORE2241 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 #endif2247 2195 } 2248 2196 … … 2490 2438 void GraphicsLayerCA::updateOpacityOnLayer() 2491 2439 { 2492 #if !HAVE_MODERN_QUARTZCORE2493 // Distribute opacity either to our own layer or to our children. We pass in the2494 // contribution from our parent(s).2495 distributeOpacity(parent() ? parent()->accumulatedOpacity() : 1);2496 #else2497 2440 primaryLayer()->setOpacity(m_opacity); 2498 2441 … … 2507 2450 2508 2451 } 2509 #endif2510 2452 } 2511 2453 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r98735 r98762 199 199 200 200 CompositingCoordinatesOrientation defaultContentsOrientation() const; 201 void updateContentsTransform();202 201 203 202 void setupContentsLayer(PlatformCALayer*);
Note:
See TracChangeset
for help on using the changeset viewer.