Diff
Modified: trunk/Source/WebCore/ChangeLog (292272 => 292273)
--- trunk/Source/WebCore/ChangeLog 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/ChangeLog 2022-04-03 05:24:35 UTC (rev 292273)
@@ -1,3 +1,40 @@
+2022-04-02 Simon Fraser <simon.fra...@apple.com>
+
+ Plumb the IOSurfacePool through to ImageBufferBackend creation via ImageBuffer::CreationContext
+ https://bugs.webkit.org/show_bug.cgi?id=238695
+
+ Reviewed by Said Abou-Hallawa.
+
+ Wrap the existing HostWindow* and a new IOSurfacePool* pointers into a ImageBuffer::CreationContext
+ struct, and replace the HostWindow* argument with it in buffer creation functions.
+
+ RemoteLayerBackingStoreCollection::allocateBufferForBackingStore() passes the singleton IOSurfacePool
+ which is thus used in the non-GPU Process code path (DOM rendering disabled).
+
+ * css/CSSFilterImageValue.cpp:
+ (WebCore::CSSFilterImageValue::image):
+ * platform/graphics/ConcreteImageBuffer.h:
+ (WebCore::ConcreteImageBuffer::create):
+ * platform/graphics/ImageBuffer.cpp:
+ (WebCore::ImageBuffer::create):
+ * platform/graphics/ImageBuffer.h:
+ (WebCore::ImageBuffer::CreationContext::CreationContext):
+ (WebCore::ImageBuffer::create):
+ * platform/graphics/ImageBufferBackend.h:
+ * platform/graphics/PlatformImageBuffer.h:
+ * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
+ (WebCore::ImageBufferCairoImageSurfaceBackend::create):
+ * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h:
+ * platform/graphics/cg/IOSurfacePool.cpp:
+ (WebCore::IOSurfacePool::poolStatistics const):
+ * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
+ (WebCore::ImageBufferCGBitmapBackend::create):
+ * platform/graphics/cg/ImageBufferCGBitmapBackend.h:
+ * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
+ (WebCore::ImageBufferIOSurfaceBackend::create):
+ * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
+ * platform/graphics/displaylists/DisplayListImageBuffer.h:
+
2022-04-02 Chris Dumez <cdu...@apple.com>
Add default constructor to ASCIILiteral
Modified: trunk/Source/WebCore/css/CSSFilterImageValue.cpp (292272 => 292273)
--- trunk/Source/WebCore/css/CSSFilterImageValue.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -116,7 +116,7 @@
// Transform Image into ImageBuffer.
auto renderingMode = renderer.page().acceleratedFiltersEnabled() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated;
- auto sourceImage = ImageBuffer::create(size, renderingMode, ShouldUseDisplayList::No, RenderingPurpose::DOM, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8, renderer.hostWindow());
+ auto sourceImage = ImageBuffer::create(size, renderingMode, ShouldUseDisplayList::No, RenderingPurpose::DOM, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8, { renderer.hostWindow() });
if (!sourceImage)
return &Image::nullImage();
Modified: trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -37,10 +37,10 @@
class ConcreteImageBuffer : public ImageBuffer {
public:
template<typename ImageBufferType = ConcreteImageBuffer, typename... Arguments>
- static RefPtr<ImageBufferType> create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow, Arguments&&... arguments)
+ static RefPtr<ImageBufferType> create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const CreationContext& creationContext, Arguments&&... arguments)
{
auto parameters = ImageBufferBackend::Parameters { size, resolutionScale, colorSpace, pixelFormat };
- auto backend = BackendType::create(parameters, hostWindow);
+ auto backend = BackendType::create(parameters, creationContext);
if (!backend)
return nullptr;
return adoptRef(new ImageBufferType(parameters, WTFMove(backend), std::forward<Arguments>(arguments)...));
Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -37,7 +37,7 @@
static const float MaxClampedLength = 4096;
static const float MaxClampedArea = MaxClampedLength * MaxClampedLength;
-RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, ShouldUseDisplayList shouldUseDisplayList, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
+RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, ShouldUseDisplayList shouldUseDisplayList, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const CreationContext& creationContext)
{
RefPtr<ImageBuffer> imageBuffer;
@@ -44,30 +44,30 @@
// Give ShouldUseDisplayList a higher precedence since it is a debug option.
if (shouldUseDisplayList == ShouldUseDisplayList::Yes) {
if (renderingMode == RenderingMode::Accelerated)
- imageBuffer = DisplayListAcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ imageBuffer = DisplayListAcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, creationContext);
if (!imageBuffer)
- imageBuffer = DisplayListUnacceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ imageBuffer = DisplayListUnacceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, creationContext);
}
- if (hostWindow && !imageBuffer)
- imageBuffer = hostWindow->createImageBuffer(size, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat);
+ if (creationContext.hostWindow && !imageBuffer)
+ imageBuffer = creationContext.hostWindow->createImageBuffer(size, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat);
if (!imageBuffer)
- imageBuffer = ImageBuffer::create(size, renderingMode, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ imageBuffer = ImageBuffer::create(size, renderingMode, resolutionScale, colorSpace, pixelFormat, creationContext);
return imageBuffer;
}
-RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
+RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const CreationContext& creationContext)
{
RefPtr<ImageBuffer> imageBuffer;
if (renderingMode == RenderingMode::Accelerated)
- imageBuffer = AcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ imageBuffer = AcceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, creationContext);
if (!imageBuffer)
- imageBuffer = UnacceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ imageBuffer = UnacceleratedImageBuffer::create(size, resolutionScale, colorSpace, pixelFormat, creationContext);
return imageBuffer;
}
Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -37,12 +37,24 @@
namespace WebCore {
class Filter;
+class HostWindow;
+class IOSurfacePool;
class ImageBuffer : public ThreadSafeRefCounted<ImageBuffer, WTF::DestructionThread::Main>, public CanMakeWeakPtr<ImageBuffer> {
public:
+ struct CreationContext {
+ // clang 13.1.6 throws errors if we use default initializers here.
+ HostWindow* hostWindow;
+ IOSurfacePool* surfacePool;
+ CreationContext(HostWindow* window = nullptr, IOSurfacePool* pool = nullptr)
+ : hostWindow(window)
+ , surfacePool(pool)
+ { }
+ };
+
// Will return a null pointer on allocation failure.
- WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, ShouldUseDisplayList, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat, const HostWindow* = nullptr);
- WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale, const DestinationColorSpace&, PixelFormat, const HostWindow* = nullptr);
+ WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, ShouldUseDisplayList, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat, const CreationContext& = { });
+ WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale, const DestinationColorSpace&, PixelFormat, const CreationContext& = { });
RefPtr<ImageBuffer> clone() const;
Modified: trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -40,7 +40,6 @@
class GraphicsContext;
class GraphicsContextGL;
-class HostWindow;
class Image;
class NativeImage;
class PixelBuffer;
Modified: trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/PlatformImageBuffer.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -60,9 +60,9 @@
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)
+ static auto create(const WebCore::FloatSize& size, float resolutionScale, const WebCore::DestinationColorSpace& colorSpace, WebCore::PixelFormat pixelFormat, const CreationContext& creationContext = { })
{
- return Base::create<IOSurfaceImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ return Base::create<IOSurfaceImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, creationContext);
}
static auto create(const FloatSize& size, const GraphicsContext& context)
{
Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -73,7 +73,7 @@
return ImageBufferBackend::calculateMemoryCost(backendSize, calculateBytesPerRow(backendSize));
}
-std::unique_ptr<ImageBufferCairoImageSurfaceBackend> ImageBufferCairoImageSurfaceBackend::create(const Parameters& parameters, const HostWindow*)
+std::unique_ptr<ImageBufferCairoImageSurfaceBackend> ImageBufferCairoImageSurfaceBackend::create(const Parameters& parameters, const ImageBuffer::CreationContext&)
{
ASSERT(parameters.pixelFormat == PixelFormat::BGRA8);
Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -44,7 +44,7 @@
static unsigned calculateBytesPerRow(const IntSize& backendSize);
static size_t calculateMemoryCost(const Parameters&);
- static std::unique_ptr<ImageBufferCairoImageSurfaceBackend> create(const Parameters&, const HostWindow*);
+ static std::unique_ptr<ImageBufferCairoImageSurfaceBackend> create(const Parameters&, const ImageBuffer::CreationContext&);
static std::unique_ptr<ImageBufferCairoImageSurfaceBackend> create(const Parameters&, const GraphicsContext&);
private:
Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -370,7 +370,7 @@
totalSize += queueSize;
totalPurgeableSize += queuePurgeableSize;
- stream << " " << keyAndSurfaces.key << ": " << keyAndSurfaces.value.size() << " surfaces for " << queueSize / (1024.0 * 1024.0) << " MB (" << queuePurgeableSize / (1024.0 * 1024.0) << " MB purgeable)";
+ stream << " " << keyAndSurfaces.key << ": " << keyAndSurfaces.value.size() << " surfaces for " << queueSize / (1024.0 * 1024.0) << " MB (" << queuePurgeableSize / (1024.0 * 1024.0) << " MB purgeable)\n";
}
size_t inUseSize = 0;
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -62,7 +62,7 @@
return ImageBufferBackend::calculateMemoryCost(backendSize, calculateBytesPerRow(backendSize));
}
-std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, const HostWindow*)
+std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, const ImageBuffer::CreationContext&)
{
ASSERT(parameters.pixelFormat == PixelFormat::BGRA8);
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -27,6 +27,7 @@
#if USE(CG)
+#include "ImageBuffer.h"
#include "ImageBufferCGBackend.h"
#include <wtf/IsoMalloc.h>
@@ -41,7 +42,7 @@
static IntSize calculateSafeBackendSize(const Parameters&);
static size_t calculateMemoryCost(const Parameters&);
- static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const HostWindow*);
+ static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const ImageBuffer::CreationContext&);
// FIXME: Rename to createUsingColorSpaceOfGraphicsContext() (or something like that).
static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const GraphicsContext&);
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -81,17 +81,17 @@
return ImageBufferCGBackend::contextColorSpace(context);
}
-std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, const HostWindow* hostWindow)
+std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, const ImageBuffer::CreationContext& creationContext)
{
IntSize backendSize = calculateSafeBackendSize(parameters);
if (backendSize.isEmpty())
return nullptr;
- auto surface = IOSurface::create(&IOSurfacePool::sharedPool(), backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
+ auto surface = IOSurface::create(creationContext.surfacePool, backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
if (!surface)
return nullptr;
- RetainPtr<CGContextRef> cgContext = surface->ensurePlatformContext(hostWindow);
+ RetainPtr<CGContextRef> cgContext = surface->ensurePlatformContext(creationContext.hostWindow);
if (!cgContext)
return nullptr;
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -42,7 +42,7 @@
static size_t calculateMemoryCost(const Parameters&);
static size_t calculateExternalMemoryCost(const Parameters&);
- static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, const HostWindow*);
+ static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, const ImageBuffer::CreationContext&);
// FIXME: Rename to createUsingColorSpaceOfGraphicsContext() (or something like that).
static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, const GraphicsContext&);
Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h (292272 => 292273)
--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -40,9 +40,9 @@
using BaseConcreteImageBuffer::baseTransform;
public:
- static auto create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
+ static auto create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const WebCore::ImageBuffer::CreationContext& creationContext)
{
- return BaseConcreteImageBuffer::template create<ImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
+ return BaseConcreteImageBuffer::template create<ImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, creationContext);
}
static auto create(const FloatSize& size, const GraphicsContext& context)
Modified: trunk/Source/WebKit/ChangeLog (292272 => 292273)
--- trunk/Source/WebKit/ChangeLog 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/ChangeLog 2022-04-03 05:24:35 UTC (rev 292273)
@@ -1,3 +1,30 @@
+2022-04-02 Simon Fraser <simon.fra...@apple.com>
+
+ Plumb the IOSurfacePool through to ImageBufferBackend creation via ImageBuffer::CreationContext
+ https://bugs.webkit.org/show_bug.cgi?id=238695
+
+ Reviewed by Said Abou-Hallawa.
+
+ Wrap the existing HostWindow* and a new IOSurfacePool* pointers into a ImageBuffer::CreationContext
+ struct, and replace the HostWindow* argument with it in buffer creation functions.
+
+ RemoteLayerBackingStoreCollection::allocateBufferForBackingStore() passes the singleton IOSurfacePool
+ which is thus used in the non-GPU Process code path (DOM rendering disabled).
+
+ * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp:
+ (WebKit::CGDisplayListImageBufferBackend::create):
+ * Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h:
+ * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+ (WebKit::RemoteLayerBackingStore::ensureFrontBuffer):
+ * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
+ (WebKit::RemoteLayerBackingStoreCollection::allocateBufferForBackingStore):
+ * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
+ (WebKit::ImageBufferShareableBitmapBackend::create):
+ * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:
+ * WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:
+ (WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):
+ * WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h:
+
2022-04-02 Chris Dumez <cdu...@apple.com>
Add default constructor to ASCIILiteral
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp (292272 => 292273)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -86,7 +86,7 @@
return std::unique_ptr<CGDisplayListImageBufferBackend>(new CGDisplayListImageBufferBackend(parameters, WTFMove(context)));
}
-std::unique_ptr<CGDisplayListImageBufferBackend> CGDisplayListImageBufferBackend::create(const Parameters& parameters, const WebCore::HostWindow*)
+std::unique_ptr<CGDisplayListImageBufferBackend> CGDisplayListImageBufferBackend::create(const Parameters& parameters, const WebCore::ImageBuffer::CreationContext&)
{
return CGDisplayListImageBufferBackend::create(parameters);
}
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h (292272 => 292273)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -40,7 +40,7 @@
static size_t calculateMemoryCost(const Parameters&);
static std::unique_ptr<CGDisplayListImageBufferBackend> create(const Parameters&);
- static std::unique_ptr<CGDisplayListImageBufferBackend> create(const Parameters&, const WebCore::HostWindow*);
+ static std::unique_ptr<CGDisplayListImageBufferBackend> create(const Parameters&, const WebCore::ImageBuffer::CreationContext&);
WebCore::GraphicsContext& context() const final;
WebCore::IntSize backendSize() const final;
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (292272 => 292273)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2022-04-03 05:24:35 UTC (rev 292273)
@@ -365,7 +365,7 @@
#if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
if (m_includeDisplayList == IncludeDisplayList::Yes)
- m_frontBuffer.displayListImageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
+ m_frontBuffer.displayListImageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat());
#endif
}
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm (292272 => 292273)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm 2022-04-03 05:24:35 UTC (rev 292273)
@@ -33,6 +33,7 @@
#import "RemoteLayerTreeContext.h"
#import "SwapBuffersDisplayRequirement.h"
#import <WebCore/ConcreteImageBuffer.h>
+#import <WebCore/IOSurfacePool.h>
#import <wtf/text/TextStream.h>
const Seconds volatilityTimerInterval = 200_ms;
@@ -263,9 +264,9 @@
{
switch (backingStore.type()) {
case RemoteLayerBackingStore::Type::IOSurface:
- return WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), nullptr);
+ return WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), { nullptr, &WebCore::IOSurfacePool::sharedPool() });
case RemoteLayerBackingStore::Type::Bitmap:
- return WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), nullptr);
+ return WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(backingStore.size(), backingStore.scale(), WebCore::DestinationColorSpace::SRGB(), backingStore.pixelFormat(), { });
}
return nullptr;
}
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp (292272 => 292273)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -77,7 +77,7 @@
return ImageBufferBackend::calculateMemoryCost(backendSize, calculateBytesPerRow(parameters, backendSize));
}
-std::unique_ptr<ImageBufferShareableBitmapBackend> ImageBufferShareableBitmapBackend::create(const Parameters& parameters, const HostWindow*)
+std::unique_ptr<ImageBufferShareableBitmapBackend> ImageBufferShareableBitmapBackend::create(const Parameters& parameters, const WebCore::ImageBuffer::CreationContext&)
{
ASSERT(parameters.pixelFormat == PixelFormat::BGRA8);
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h (292272 => 292273)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -28,6 +28,7 @@
#if ENABLE(GPU_PROCESS)
#include "ImageBufferBackendHandleSharing.h"
+#include <WebCore/ImageBuffer.h>
#include <WebCore/PlatformImageBufferBackend.h>
#include <wtf/IsoMalloc.h>
@@ -48,7 +49,7 @@
static unsigned calculateBytesPerRow(const Parameters&, const WebCore::IntSize& backendSize);
static size_t calculateMemoryCost(const Parameters&);
- static std::unique_ptr<ImageBufferShareableBitmapBackend> create(const Parameters&, const WebCore::HostWindow*);
+ static std::unique_ptr<ImageBufferShareableBitmapBackend> create(const Parameters&, const WebCore::ImageBuffer::CreationContext&);
static std::unique_ptr<ImageBufferShareableBitmapBackend> create(const Parameters&, ImageBufferBackendHandle);
ImageBufferShareableBitmapBackend(const Parameters&, RefPtr<ShareableBitmap>&&, std::unique_ptr<WebCore::GraphicsContext>&&);
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp (292272 => 292273)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp 2022-04-03 05:24:35 UTC (rev 292273)
@@ -40,13 +40,13 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(ImageBufferShareableMappedIOSurfaceBackend);
-std::unique_ptr<ImageBufferShareableMappedIOSurfaceBackend> ImageBufferShareableMappedIOSurfaceBackend::create(const Parameters& parameters, const HostWindow*)
+std::unique_ptr<ImageBufferShareableMappedIOSurfaceBackend> ImageBufferShareableMappedIOSurfaceBackend::create(const Parameters& parameters, const ImageBuffer::CreationContext& creationContext)
{
IntSize backendSize = calculateSafeBackendSize(parameters);
if (backendSize.isEmpty())
return nullptr;
- auto surface = IOSurface::create(&IOSurfacePool::sharedPool(), backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
+ auto surface = IOSurface::create(creationContext.surfacePool, backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
if (!surface)
return nullptr;
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h (292272 => 292273)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h 2022-04-03 03:56:21 UTC (rev 292272)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.h 2022-04-03 05:24:35 UTC (rev 292273)
@@ -43,7 +43,7 @@
WTF_MAKE_ISO_ALLOCATED(ImageBufferShareableMappedIOSurfaceBackend);
WTF_MAKE_NONCOPYABLE(ImageBufferShareableMappedIOSurfaceBackend);
public:
- static std::unique_ptr<ImageBufferShareableMappedIOSurfaceBackend> create(const Parameters&, const WebCore::HostWindow*);
+ static std::unique_ptr<ImageBufferShareableMappedIOSurfaceBackend> create(const Parameters&, const WebCore::ImageBuffer::CreationContext&);
static std::unique_ptr<ImageBufferShareableMappedIOSurfaceBackend> create(const Parameters&, ImageBufferBackendHandle);
using WebCore::ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend;