Changeset 109255 in webkit
- Timestamp:
- Feb 29, 2012, 1:36:12 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.exp.in (modified) (1 diff)
-
Source/WebCore/platform/graphics/Path.cpp (modified) (2 diffs)
-
Source/WebCore/platform/graphics/Path.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/cg/PathCG.cpp (modified) (2 diffs)
-
Source/WebCore/platform/mac/WebCoreSystemInterface.h (modified) (2 diffs)
-
Source/WebCore/platform/mac/WebCoreSystemInterface.mm (modified) (1 diff)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (modified) (1 diff)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (modified) (1 diff)
-
WebKitLibraries/ChangeLog (modified) (1 diff)
-
WebKitLibraries/WebKitSystemInterface.h (modified) (1 diff)
-
WebKitLibraries/libWebKitSystemInterfaceLeopard.a (modified) ( previous)
-
WebKitLibraries/libWebKitSystemInterfaceLion.a (modified) ( previous)
-
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a (modified) ( previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109252 r109255 1 2012-02-29 Tim Horton <timothy_horton@apple.com> 2 3 Make use of CG rounded-rect primitives 4 https://bugs.webkit.org/show_bug.cgi?id=79932 5 <rdar://problem/9274953> 6 7 Reviewed by Simon Fraser. 8 9 Dispatch to potentially platform-specific rounded rectangle path 10 construction from addPathForRoundedRect. Make use of this to call 11 wkCGPathAddRoundedRect on Lion and above, as long as the rounded 12 corners are all equivalent. 13 14 No new tests, as this is covered by many that use rounded corners, 15 and is only a performance improvement. 16 17 * WebCore.exp.in: 18 * platform/graphics/Path.cpp: 19 (WebCore::Path::addRoundedRect): 20 (WebCore): 21 (WebCore::Path::addPathForRoundedRect): 22 * platform/graphics/Path.h: 23 (Path): 24 * platform/graphics/cg/PathCG.cpp: 25 (WebCore::Path::addPathForRoundedRect): 26 (WebCore): 27 * platform/mac/WebCoreSystemInterface.h: 28 * platform/mac/WebCoreSystemInterface.mm: 29 1 30 2012-02-29 Leo Yang <leo.yang@torchmobile.com.cn> 2 31 -
trunk/Source/WebCore/WebCore.exp.in
r109184 r109255 1517 1517 _wkCGContextGetShouldSmoothFonts 1518 1518 _wkCGContextResetClip 1519 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 1520 _wkCGPathAddRoundedRect 1521 #endif 1519 1522 _wkCGPatternCreateWithImageAndTransform 1520 1523 _wkCopyCFLocalizationPreferredName -
trunk/Source/WebCore/platform/graphics/Path.cpp
r99460 r109255 116 116 radius.setHeight(halfSize.height()); 117 117 118 add BeziersForRoundedRect(rect, radius, radius, radius, radius);118 addPathForRoundedRect(rect, radius, radius, radius, radius); 119 119 } 120 120 … … 133 133 } 134 134 135 addPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); 136 } 137 138 #if !USE(CG) 139 void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius) 140 { 135 141 addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); 136 142 } 143 #endif 137 144 138 145 // Approximation of control point positions on a bezier to simulate a quarter of a circle. -
trunk/Source/WebCore/platform/graphics/Path.h
r106357 r109255 147 147 void transform(const AffineTransform&); 148 148 149 void addPathForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius); 149 150 void addBeziersForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius); 150 151 -
trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp
r106016 r109255 40 40 #include <wtf/RetainPtr.h> 41 41 42 #if PLATFORM(MAC) || PLATFORM(CHROMIUM) 43 #include "WebCoreSystemInterface.h" 44 #endif 45 46 #if PLATFORM(WIN) 47 #include <WebKitSystemInterface/WebKitSystemInterface.h> 48 #endif 49 42 50 namespace WebCore { 43 51 … … 225 233 { 226 234 CGPathAddArcToPoint(m_path, 0, p1.x(), p1.y(), p2.x(), p2.y(), radius); 235 } 236 237 void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius) 238 { 239 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 240 bool equalWidths = (topLeftRadius.width() == topRightRadius.width() && topRightRadius.width() == bottomLeftRadius.width() && bottomLeftRadius.width() == bottomRightRadius.width()); 241 bool equalHeights = (topLeftRadius.height() == bottomLeftRadius.height() && bottomLeftRadius.height() == topRightRadius.height() && topRightRadius.height() == bottomRightRadius.height()); 242 243 if (equalWidths && equalHeights) { 244 wkCGPathAddRoundedRect(m_path, 0, rect, topLeftRadius.width(), topLeftRadius.height()); 245 return; 246 } 247 #endif 248 249 addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); 227 250 } 228 251 -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h
r109181 r109255 42 42 typedef struct CGColorSpace *CGColorSpaceRef; 43 43 typedef struct CGPattern *CGPatternRef; 44 typedef struct CGPath *CGMutablePathRef; 44 45 typedef unsigned short CGGlyph; 45 46 typedef struct __CFReadStream * CFReadStreamRef; … … 306 307 #endif 307 308 309 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 310 extern void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); 311 #endif 312 308 313 } 309 314 -
trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm
r109181 r109255 186 186 bool (*wkExecutableWasLinkedOnOrBeforeLion)(void); 187 187 #endif 188 189 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 190 void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); 191 #endif -
trunk/Source/WebKit/mac/ChangeLog
r109254 r109255 1 2012-02-29 Tim Horton <timothy_horton@apple.com> 2 3 Make use of CG rounded-rect primitives 4 https://bugs.webkit.org/show_bug.cgi?id=79932 5 <rdar://problem/9274953> 6 7 Reviewed by Simon Fraser. 8 9 Add wkCGPathAddRoundedRect. 10 11 * WebCoreSupport/WebSystemInterface.mm: 12 (InitWebCoreSystemInterface): 13 1 14 2012-02-29 Enrica Casucci <enrica@apple.com> 2 15 -
trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
r109181 r109255 179 179 #endif 180 180 181 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 182 INIT(CGPathAddRoundedRect); 183 #endif 184 181 185 didInit = true; 182 186 } -
trunk/Source/WebKit2/ChangeLog
r109249 r109255 1 2012-02-29 Tim Horton <timothy_horton@apple.com> 2 3 Make use of CG rounded-rect primitives 4 https://bugs.webkit.org/show_bug.cgi?id=79932 5 <rdar://problem/9274953> 6 7 Reviewed by Simon Fraser. 8 9 Add wkCGPathAddRoundedRect. 10 11 * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: 12 (InitWebCoreSystemInterface): 13 1 14 2012-02-29 Andy Estes <aestes@apple.com> 2 15 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
r109181 r109255 164 164 #endif 165 165 166 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 167 INIT(CGPathAddRoundedRect); 168 #endif 169 166 170 }); 167 171 } -
trunk/WebKitLibraries/ChangeLog
r109231 r109255 1 2012-02-29 Tim Horton <timothy_horton@apple.com> 2 3 Make use of CG rounded-rect primitives 4 https://bugs.webkit.org/show_bug.cgi?id=79932 5 <rdar://problem/9274953> 6 7 Reviewed by Simon Fraser. 8 9 Add wkCGPathAddRoundedRect. 10 11 * WebKitSystemInterface.h: 12 * libWebKitSystemInterfaceLeopard.a: 13 * libWebKitSystemInterfaceLion.a: 14 * libWebKitSystemInterfaceSnowLeopard.a: 15 1 16 2012-02-28 Jer Noble <jer.noble@apple.com> 2 17 -
trunk/WebKitLibraries/WebKitSystemInterface.h
r109181 r109255 472 472 #endif 473 473 474 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 475 void WKCGPathAddRoundedRect(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); 476 #endif 477 474 478 #ifdef __cplusplus 475 479 }
Note:
See TracChangeset
for help on using the changeset viewer.