Title: [292488] trunk/Source/WebCore
Revision
292488
Author
pvol...@apple.com
Date
2022-04-06 12:06:37 -0700 (Wed, 06 Apr 2022)

Log Message

Avoid calling IOSurfaceAlignProperty in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=238870
<rdar://91252359>

Reviewed by Geoffrey Garen.

Use cached values for bytes per row alignment.

* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::calculateBytesPerRow):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292487 => 292488)


--- trunk/Source/WebCore/ChangeLog	2022-04-06 19:05:23 UTC (rev 292487)
+++ trunk/Source/WebCore/ChangeLog	2022-04-06 19:06:37 UTC (rev 292488)
@@ -1,3 +1,16 @@
+2022-04-06  Per Arne Vollan  <pvol...@apple.com>
+
+        Avoid calling IOSurfaceAlignProperty in the WebContent process
+        https://bugs.webkit.org/show_bug.cgi?id=238870
+        <rdar://91252359>
+
+        Reviewed by Geoffrey Garen.
+
+        Use cached values for bytes per row alignment.
+
+        * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
+        (WebCore::ImageBufferIOSurfaceBackend::calculateBytesPerRow):
+
 2022-04-06  Chris Dumez  <cdu...@apple.com>
 
         Start replacing String(const char*) constructor with a String::fromLatin1(const char*) function

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp (292487 => 292488)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp	2022-04-06 19:05:23 UTC (rev 292487)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp	2022-04-06 19:06:37 UTC (rev 292488)
@@ -29,6 +29,7 @@
 #if HAVE(IOSURFACE)
 
 #include "GraphicsContextCG.h"
+#include "IOSurface.h"
 #include "IOSurfacePool.h"
 #include "IntRect.h"
 #include "PixelBuffer.h"
@@ -57,7 +58,8 @@
 unsigned ImageBufferIOSurfaceBackend::calculateBytesPerRow(const IntSize& backendSize)
 {
     unsigned bytesPerRow = ImageBufferCGBackend::calculateBytesPerRow(backendSize);
-    return IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, bytesPerRow);
+    size_t alignmentMask = IOSurface::bytesPerRowAlignment() - 1;
+    return (bytesPerRow + alignmentMask) & ~alignmentMask;
 }
 
 size_t ImageBufferIOSurfaceBackend::calculateMemoryCost(const Parameters& parameters)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to