<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[278832] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/278832">278832</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-06-14 10:27:47 -0700 (Mon, 14 Jun 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>AcceleratedImageBuffer not instantiated but objects are punned to the type
https://bugs.webkit.org/show_bug.cgi?id=226917

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-06-14
Reviewed by Said Abou-Hallawa.

Source/WebCore:

AcceleratedImageBuffer::create would create instance
of ConcreteImageBuffer, not AcceleratedImageBuffer.

Fix by adding a correct create static function.

Tested by new test:
TestWebKitAPI.ImageBufferTests.ImageBufferSubTypeCreateCreatesSubtypes

* platform/graphics/PlatformImageBuffer.h:
(WebCore::IOSurfaceImageBuffer::create):
(WebCore::IOSurfaceImageBuffer::IOSurfaceImageBuffer):
Add the correct factory functions and public constructors.

* platform/graphics/cg/ImageBufferCGBitmapBackend.h:
Add export statements that are needed for the added test.

* platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
(WebCore::FilterEffectRendererCoreImage::imageForSourceGraphic):
(WebCore::FilterEffectRendererCoreImage::renderToImageBuffer):
Change the image creation site to create the explicit IOSurfaceImageBuffer
since that's what it's trying to create.
Change the type-punning call sites to use explicit
IOSurfaceImageBuffer name, as that's what the call site
is intending to use.

Tools:

