Google Canvas2D maps are too slow and uncontrollable with Safari with full screen...
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Aug 2014 20:55:13 +0000 (20:55 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Aug 2014 20:55:13 +0000 (20:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136168

Reviewed by Tim Horton.

When Google maps are using their 2D "lite" fallback and you're drawing in a huge
window such as fullscreen 4K, we would drop back to unaccelerated mode, thinking
that we'd exceeded the maximum IOSurface size.

Remove the hardcoded limit on IOSurface sizes, and instead ask the system
what it believe the maximum to be. This was significantly higher than our
limit on the systems I tested.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer): Include our IOSurface wrapper, which
has a query for maximum size, and use that instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

index 82244e9..4683428 100644 (file)
@@ -1,3 +1,22 @@
+2014-08-22  Dean Jackson  <dino@apple.com>
+
+        Google Canvas2D maps are too slow and uncontrollable with Safari with full screen mode
+        https://bugs.webkit.org/show_bug.cgi?id=136168
+
+        Reviewed by Tim Horton.
+
+        When Google maps are using their 2D "lite" fallback and you're drawing in a huge
+        window such as fullscreen 4K, we would drop back to unaccelerated mode, thinking
+        that we'd exceeded the maximum IOSurface size.
+
+        Remove the hardcoded limit on IOSurface sizes, and instead ask the system
+        what it believe the maximum to be. This was significantly higher than our
+        limit on the systems I tested.
+
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::ImageBuffer): Include our IOSurface wrapper, which
+        has a query for maximum size, and use that instead.
+
 2014-08-22  Simon Fraser  <simon.fraser@apple.com>
 
         Maybe fix Windows.
index b401207..c761387 100644 (file)
@@ -48,6 +48,7 @@
 #endif
 
 #if USE(IOSURFACE_CANVAS_BACKING_STORE)
+#include "IOSurface.h"
 #include <IOSurface/IOSurface.h>
 #endif
 
 namespace WebCore {
 
 #if USE(IOSURFACE_CANVAS_BACKING_STORE)
-#if PLATFORM(IOS)
-static const int maxIOSurfaceDimension = 2048;
-#else
-static const int maxIOSurfaceDimension = 4096;
-#endif
 
 // FIXME: Adopt WebCore::IOSurface.
 static RetainPtr<IOSurfaceRef> createIOSurface(const IntSize& size)
@@ -156,7 +152,8 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpac
         return;
 
 #if USE(IOSURFACE_CANVAS_BACKING_STORE)
-    if (width.unsafeGet() > maxIOSurfaceDimension || height.unsafeGet() > maxIOSurfaceDimension)
+    IntSize maxSize = IOSurface::maximumSize();
+    if (width.unsafeGet() > maxSize.width() || height.unsafeGet() > maxSize.height())
         accelerateRendering = false;
 #else
     ASSERT(renderingMode == Unaccelerated);