Title: [271501] trunk/Source/WebKit
Revision
271501
Author
[email protected]
Date
2021-01-14 14:51:24 -0800 (Thu, 14 Jan 2021)

Log Message

Unreviewed, apply post-landing review comments from Darin for r271495.

* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::ShareableBitmap::calculateBytesPerRow):
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::makeCGImageCopy):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (271500 => 271501)


--- trunk/Source/WebKit/ChangeLog	2021-01-14 22:48:43 UTC (rev 271500)
+++ trunk/Source/WebKit/ChangeLog	2021-01-14 22:51:24 UTC (rev 271501)
@@ -1,3 +1,12 @@
+2021-01-14  Chris Dumez  <[email protected]>
+
+        Unreviewed, apply post-landing review comments from Darin for r271495.
+
+        * Shared/cg/ShareableBitmapCG.cpp:
+        (WebKit::ShareableBitmap::calculateBytesPerRow):
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::makeCGImageCopy):
+
 2021-01-14  Peng Liu  <[email protected]>
 
         [Cocoa] Add a script to generate the "Feature Flags" plist file

Modified: trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp (271500 => 271501)


--- trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp	2021-01-14 22:48:43 UTC (rev 271500)
+++ trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp	2021-01-14 22:51:24 UTC (rev 271501)
@@ -73,9 +73,9 @@
 Checked<unsigned, RecordOverflow> ShareableBitmap::calculateBytesPerRow(WebCore::IntSize size, const Configuration& configuration)
 {
     Checked<unsigned, RecordOverflow> bytesPerRow = calculateBytesPerPixel(configuration) * size.width();
+#if HAVE(IOSURFACE)
     if (bytesPerRow.hasOverflowed())
         return bytesPerRow;
-#if HAVE(IOSURFACE)
     return IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, bytesPerRow.unsafeGet());
 #else
     return bytesPerRow;
@@ -105,8 +105,6 @@
 
     ref(); // Balanced by deref in releaseBitmapContextData.
 
-    ASSERT(bitmapContext.get());
-
     // We want the origin to be in the top left corner so we flip the backing store context.
     CGContextTranslateCTM(bitmapContext.get(), 0, m_size.height());
     CGContextScaleCTM(bitmapContext.get(), 1, -1);
@@ -145,8 +143,7 @@
     if (!graphicsContext)
         return nullptr;
 
-    RetainPtr<CGImageRef> image = adoptCF(CGBitmapContextCreateImage(graphicsContext->platformContext()));
-    return image;
+    return adoptCF(CGBitmapContextCreateImage(graphicsContext->platformContext()));
 }
 
 RetainPtr<CGImageRef> ShareableBitmap::makeCGImage()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to