Changeset 199130 in webkit
- Timestamp:
- Apr 6, 2016, 6:20:52 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/MathExtras.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/ca/TileController.cpp (modified) (1 diff)
-
WebCore/platform/graphics/ca/TileController.h (modified) (1 diff)
-
WebCore/platform/graphics/cocoa/IOSurface.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r199107 r199130 1 2016-04-06 Simon Fraser <simon.fraser@apple.com> 2 3 Page tiles are missing when graphics acceleration is unavailable 4 https://bugs.webkit.org/show_bug.cgi?id=156325 5 6 Reviewed by Tim Horton. 7 8 Add clampToInteger(size_t). 9 10 * wtf/MathExtras.h: 11 (clampToInteger): 12 1 13 2016-04-05 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WTF/wtf/MathExtras.h
r195417 r199130 191 191 } 192 192 193 inline int clampToInteger(size_t x) 194 { 195 const size_t intMax = static_cast<size_t>(std::numeric_limits<int>::max()); 196 197 if (x >= intMax) 198 return std::numeric_limits<int>::max(); 199 return static_cast<int>(x); 200 } 201 193 202 inline bool isWithinIntRange(float x) 194 203 { -
trunk/Source/WebCore/ChangeLog
r199128 r199130 1 2016-04-06 Simon Fraser <simon.fraser@apple.com> 2 3 Page tiles are missing when graphics acceleration is unavailable 4 https://bugs.webkit.org/show_bug.cgi?id=156325 5 rdar://problem/25587476 6 7 Reviewed by Tim Horton. 8 9 When graphics acceleration is unavailable on Mac (e.g. in a VM or when running from 10 the recovery partition), page contents were missing. This is because 11 IOSurfaceGetPropertyMaximum(kIOSurfaceWidth) and IOSurfaceGetPropertyMaximum(kIOSurfaceHeight) 12 returned INT_MAX, causing us to compute a tile size of 0x0. 13 14 Fix by changing IOSurface::maximumSize() to report a value between 1K x 1K and 32K x 32K. 15 16 Rename kGiantTileSize to better describe its purpose. 17 18 Add correct clamping in IOSurface::maximumSize(). 19 20 * platform/graphics/ca/TileController.cpp: 21 (WebCore::TileController::tileSize): 22 * platform/graphics/ca/TileController.h: 23 * platform/graphics/cocoa/IOSurface.mm: 24 (IOSurface::maximumSize): 25 1 26 2016-03-29 Keith Miller <keith_miller@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/ca/TileController.cpp
r198875 r199130 494 494 return tileGrid().tileSize(); 495 495 496 IntSize maxTileSize(kGiantTileSize, kGiantTileSize); 496 const int kLowestCommonDenominatorMaxTileSize = 4 * 1024; 497 IntSize maxTileSize(kLowestCommonDenominatorMaxTileSize, kLowestCommonDenominatorMaxTileSize); 498 497 499 #if USE(IOSURFACE) 498 500 IntSize surfaceSizeLimit = IOSurface::maximumSize(); -
trunk/Source/WebCore/platform/graphics/ca/TileController.h
r198189 r199130 50 50 51 51 const int kDefaultTileSize = 512; 52 // This is an experimental value for debugging and evaluating the overhead which may be53 // incurred due to a large tile size.54 const int kGiantTileSize = 4096;55 52 56 53 class TileController final : public TiledBacking { -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
r198875 r199130 37 37 #import "MachSendRight.h" 38 38 #import <wtf/Assertions.h> 39 #import <wtf/MathExtras.h> 39 40 40 41 #if PLATFORM(IOS) … … 240 241 IntSize IOSurface::maximumSize() 241 242 { 242 IntSize maxSize(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth), IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)); 243 IntSize maxSize(clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)), clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceHeight))); 244 245 // Protect against maxSize being { 0, 0 }. 246 const int iOSMaxSurfaceDimensionLowerBound = 1024; 247 243 248 #if PLATFORM(IOS) 244 // Match limits imposed by C A. FIXME: should have API for this <rdar://problem/25454148>249 // Match limits imposed by Core Animation. FIXME: should have API for this <rdar://problem/25454148> 245 250 const int iOSMaxSurfaceDimension = 8 * 1024; 246 maxSize = maxSize.shrunkTo({ iOSMaxSurfaceDimension, iOSMaxSurfaceDimension }); 251 #else 252 // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable. 253 const int iOSMaxSurfaceDimension = 32 * 1024; 247 254 #endif 248 return maxSize; 255 256 return maxSize.constrainedBetween({ iOSMaxSurfaceDimensionLowerBound, iOSMaxSurfaceDimensionLowerBound }, { iOSMaxSurfaceDimension, iOSMaxSurfaceDimension }); 249 257 } 250 258
Note:
See TracChangeset
for help on using the changeset viewer.