Diff
Modified: tags/Safari-602.1.27/Source/WTF/ChangeLog (199137 => 199138)
--- tags/Safari-602.1.27/Source/WTF/ChangeLog 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WTF/ChangeLog 2016-04-07 01:58:47 UTC (rev 199138)
@@ -1,3 +1,19 @@
+2016-04-06 Babak Shafiei <[email protected]>
+
+ Merge r199130.
+
+ 2016-04-06 Simon Fraser <[email protected]>
+
+ Page tiles are missing when graphics acceleration is unavailable
+ https://bugs.webkit.org/show_bug.cgi?id=156325
+
+ Reviewed by Tim Horton.
+
+ Add clampToInteger(size_t).
+
+ * wtf/MathExtras.h:
+ (clampToInteger):
+
2016-03-19 Filip Pizlo <[email protected]>
DFG and FTL should constant-fold RegExpExec
Modified: tags/Safari-602.1.27/Source/WTF/wtf/MathExtras.h (199137 => 199138)
--- tags/Safari-602.1.27/Source/WTF/wtf/MathExtras.h 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WTF/wtf/MathExtras.h 2016-04-07 01:58:47 UTC (rev 199138)
@@ -190,6 +190,15 @@
return static_cast<int>(x);
}
+inline int clampToInteger(size_t x)
+{
+ const size_t intMax = static_cast<size_t>(std::numeric_limits<int>::max());
+
+ if (x >= intMax)
+ return std::numeric_limits<int>::max();
+ return static_cast<int>(x);
+}
+
inline bool isWithinIntRange(float x)
{
return x > static_cast<float>(std::numeric_limits<int>::min()) && x < static_cast<float>(std::numeric_limits<int>::max());
Modified: tags/Safari-602.1.27/Source/WebCore/ChangeLog (199137 => 199138)
--- tags/Safari-602.1.27/Source/WebCore/ChangeLog 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WebCore/ChangeLog 2016-04-07 01:58:47 UTC (rev 199138)
@@ -1,3 +1,32 @@
+2016-04-06 Babak Shafiei <[email protected]>
+
+ Merge r199130.
+
+ 2016-04-06 Simon Fraser <[email protected]>
+
+ Page tiles are missing when graphics acceleration is unavailable
+ https://bugs.webkit.org/show_bug.cgi?id=156325
+ rdar://problem/25587476
+
+ Reviewed by Tim Horton.
+
+ When graphics acceleration is unavailable on Mac (e.g. in a VM or when running from
+ the recovery partition), page contents were missing. This is because
+ IOSurfaceGetPropertyMaximum(kIOSurfaceWidth) and IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)
+ returned INT_MAX, causing us to compute a tile size of 0x0.
+
+ Fix by changing IOSurface::maximumSize() to report a value between 1K x 1K and 32K x 32K.
+
+ Rename kGiantTileSize to better describe its purpose.
+
+ Add correct clamping in IOSurface::maximumSize().
+
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::tileSize):
+ * platform/graphics/ca/TileController.h:
+ * platform/graphics/cocoa/IOSurface.mm:
+ (IOSurface::maximumSize):
+
2016-04-05 Beth Dakin <[email protected]>
Make requestCandidatesForSelection available on any EditorClient
Modified: tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.cpp (199137 => 199138)
--- tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.cpp 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.cpp 2016-04-07 01:58:47 UTC (rev 199138)
@@ -493,7 +493,9 @@
if (m_inLiveResize || m_tileSizeLocked)
return tileGrid().tileSize();
- IntSize maxTileSize(kGiantTileSize, kGiantTileSize);
+ const int kLowestCommonDenominatorMaxTileSize = 4 * 1024;
+ IntSize maxTileSize(kLowestCommonDenominatorMaxTileSize, kLowestCommonDenominatorMaxTileSize);
+
#if USE(IOSURFACE)
IntSize surfaceSizeLimit = IOSurface::maximumSize();
surfaceSizeLimit.scale(1 / m_deviceScaleFactor);
Modified: tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.h (199137 => 199138)
--- tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.h 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WebCore/platform/graphics/ca/TileController.h 2016-04-07 01:58:47 UTC (rev 199138)
@@ -49,9 +49,6 @@
typedef Vector<RetainPtr<PlatformLayer>> PlatformLayerList;
const int kDefaultTileSize = 512;
-// This is an experimental value for debugging and evaluating the overhead which may be
-// incurred due to a large tile size.
-const int kGiantTileSize = 4096;
class TileController final : public TiledBacking {
WTF_MAKE_NONCOPYABLE(TileController); WTF_MAKE_FAST_ALLOCATED;
Modified: tags/Safari-602.1.27/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (199137 => 199138)
--- tags/Safari-602.1.27/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2016-04-07 01:56:03 UTC (rev 199137)
+++ tags/Safari-602.1.27/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2016-04-07 01:58:47 UTC (rev 199138)
@@ -36,6 +36,7 @@
#import "ImageBufferDataCG.h"
#import "MachSendRight.h"
#import <wtf/Assertions.h>
+#import <wtf/MathExtras.h>
#if PLATFORM(IOS)
// Move this into the SPI header once it's possible to put inside the APPLE_INTERNAL_SDK block.
@@ -239,13 +240,20 @@
IntSize IOSurface::maximumSize()
{
- IntSize maxSize(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth), IOSurfaceGetPropertyMaximum(kIOSurfaceHeight));
+ IntSize maxSize(clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceWidth)), clampToInteger(IOSurfaceGetPropertyMaximum(kIOSurfaceHeight)));
+
+ // Protect against maxSize being { 0, 0 }.
+ const int iOSMaxSurfaceDimensionLowerBound = 1024;
+
#if PLATFORM(IOS)
- // Match limits imposed by CA. FIXME: should have API for this <rdar://problem/25454148>
+ // Match limits imposed by Core Animation. FIXME: should have API for this <rdar://problem/25454148>
const int iOSMaxSurfaceDimension = 8 * 1024;
- maxSize = maxSize.shrunkTo({ iOSMaxSurfaceDimension, iOSMaxSurfaceDimension });
+#else
+ // IOSurface::maximumSize() can return { INT_MAX, INT_MAX } when hardware acceleration is unavailable.
+ const int iOSMaxSurfaceDimension = 32 * 1024;
#endif
- return maxSize;
+
+ return maxSize.constrainedBetween({ iOSMaxSurfaceDimensionLowerBound, iOSMaxSurfaceDimensionLowerBound }, { iOSMaxSurfaceDimension, iOSMaxSurfaceDimension });
}
MachSendRight IOSurface::createSendRight() const