Changeset 288489 in webkit
- Timestamp:
- Jan 24, 2022, 5:02:41 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cocoa/IOSurface.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r288477 r288489 1 2022-01-24 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Avoid calling IOSurfaceGetPropertyMaximum 4 https://bugs.webkit.org/show_bug.cgi?id=235526 5 <rdar://85128431> 6 7 Reviewed by Simon Fraser and Darin Adler. 8 9 There should be no need to call IOSurfaceGetPropertyMaximum on iOS, since the return value will exceed the hardcoded maximum. 10 11 * platform/graphics/cocoa/IOSurface.mm: 12 (WebCore::maxSurfaceDimensionCA): 13 (WebCore::computeMaximumSurfaceSize): 14 1 15 2022-01-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 16 -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
r287848 r288489 229 229 IOSurface::~IOSurface() = default; 230 230 231 static IntSize computeMaximumSurfaceSize() 232 { 233 IntSize maxSize(clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)), clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceHeight))); 234 235 // Protect against maxSize being { 0, 0 }. 236 const int maxSurfaceDimensionLowerBound = 1024; 237 231 static constexpr IntSize maxSurfaceDimensionCA() 232 { 233 // Match limits imposed by Core Animation. FIXME: should have API for this <rdar://problem/25454148> 238 234 #if PLATFORM(IOS_FAMILY) 239 // Match limits imposed by Core Animation. FIXME: should have API for this <rdar://problem/25454148> 240 const int maxSurfaceDimension = 8 * 1024; 235 constexpr int maxSurfaceDimension = 8 * 1024; 241 236 #else 242 237 // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. 243 const int maxSurfaceDimension = 32 * 1024; 244 #endif 245 246 return maxSize.constrainedBetween({ maxSurfaceDimensionLowerBound, maxSurfaceDimensionLowerBound }, { maxSurfaceDimension, maxSurfaceDimension }); 238 constexpr int maxSurfaceDimension = 32 * 1024; 239 #endif 240 return { maxSurfaceDimension, maxSurfaceDimension }; 241 } 242 243 static IntSize computeMaximumSurfaceSize() 244 { 245 #if PLATFORM(IOS) 246 return maxSurfaceDimensionCA(); 247 #else 248 IntSize maxSize(clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)), clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceHeight))); 249 250 // Protect against maxSize being { 0, 0 }. 251 constexpr int maxSurfaceDimensionLowerBound = 1024; 252 253 return maxSize.constrainedBetween({ maxSurfaceDimensionLowerBound, maxSurfaceDimensionLowerBound }, maxSurfaceDimensionCA() ); 254 #endif 247 255 } 248 256
Note:
See TracChangeset
for help on using the changeset viewer.