Add new test
TestWebKitAPI.ImageBufferTests.ImageBufferSubTypeCreateCreatesSubtypes
to test that the code compiles.
Before, it would fail with:
  `error: cannot initialize a member subobject of type 'typename PtrTraits::StorageType' (aka 'WebCore::AcceleratedImageBuffer *') with an
   rvalue of type 'WebCore::ConcreteImageBuffer<WebCore::ImageBufferIOSurfaceBackend> *'`

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp: Added.
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformImageBufferh">trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendh">trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImageh">trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImagemm">trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreImageBufferTestscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Source/WebCore/ChangeLog      2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2021-06-14  Kimmo Kinnunen  <kkinnunen@apple.com>
+
+        AcceleratedImageBuffer not instantiated but objects are punned to the type
+        https://bugs.webkit.org/show_bug.cgi?id=226917
+
+        Reviewed by Said Abou-Hallawa.
+
+        AcceleratedImageBuffer::create would create instance
+        of ConcreteImageBuffer, not AcceleratedImageBuffer.
+
+        Fix by adding a correct create static function.
+
+        Tested by new test:
+        TestWebKitAPI.ImageBufferTests.ImageBufferSubTypeCreateCreatesSubtypes
+
+        * platform/graphics/PlatformImageBuffer.h:
+        (WebCore::IOSurfaceImageBuffer::create):
+        (WebCore::IOSurfaceImageBuffer::IOSurfaceImageBuffer):
+        Add the correct factory functions and public constructors.
+
+        * platform/graphics/cg/ImageBufferCGBitmapBackend.h:
+        Add export statements that are needed for the added test.
+
+        * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+        (WebCore::FilterEffectRendererCoreImage::imageForSourceGraphic):
+        (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer):
+        Change the image creation site to create the explicit IOSurfaceImageBuffer
+        since that's what it's trying to create.
+        Change the type-punning call sites to use explicit
+        IOSurfaceImageBuffer name, as that's what the call site
+        is intending to use.
+
+
</ins><span class="cx"> 2021-06-14  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [LFC][TFC] Add support for flexing columns when the content is also flexing
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformImageBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h     2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h        2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -57,23 +57,35 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using UnacceleratedImageBuffer = ConcreteImageBuffer<UnacceleratedImageBufferBackend>;
</span><ins>+using DisplayListUnacceleratedImageBuffer = DisplayList::ImageBuffer<UnacceleratedImageBufferBackend>;
+using DisplayListAcceleratedImageBuffer = DisplayList::ImageBuffer<AcceleratedImageBufferBackend>;
</ins><span class="cx"> 
</span><span class="cx"> #if HAVE(IOSURFACE)
</span><del>-class AcceleratedImageBuffer : public ConcreteImageBuffer<ImageBufferIOSurfaceBackend> {
-    using Base = ConcreteImageBuffer<AcceleratedImageBufferBackend>;
</del><ins>+class IOSurfaceImageBuffer final : public ConcreteImageBuffer<ImageBufferIOSurfaceBackend> {
+    using Base = ConcreteImageBuffer<ImageBufferIOSurfaceBackend>;
+public:
+    static auto create(const WebCore::FloatSize& size, float resolutionScale, const WebCore::DestinationColorSpace& colorSpace, WebCore::PixelFormat pixelFormat, const HostWindow* hostWindow = nullptr)
+    {
+        return Base::create<IOSurfaceImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+    }
+    static auto create(const FloatSize& size, const GraphicsContext& context)
+    {
+        return Base::create<IOSurfaceImageBuffer>(size, context);
+    }
</ins><span class="cx">     using Base::Base;
</span><del>-public:
</del><ins>+
</ins><span class="cx">     IOSurface& surface() { return *m_backend->surface(); }
</span><span class="cx"> };
</span><ins>+using AcceleratedImageBuffer = IOSurfaceImageBuffer;
</ins><span class="cx"> #else
</span><del>-using AcceleratedImageBuffer = ConcreteImageBuffer<AcceleratedImageBufferBackend>;
</del><ins>+using AcceleratedImageBuffer = ConcreteImageBuffer<UnacceleratedImageBufferBackend>;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-using DisplayListUnacceleratedImageBuffer = DisplayList::ImageBuffer<UnacceleratedImageBufferBackend>;
-using DisplayListAcceleratedImageBuffer = DisplayList::ImageBuffer<AcceleratedImageBufferBackend>;
</del><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::AcceleratedImageBuffer)
</del><ins>+#if HAVE(IOSURFACE)
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::IOSurfaceImageBuffer)
</ins><span class="cx">     static bool isType(const WebCore::ImageBuffer& buffer) { return buffer.renderingMode() == WebCore::RenderingMode::Accelerated; }
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><ins>+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h   2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h      2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -36,13 +36,13 @@
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(ImageBufferCGBitmapBackend);
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(ImageBufferCGBitmapBackend);
</span><span class="cx"> public:
</span><del>-    static IntSize calculateSafeBackendSize(const Parameters&);
-    static size_t calculateMemoryCost(const Parameters&);
</del><ins>+    WEBCORE_EXPORT static IntSize calculateSafeBackendSize(const Parameters&);
+    WEBCORE_EXPORT static size_t calculateMemoryCost(const Parameters&);
</ins><span class="cx"> 
</span><del>-    static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const HostWindow*);
</del><ins>+    WEBCORE_EXPORT static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const HostWindow*);
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Rename to createUsingColorSpaceOfGraphicsContext() (or something like that).
</span><del>-    static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const GraphicsContext&);
</del><ins>+    WEBCORE_EXPORT static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const GraphicsContext&);
</ins><span class="cx"> 
</span><span class="cx">     GraphicsContext& context() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.h (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.h 2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.h    2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if USE(CORE_IMAGE)
</span><span class="cx"> 
</span><span class="cx"> #import "FilterEffectRenderer.h"
</span><ins>+#import "PlatformImageBuffer.h"
</ins><span class="cx"> #import <wtf/Vector.h>
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS CIImage;
</span><span class="lines">@@ -63,7 +64,7 @@
</span><span class="cx">     RetainPtr<CIImage> imageForFEColorMatrix(const FEColorMatrix&, const Vector<RetainPtr<CIImage>>&);
</span><span class="cx">     RetainPtr<CIImage> imageForFEComponentTransfer(const FEComponentTransfer&, Vector<RetainPtr<CIImage>>&);
</span><span class="cx">     
</span><del>-    RefPtr<ImageBuffer> m_outputImageBuffer;
</del><ins>+    RefPtr<IOSurfaceImageBuffer> m_outputImageBuffer;
</ins><span class="cx">     RetainPtr<CIImage> m_outputImage;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImagemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm        2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm   2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #import "GraphicsContextCG.h"
</span><span class="cx"> #import "ImageBuffer.h"
</span><span class="cx"> #import "Logging.h"
</span><del>-#import "PlatformImageBuffer.h"
</del><span class="cx"> #import "SourceGraphic.h"
</span><span class="cx"> #import <CoreImage/CIContext.h>
</span><span class="cx"> #import <CoreImage/CIFilter.h>
</span><span class="lines">@@ -175,8 +174,8 @@
</span><span class="cx">     if (!sourceImage)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    if (is<AcceleratedImageBuffer>(*sourceImage))
-        return [CIImage imageWithIOSurface:downcast<AcceleratedImageBuffer>(*sourceImage).surface().surface()];
</del><ins>+    if (is<IOSurfaceImageBuffer>(*sourceImage))
+        return [CIImage imageWithIOSurface:downcast<IOSurfaceImageBuffer>(*sourceImage).surface().surface()];
</ins><span class="cx">     
</span><span class="cx">     return [CIImage imageWithCGImage:sourceImage->copyNativeImage()->platformImage().get()];
</span><span class="cx"> }
</span><span class="lines">@@ -276,20 +275,13 @@
</span><span class="cx"> void FilterEffectRendererCoreImage::renderToImageBuffer(FilterEffect& lastEffect)
</span><span class="cx"> {
</span><span class="cx">     FloatSize clampedSize = ImageBuffer::clampedSize(lastEffect.absolutePaintRect().size());
</span><del>-    m_outputImageBuffer = ImageBuffer::create(clampedSize, RenderingMode::Accelerated, lastEffect.filter().filterScale(), lastEffect.resultColorSpace(), PixelFormat::BGRA8);
-    
</del><ins>+    m_outputImageBuffer = IOSurfaceImageBuffer::create(clampedSize, lastEffect.filter().filterScale(), lastEffect.resultColorSpace(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!m_outputImageBuffer) {
</span><span class="cx">         clearResult();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
-    // FIXME: In the situation where the Image is too large, an UnacceleratedImageBuffer will be created
-    // in this case, special handling is needed to render to ImageBufferCGBackend instead
-    if (!is<AcceleratedImageBuffer>(*m_outputImageBuffer))
-        return;
-    
-    auto& surface = downcast<AcceleratedImageBuffer>(*m_outputImageBuffer).surface();
-    [sharedCIContext().get() render: m_outputImage.get() toIOSurface: surface.surface() bounds:destRect(lastEffect) colorSpace:lastEffect.resultColorSpace().platformColorSpace()];
</del><ins>+
+    [sharedCIContext().get() render: m_outputImage.get() toIOSurface: m_outputImageBuffer->surface().surface() bounds:destRect(lastEffect) colorSpace:lastEffect.resultColorSpace().platformColorSpace()];
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> FloatRect FilterEffectRendererCoreImage::destRect(const FilterEffect& lastEffect) const
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Tools/ChangeLog       2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2021-06-14  Kimmo Kinnunen  <kkinnunen@apple.com>
+
+        AcceleratedImageBuffer not instantiated but objects are punned to the type
+        https://bugs.webkit.org/show_bug.cgi?id=226917
+
+        Reviewed by Said Abou-Hallawa.
+
+        Add new test
+        TestWebKitAPI.ImageBufferTests.ImageBufferSubTypeCreateCreatesSubtypes
+        to test that the code compiles.
+        Before, it would fail with:
+          `error: cannot initialize a member subobject of type 'typename PtrTraits::StorageType' (aka 'WebCore::AcceleratedImageBuffer *') with an
+           rvalue of type 'WebCore::ConcreteImageBuffer<WebCore::ImageBufferIOSurfaceBackend> *'`
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp: Added.
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2021-06-11  Fujii Hironori  <Hironori.Fujii@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [Win][DumpRenderTree] --no-timeout switch doesn't work
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (278831 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2021-06-14 17:19:38 UTC (rev 278831)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj   2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -589,6 +589,7 @@
</span><span class="cx">          7AE9E5091AE5AE8B00CF874B /* test.pdf in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7AE9E5081AE5AE8B00CF874B /* test.pdf */; };
</span><span class="cx">          7AEAD47F1E20116C00416EFE /* CrossPartitionFileSchemeAccess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AEAD47C1E20113800416EFE /* CrossPartitionFileSchemeAccess.mm */; };
</span><span class="cx">          7AEAD4811E20122700416EFE /* CrossPartitionFileSchemeAccess.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7AEAD47D1E20114E00416EFE /* CrossPartitionFileSchemeAccess.html */; };
</span><ins>+               7B18417C2673860200ED4F8D /* ImageBufferTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B18417B2673860200ED4F8D /* ImageBufferTests.cpp */; };
</ins><span class="cx">           7B2739F32632AB640040F182 /* ThreadAssertionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B2739F22632AB640040F182 /* ThreadAssertionsTest.cpp */; };
</span><span class="cx">          7B7D096A2519F8F90017A078 /* WebGLNoCrashOnOtherThreadAccess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7B7D09692519F8F90017A078 /* WebGLNoCrashOnOtherThreadAccess.mm */; };
</span><span class="cx">          7C1AF7951E8DCBAB002645B9 /* PrepareForMoveToWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C1AF7931E8DCBAB002645B9 /* PrepareForMoveToWindow.mm */; };
</span><span class="lines">@@ -2457,6 +2458,7 @@
</span><span class="cx">          7AE9E5081AE5AE8B00CF874B /* test.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = test.pdf; sourceTree = "<group>"; };
</span><span class="cx">          7AEAD47C1E20113800416EFE /* CrossPartitionFileSchemeAccess.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CrossPartitionFileSchemeAccess.mm; sourceTree = "<group>"; };
</span><span class="cx">          7AEAD47D1E20114E00416EFE /* CrossPartitionFileSchemeAccess.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = CrossPartitionFileSchemeAccess.html; path = Tests/mac/CrossPartitionFileSchemeAccess.html; sourceTree = SOURCE_ROOT; };
</span><ins>+               7B18417B2673860200ED4F8D /* ImageBufferTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBufferTests.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           7B2739F22632AB640040F182 /* ThreadAssertionsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadAssertionsTest.cpp; sourceTree = "<group>"; };
</span><span class="cx">          7B7D09692519F8F90017A078 /* WebGLNoCrashOnOtherThreadAccess.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLNoCrashOnOtherThreadAccess.mm; sourceTree = "<group>"; };
</span><span class="cx">          7C1AF7931E8DCBAB002645B9 /* PrepareForMoveToWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PrepareForMoveToWindow.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -3718,6 +3720,7 @@
</span><span class="cx">                          5CA1DEC71F71F40700E71BD3 /* HTTPHeaderField.cpp */,
</span><span class="cx">                          46FA2FED23846C9A000CCB0C /* HTTPHeaderMap.cpp */,
</span><span class="cx">                          6B9ABE112086952F00D75DE6 /* HTTPParsers.cpp */,
</span><ins>+                               7B18417B2673860200ED4F8D /* ImageBufferTests.cpp */,
</ins><span class="cx">                           7A909A731D877475007E10F8 /* IntPointTests.cpp */,
</span><span class="cx">                          7A909A741D877475007E10F8 /* IntRectTests.cpp */,
</span><span class="cx">                          7A909A751D877475007E10F8 /* IntSizeTests.cpp */,
</span><span class="lines">@@ -5299,6 +5302,7 @@
</span><span class="cx">                          57C6244E2346BCFA00383FE7 /* _WKWebAuthenticationPanel.mm in Sources */,
</span><span class="cx">                          7CCE7EE41A411AE600447C4C /* AboutBlankLoad.cpp in Sources */,
</span><span class="cx">                          7CCE7EB31A411A7E00447C4C /* AcceptsFirstMouse.mm in Sources */,
</span><ins>+                               29E06E5E266F3C0600F1A707 /* AccessibilityIncreaseContrast.mm in Sources */,
</ins><span class="cx">                           C1F4840724EDDB400053ECB8 /* AccessibilityReduceMotion.mm in Sources */,
</span><span class="cx">                          E3F8AB92241AB9CE003E2A7E /* AccessibilityRemoteUIApp.mm in Sources */,
</span><span class="cx">                          2E205BA41F527746005952DD /* AccessibilityTestsIOS.mm in Sources */,
</span><span class="lines">@@ -5511,6 +5515,7 @@
</span><span class="cx">                          510477781D29923B009747EB /* IDBDeleteRecovery.mm in Sources */,
</span><span class="cx">                          5110FCFA1E01CDB8006F8D0B /* IDBIndexUpgradeToV2.mm in Sources */,
</span><span class="cx">                          93BCBC8323CC6F2A00CA2221 /* IDBObjectStoreInfoUpgradeToV2.mm in Sources */,
</span><ins>+                               7B18417C2673860200ED4F8D /* ImageBufferTests.cpp in Sources */,
</ins><span class="cx">                           F44A9AF72649BBDD00E7CB16 /* ImmediateActionTests.mm in Sources */,
</span><span class="cx">                          49AEEF6D2407359D00C87E4C /* InAppBrowserPrivacy.mm in Sources */,
</span><span class="cx">                          51A587861D273AA9004BA9AF /* IndexedDBDatabaseProcessKill.mm in Sources */,
</span><span class="lines">@@ -5726,7 +5731,6 @@
</span><span class="cx">                          5CCB10E4213457E000AC5AF0 /* ShouldGoToBackForwardListItem.mm in Sources */,
</span><span class="cx">                          7CCE7F141A411AE600447C4C /* ShouldKeepCurrentBackForwardListItemInList.cpp in Sources */,
</span><span class="cx">                          37BCA61C1B596BA9002012CA /* ShouldOpenExternalURLsInNewWindowActions.mm in Sources */,
</span><del>-                               29E06E5E266F3C0600F1A707 /* AccessibilityIncreaseContrast.mm in Sources */,
</del><span class="cx">                           7C83E0C51D0A654600FEBCF3 /* ShrinkToFit.mm in Sources */,
</span><span class="cx">                          7CCE7ECD1A411A7E00447C4C /* SimplifyMarkup.mm in Sources */,
</span><span class="cx">                          C149D550242E98DF003EBB12 /* SleepDisabler.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreImageBufferTestscpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp (0 => 278832)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp                             (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp        2021-06-14 17:27:47 UTC (rev 278832)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include <WebCore/ImageBuffer.h>
+#include <WebCore/PlatformImageBuffer.h>
+
+namespace TestWebKitAPI {
+using namespace WebCore;
+
+// Tests that the specialized image buffer constructors construct the expected type of object.
+// Test passes if the test compiles, there was a bug where the code wouldn't compile.
+TEST(ImageBufferTests, ImageBufferSubTypeCreateCreatesSubtypes)
+{
+    auto colorSpace = DestinationColorSpace::SRGB();
+    auto pixelFormat = PixelFormat::BGRA8;
+    FloatSize size { 1.f, 1.f };
+    float scale = 1.f;
+    RefPtr<UnacceleratedImageBuffer> unaccelerated = UnacceleratedImageBuffer::create(size, scale, colorSpace, pixelFormat, nullptr);
+    RefPtr<AcceleratedImageBuffer> accelerated = AcceleratedImageBuffer::create(size, scale, colorSpace, pixelFormat, nullptr);
+    RefPtr<DisplayListAcceleratedImageBuffer> displayListAccelerated = DisplayListAcceleratedImageBuffer::create(size, scale, colorSpace, pixelFormat, nullptr);
+    RefPtr<DisplayListUnacceleratedImageBuffer> displayListUnaccelerated = DisplayListUnacceleratedImageBuffer::create(size, scale, colorSpace, pixelFormat, nullptr);
+    EXPECT_NE(nullptr, accelerated);
+    EXPECT_NE(nullptr, unaccelerated);
+    EXPECT_NE(nullptr, displayListAccelerated);
+    EXPECT_NE(nullptr, displayListUnaccelerated);
+}
+
+}
</ins></span></pre>
</div>
</div>

</body>
</html>