Changeset 198875 in webkit
- Timestamp:
- Mar 30, 2016 7:07:47 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r198871 r198875 1 2016-03-30 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Avoid creating tiles that are too large for rendering 4 https://bugs.webkit.org/show_bug.cgi?id=156050 5 rdar://problem/25424541 6 7 Reviewed by Darin Adler. 8 9 In the case of a WKWebView which is sized large enough to show an entire document 10 (for example, when enclosed inside a UIScrollView), we would create tiles that were 11 larger than CoreAnimation was willing to deal with. 12 13 * platform/graphics/ca/TileController.cpp: 14 (WebCore::TileController::tileSize): Take the device scale, and the max IOSurface size 15 into account when computing the max tile size. 16 * platform/graphics/cocoa/IOSurface.mm: 17 (IOSurface::maximumSize): CoreAnimation imposes limits in addition to the size reported 18 by IOSurfaceGetPropertyMaximum(), namely an 8k cap, so mimic that here. 19 (IOSurface::ensurePlatformContext): Typo. 20 1 21 2016-03-30 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 22 -
trunk/Source/WebCore/platform/graphics/ca/TileController.cpp
r198502 r198875 37 37 #include <wtf/MainThread.h> 38 38 39 #if USE(IOSURFACE) 40 #include "IOSurface.h" 41 #endif 42 39 43 #if PLATFORM(IOS) 40 44 #include "MemoryPressureHandler.h" … … 490 494 return tileGrid().tileSize(); 491 495 496 IntSize maxTileSize(kGiantTileSize, kGiantTileSize); 497 #if USE(IOSURFACE) 498 IntSize surfaceSizeLimit = IOSurface::maximumSize(); 499 surfaceSizeLimit.scale(1 / m_deviceScaleFactor); 500 maxTileSize = maxTileSize.shrunkTo(surfaceSizeLimit); 501 #endif 502 492 503 if (owningGraphicsLayer()->platformCALayerUseGiantTiles()) 493 return IntSize(kGiantTileSize, kGiantTileSize);504 return maxTileSize; 494 505 495 506 IntSize tileSize(kDefaultTileSize, kDefaultTileSize); … … 497 508 if (m_scrollability == NotScrollable) { 498 509 IntSize scaledSize = expandedIntSize(boundsWithoutMargin().size() * tileGrid().scale()); 499 tileSize = scaledSize.constrainedBetween(IntSize(kDefaultTileSize, kDefaultTileSize), IntSize(kGiantTileSize, kGiantTileSize));510 tileSize = scaledSize.constrainedBetween(IntSize(kDefaultTileSize, kDefaultTileSize), maxTileSize); 500 511 } else if (m_scrollability == VerticallyScrollable) 501 tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), kGiantTileSize));512 tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), maxTileSize.width())); 502 513 503 514 LOG_WITH_STREAM(Scrolling, stream << "TileController::tileSize newSize=" << tileSize); -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
r195979 r198875 240 240 IntSize IOSurface::maximumSize() 241 241 { 242 return IntSize(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth), IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)); 242 IntSize maxSize(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth), IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)); 243 #if PLATFORM(IOS) 244 // Match limits imposed by CA. FIXME: should have API for this <rdar://problem/25454148> 245 const int iOSMaxSurfaceDimension = 8 * 1024; 246 maxSize = maxSize.shrunkTo({ iOSMaxSurfaceDimension, iOSMaxSurfaceDimension }); 247 #endif 248 return maxSize; 243 249 } 244 250 … … 289 295 case Format::RGB10A8: 290 296 // A half-float format will be used if CG needs to read back the IOSurface contents, 291 // but for an IOSurface-to-IOSurface copy, there shou d be no conversion.297 // but for an IOSurface-to-IOSurface copy, there should be no conversion. 292 298 bitsPerComponent = 16; 293 299 bitsPerPixel = 64;
Note: See TracChangeset
for help on using the changeset viewer.