[chromium] Add the workaround of IOSurface-related corruption during readback on...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 17:56:46 +0000 (17:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jun 2012 17:56:46 +0000 (17:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=89797

Patch by Yasuhiro Matsuda <mazda@chromium.org> on 2012-06-26
Reviewed by James Robinson.

No new tests. This patch doesn't change behavior.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::getFramebufferPixels):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

index 85e4278..59c5bda 100755 (executable)
@@ -1,3 +1,15 @@
+2012-06-26  Yasuhiro Matsuda  <mazda@chromium.org>
+
+        [chromium] Add the workaround of IOSurface-related corruption during readback on Mac OS X.
+        https://bugs.webkit.org/show_bug.cgi?id=89797
+
+        Reviewed by James Robinson.
+
+        No new tests. This patch doesn't change behavior.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::getFramebufferPixels):
+
 2012-06-26  Alexei Filippov  <alexeif@chromium.org>
 
         Web Inspector: Native memory snapshots crash in debug mode.
index 2624c0e..ca2d190 100644 (file)
@@ -115,16 +115,10 @@ static WebTransformationMatrix screenMatrix(int x, int y, int width, int height)
     return screen;
 }
 
-bool needsLionIOSurfaceReadbackWorkaround()
+bool needsIOSurfaceReadbackWorkaround()
 {
 #if OS(DARWIN)
-    static SInt32 systemVersion = 0;
-    if (!systemVersion) {
-        if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
-            return false;
-    }
-
-    return systemVersion >= 0x1070;
+    return true;
 #else
     return false;
 #endif
@@ -1260,13 +1254,13 @@ void LayerRendererChromium::getFramebufferPixels(void *pixels, const IntRect& re
 
     makeContextCurrent();
 
-    bool doWorkaround = needsLionIOSurfaceReadbackWorkaround();
+    bool doWorkaround = needsIOSurfaceReadbackWorkaround();
 
     Platform3DObject temporaryTexture = NullPlatform3DObject;
     Platform3DObject temporaryFBO = NullPlatform3DObject;
 
     if (doWorkaround) {
-        // On Mac OS X 10.7, calling glReadPixels against an FBO whose color attachment is an
+        // On Mac OS X, calling glReadPixels against an FBO whose color attachment is an
         // IOSurface-backed texture causes corruption of future glReadPixels calls, even those on
         // different OpenGL contexts. It is believed that this is the root cause of top crasher
         // http://crbug.com/99393. <rdar://problem/10949687>