Make RenderingMode and AlphaPremultiplication enum classes and move them to separate...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2020 00:26:24 +0000 (00:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jan 2020 00:26:24 +0000 (00:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=206516

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-01-21
Reviewed by Tim Horton.

Source/WebCore:

RenderingMode and AlphaPremultiplication need to be encoded and decoded
when they are sent from the WebProcess to the GPUProcess.

* Headers.cmake:
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readImageBitmap):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::copiedImage const):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const):
* html/ImageBitmap.cpp:
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::transferToImageBitmap):
(WebCore::OffscreenCanvas::createImageBuffer const):
(WebCore::OffscreenCanvas::takeImageBuffer const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createCompositingBuffer):
(WebCore::CanvasRenderingContext2DBase::createPattern):
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::isAccelerated const):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* platform/graphics/AlphaPremultiplication.h: Added.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::renderingMode const):
* platform/graphics/GraphicsTypes.cpp:
* platform/graphics/GraphicsTypes.h:
* platform/graphics/ImageBuffer.h:
* platform/graphics/RenderingMode.h: Added.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::getScratchBuffer):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawShadowLayer):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::~ImageBufferData):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/filters/Filter.h:
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):

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

38 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Headers.cmake
Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/html/CustomPaintCanvas.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/ImageBitmap.cpp
Source/WebCore/html/OffscreenCanvas.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/page/FrameSnapshotting.cpp
Source/WebCore/platform/graphics/AlphaPremultiplication.h [new file with mode: 0644]
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsTypes.cpp
Source/WebCore/platform/graphics/GraphicsTypes.h
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/RenderingMode.h [new file with mode: 0644]
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h
Source/WebCore/platform/graphics/filters/Filter.h
Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/shapes/Shape.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm

index 8692e6d..ad44d5c 100644 (file)
@@ -1,3 +1,83 @@
+2020-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
+        https://bugs.webkit.org/show_bug.cgi?id=206516
+
+        Reviewed by Tim Horton.
+
+        RenderingMode and AlphaPremultiplication need to be encoded and decoded
+        when they are sent from the WebProcess to the GPUProcess.
+
+        * Headers.cmake:
+        * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
+        (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneDeserializer::readImageBitmap):
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::image):
+        * html/CustomPaintCanvas.cpp:
+        (WebCore::CustomPaintCanvas::copiedImage const):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::createImageBuffer const):
+        * html/ImageBitmap.cpp:
+        * html/OffscreenCanvas.cpp:
+        (WebCore::OffscreenCanvas::transferToImageBitmap):
+        (WebCore::OffscreenCanvas::createImageBuffer const):
+        (WebCore::OffscreenCanvas::takeImageBuffer const):
+        * html/canvas/CanvasRenderingContext2DBase.cpp:
+        (WebCore::CanvasRenderingContext2DBase::createCompositingBuffer):
+        (WebCore::CanvasRenderingContext2DBase::createPattern):
+        * html/canvas/ImageBitmapRenderingContext.cpp:
+        (WebCore::ImageBitmapRenderingContext::isAccelerated const):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
+        * page/FrameSnapshotting.cpp:
+        (WebCore::snapshotFrameRectWithClip):
+        * platform/graphics/AlphaPremultiplication.h: Added.
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::nativeImageForCurrentFrameRespectingOrientation):
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContext::renderingMode const):
+        * platform/graphics/GraphicsTypes.cpp:
+        * platform/graphics/GraphicsTypes.h:
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/RenderingMode.h: Added.
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ScratchBuffer::getScratchBuffer):
+        (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawRectShadowWithTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
+        (WebCore::ShadowBlur::drawShadowLayer):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBufferData::~ImageBufferData):
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/graphics/cg/ImageBufferDataCG.h:
+        * platform/graphics/filters/Filter.h:
+        * platform/graphics/texmap/BitmapTexture.cpp:
+        (WebCore::BitmapTexture::updateContents):
+        * platform/graphics/win/ImageBufferDirect2D.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::imageBuffer const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects const):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape):
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::nativeImageForCurrentFrame):
+
 2020-01-21  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r254807 and r254849.
index bb87806..4552c05 100644 (file)
@@ -1031,6 +1031,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     platform/gamepad/GamepadProviderClient.h
     platform/gamepad/PlatformGamepad.h
 
+    platform/graphics/AlphaPremultiplication.h
     platform/graphics/ANGLEWebKitBridge.h
     platform/graphics/AudioTrackPrivate.h
     platform/graphics/BitmapImage.h
@@ -1128,6 +1129,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
     platform/graphics/PlatformTimeRanges.h
     platform/graphics/Region.h
     platform/graphics/RemoteVideoSample.h
+    platform/graphics/RenderingMode.h
     platform/graphics/RoundedRect.h
     platform/graphics/StringTruncator.h
     platform/graphics/TabSize.h
index 4641d58..7465d0e 100644 (file)
@@ -284,7 +284,7 @@ void ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNee
 
         auto bitmapImage = BitmapImage::create();
         bitmapImage->setData(WTFMove(bufferToSanitize), true);
-        auto imageBuffer = ImageBuffer::create(bitmapImage->size(), Unaccelerated);
+        auto imageBuffer = ImageBuffer::create(bitmapImage->size(), RenderingMode::Unaccelerated);
         if (!imageBuffer) {
             m_data = { nullString() };
             return;
index 9a72cb1..da92cde 100644 (file)
                724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
                724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               7299BC6723D6A53200CC6883 /* AlphaPremultiplication.h in Headers */ = {isa = PBXBuildFile; fileRef = 7299BC6423D686A600CC6883 /* AlphaPremultiplication.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               7299BC6823D6A53E00CC6883 /* RenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 7299BC6623D686C600CC6883 /* RenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; };
                75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; };
                75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */; };
                727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTsRGB.cpp; sourceTree = "<group>"; };
                727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTsRGB.h; sourceTree = "<group>"; };
                727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTsRGB.idl; sourceTree = "<group>"; };
+               7299BC6423D686A600CC6883 /* AlphaPremultiplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlphaPremultiplication.h; sourceTree = "<group>"; };
+               7299BC6623D686C600CC6883 /* RenderingMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderingMode.h; sourceTree = "<group>"; };
                72C18A3F230B04B7006847C7 /* ImagePaintingOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImagePaintingOptions.h; sourceTree = "<group>"; };
                72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTsRGB.cpp; sourceTree = "<group>"; };
                72E417621A2E8D2F004C562A /* JSEXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTsRGB.h; sourceTree = "<group>"; };
                                FBC220DD1237FBEB00BCF788 /* opengl */,
                                3721493318F0B6D600156EDC /* opentype */,
                                49E911B20EF86D27009D0CAF /* transforms */,
+                               7299BC6423D686A600CC6883 /* AlphaPremultiplication.h */,
                                490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */,
                                490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */,
                                BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
                                BCAB418013E356E800D8AAF3 /* Region.h */,
                                073A15512177A39800EA08F2 /* RemoteVideoSample.cpp */,
                                073A15532177A39A00EA08F2 /* RemoteVideoSample.h */,
+                               7299BC6623D686C600CC6883 /* RenderingMode.h */,
                                A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */,
                                A73F95FD12C97BFE0031AAF9 /* RoundedRect.h */,
                                0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */,
                                BCF7E491137CD7C7001DDAE7 /* AdjustViewSizeOrNot.h in Headers */,
                                84D0C4061115F1EA0018AA34 /* AffineTransform.h in Headers */,
                                83BB5C881D5D6F45005A71F4 /* AllDescendantsCollection.h in Headers */,
+                               7299BC6723D6A53200CC6883 /* AlphaPremultiplication.h in Headers */,
                                CEDA12D7152CA1CB00D9E08D /* AlternativeTextClient.h in Headers */,
                                CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */,
                                CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */,
                                BCEA4876097D93020094C9E4 /* RenderImage.h in Headers */,
                                08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */,
                                08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */,
+                               7299BC6823D6A53E00CC6883 /* RenderingMode.h in Headers */,
                                556C7C4B22123997009B06CA /* RenderingUpdateScheduler.h in Headers */,
                                BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */,
                                B595FF471824CEE300FF51CD /* RenderIterator.h in Headers */,
index 64dff2d..eda1717 100644 (file)
@@ -2785,7 +2785,7 @@ private:
             return JSValue();
         }
 
-        auto buffer = ImageBuffer::create(FloatSize(logicalWidth, logicalHeight), Unaccelerated, resolutionScale);
+        auto buffer = ImageBuffer::create(FloatSize(logicalWidth, logicalHeight), RenderingMode::Unaccelerated, resolutionScale);
         if (!buffer) {
             fail();
             return JSValue();
index e5b8ab4..2fa53aa 100644 (file)
@@ -116,7 +116,7 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement& renderer, const FloatSiz
 
     // Transform Image into ImageBuffer.
     // FIXME (149424): This buffer should not be unconditionally unaccelerated.
-    auto texture = ImageBuffer::create(size, Unaccelerated);
+    auto texture = ImageBuffer::create(size, RenderingMode::Unaccelerated);
     if (!texture)
         return &Image::nullImage();
 
index f4b7707..147762f 100644 (file)
@@ -93,7 +93,7 @@ Image* CustomPaintCanvas::copiedImage() const
     if (!width() || !height())
         return nullptr;
 
-    m_copiedBuffer = ImageBuffer::create(size(), Unaccelerated, 1, ColorSpace::SRGB, nullptr);
+    m_copiedBuffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated, 1, ColorSpace::SRGB, nullptr);
     if (!m_copiedBuffer)
         return nullptr;
 
index 23d9b34..b844471 100644 (file)
@@ -885,7 +885,7 @@ void HTMLCanvasElement::createImageBuffer() const
     if (!width() || !height())
         return;
 
-    RenderingMode renderingMode = shouldAccelerate(size()) ? Accelerated : Unaccelerated;
+    RenderingMode renderingMode = shouldAccelerate(size()) ? RenderingMode::Accelerated : RenderingMode::Unaccelerated;
 
     auto hostWindow = (document().view() && document().view()->root()) ? document().view()->root()->hostWindow() : nullptr;
     setImageBuffer(ImageBuffer::create(size(), renderingMode, 1, ColorSpace::SRGB, hostWindow));
index 5f49f73..2b81989 100644 (file)
@@ -61,9 +61,9 @@ namespace WebCore {
 WTF_MAKE_ISO_ALLOCATED_IMPL(ImageBitmap);
 
 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
-static RenderingMode bufferRenderingMode = Accelerated;
+static RenderingMode bufferRenderingMode = RenderingMode::Accelerated;
 #else
-static RenderingMode bufferRenderingMode = Unaccelerated;
+static RenderingMode bufferRenderingMode = RenderingMode::Unaccelerated;
 #endif
 
 Ref<ImageBitmap> ImageBitmap::create(IntSize size)
index f744851..755f11e 100644 (file)
@@ -126,7 +126,7 @@ ExceptionOr<RefPtr<ImageBitmap>> OffscreenCanvas::transferToImageBitmap()
             return { RefPtr<ImageBitmap> { nullptr } };
 
         if (!m_hasCreatedImageBuffer)
-            return { ImageBitmap::create({ ImageBuffer::create(size(), Unaccelerated), true }) };
+            return { ImageBitmap::create({ ImageBuffer::create(size(), RenderingMode::Unaccelerated), true }) };
 
         auto buffer = takeImageBuffer();
         if (!buffer)
@@ -243,7 +243,7 @@ void OffscreenCanvas::createImageBuffer() const
     if (!width() || !height())
         return;
 
-    setImageBuffer(ImageBuffer::create(size(), Unaccelerated));
+    setImageBuffer(ImageBuffer::create(size(), RenderingMode::Unaccelerated));
 }
 
 std::unique_ptr<ImageBuffer> OffscreenCanvas::takeImageBuffer() const
@@ -257,7 +257,7 @@ std::unique_ptr<ImageBuffer> OffscreenCanvas::takeImageBuffer() const
     if (size().isEmpty())
         return nullptr;
 
-    return setImageBuffer(ImageBuffer::create(size(), Unaccelerated));
+    return setImageBuffer(ImageBuffer::create(size(), RenderingMode::Unaccelerated));
 }
 
 void OffscreenCanvas::reset()
index 89d8f42..d494712 100644 (file)
@@ -1806,7 +1806,7 @@ template<class T> IntRect CanvasRenderingContext2DBase::calculateCompositingBuff
 
 std::unique_ptr<ImageBuffer> CanvasRenderingContext2DBase::createCompositingBuffer(const IntRect& bufferRect)
 {
-    return ImageBuffer::create(bufferRect.size(), isAccelerated() ? Accelerated : Unaccelerated);
+    return ImageBuffer::create(bufferRect.size(), isAccelerated() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated);
 }
 
 void CanvasRenderingContext2DBase::compositeBuffer(ImageBuffer& buffer, const IntRect& bufferRect, CompositeOperator op)
@@ -1990,7 +1990,7 @@ ExceptionOr<RefPtr<CanvasPattern>> CanvasRenderingContext2DBase::createPattern(H
         return RefPtr<CanvasPattern> { CanvasPattern::create(BitmapImage::create(WTFMove(nativeImage)), repeatX, repeatY, originClean) };
 #endif
 
-    auto imageBuffer = ImageBuffer::create(size(videoElement), drawingContext() ? drawingContext()->renderingMode() : Accelerated);
+    auto imageBuffer = ImageBuffer::create(size(videoElement), drawingContext() ? drawingContext()->renderingMode() : RenderingMode::Accelerated);
     if (!imageBuffer)
         return nullptr;
 
index 14ea37d..b51b4db 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 WTF_MAKE_ISO_ALLOCATED_IMPL(ImageBitmapRenderingContext);
 
 #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
-static RenderingMode bufferRenderingMode = Accelerated;
+static RenderingMode bufferRenderingMode = RenderingMode::Accelerated;
 #else
-static RenderingMode bufferRenderingMode = Unaccelerated;
+static RenderingMode bufferRenderingMode = RenderingMode::Unaccelerated;
 #endif
 
 std::unique_ptr<ImageBitmapRenderingContext> ImageBitmapRenderingContext::create(CanvasBase& canvas, ImageBitmapRenderingContextSettings&& settings)
@@ -69,7 +69,7 @@ HTMLCanvasElement* ImageBitmapRenderingContext::canvas() const
 
 bool ImageBitmapRenderingContext::isAccelerated() const
 {
-    return bufferRenderingMode == Accelerated;
+    return bufferRenderingMode == RenderingMode::Accelerated;
 }
 
 void ImageBitmapRenderingContext::setOutputBitmap(RefPtr<ImageBitmap> imageBitmap)
index 67ca53c..4288216 100644 (file)
@@ -6386,7 +6386,7 @@ ImageBuffer* WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer(const I
     }
 
     // FIXME (149423): Should this ImageBuffer be unconditionally unaccelerated?
-    std::unique_ptr<ImageBuffer> temp = ImageBuffer::create(size, Unaccelerated);
+    std::unique_ptr<ImageBuffer> temp = ImageBuffer::create(size, RenderingMode::Unaccelerated);
     if (!temp)
         return nullptr;
     ASSERT(m_buffers.size() > 0);
index 34ba372..f6bbfad 100644 (file)
@@ -1447,7 +1447,7 @@ RefPtr<Image> MediaControlTextTrackContainerElement::createTextTrackRepresentati
     IntRect paintingRect = IntRect(IntPoint(), layer->size());
 
     // FIXME (149422): This buffer should not be unconditionally unaccelerated.
-    std::unique_ptr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), Unaccelerated, deviceScaleFactor));
+    std::unique_ptr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), RenderingMode::Unaccelerated, deviceScaleFactor));
     if (!buffer)
         return nullptr;
 
index 0a44c2f..e24d92e 100644 (file)
@@ -111,7 +111,7 @@ std::unique_ptr<ImageBuffer> snapshotFrameRectWithClip(Frame& frame, const IntRe
     if (options & SnapshotOptionsPaintWithIntegralScaleFactor)
         scaleFactor = ceilf(scaleFactor);
 
-    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), Unaccelerated, scaleFactor);
+    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, scaleFactor);
     if (!buffer)
         return nullptr;
     buffer->context().translate(-imageRect.x(), -imageRect.y());
diff --git a/Source/WebCore/platform/graphics/AlphaPremultiplication.h b/Source/WebCore/platform/graphics/AlphaPremultiplication.h
new file mode 100644 (file)
index 0000000..6d1caef
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2020 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. ``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
+ * 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.
+ */
+
+#pragma once
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+enum class AlphaPremultiplication : uint8_t {
+    Premultiplied,
+    Unpremultiplied
+};
+
+WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, AlphaPremultiplication);
+
+} // namespace WebCore
index c71d98f..482244a 100644 (file)
@@ -160,7 +160,7 @@ NativeImagePtr BitmapImage::nativeImageForCurrentFrameRespectingOrientation(cons
         return image;
 
     FloatRect rect = { FloatPoint(), size() };
-    auto buffer = ImageBuffer::create(rect.size(), Unaccelerated);
+    auto buffer = ImageBuffer::create(rect.size(), RenderingMode::Unaccelerated);
     if (!buffer)
         return image;
 
index f586dd4..e5c31c1 100644 (file)
@@ -35,6 +35,7 @@
 #include "ImageOrientation.h"
 #include "ImagePaintingOptions.h"
 #include "Pattern.h"
+#include "RenderingMode.h"
 #include <wtf/Function.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/OptionSet.h>
@@ -350,7 +351,7 @@ public:
     WEBCORE_EXPORT void setIsAcceleratedContext(bool);
 #endif
     bool isAcceleratedContext() const;
-    RenderingMode renderingMode() const { return isAcceleratedContext() ? Accelerated : Unaccelerated; }
+    RenderingMode renderingMode() const { return isAcceleratedContext() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated; }
 
     WEBCORE_EXPORT void save();
     WEBCORE_EXPORT void restore();
index 458ae72..dc54a99 100644 (file)
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "GraphicsTypes.h"
 
+#include "AlphaPremultiplication.h"
 #include <wtf/Assertions.h>
 #include <wtf/text/TextStream.h>
 #include <wtf/text/WTFString.h>
index ceea1da..57eebdc 100644 (file)
@@ -122,17 +122,6 @@ enum TextAlign {
     RightTextAlign
 };
 
-enum RenderingMode {
-    Unaccelerated,
-    UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store.
-    Accelerated
-};
-
-enum class AlphaPremultiplication {
-    Premultiplied,
-    Unpremultiplied
-};
-
 String compositeOperatorName(WebCore::CompositeOperator, WebCore::BlendMode);
 String blendModeName(WebCore::BlendMode);
 bool parseBlendMode(const String&, WebCore::BlendMode&);
@@ -143,7 +132,6 @@ WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, WebCore::CompositeO
 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, WindRule);
 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, LineCap);
 WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, LineJoin);
-WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, AlphaPremultiplication);
 
 } // namespace WebCore
 
index cb74384..62d0a5b 100644 (file)
@@ -28,6 +28,7 @@
 #pragma once
 
 #include "AffineTransform.h"
+#include "AlphaPremultiplication.h"
 #include "ColorSpace.h"
 #include "GraphicsTypes.h"
 #include "GraphicsTypesGL.h"
@@ -35,6 +36,7 @@
 #include "ImagePaintingOptions.h"
 #include "IntSize.h"
 #include "PlatformLayer.h"
+#include "RenderingMode.h"
 #include <JavaScriptCore/Uint8ClampedArray.h>
 #include <memory>
 #include <wtf/Forward.h>
@@ -194,4 +196,3 @@ Vector<uint8_t> data(const ImageData&, const String& mimeType, Optional<double>
 #endif
 
 } // namespace WebCore
-
diff --git a/Source/WebCore/platform/graphics/RenderingMode.h b/Source/WebCore/platform/graphics/RenderingMode.h
new file mode 100644 (file)
index 0000000..69d8ae8
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 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. ``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
+ * 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.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+enum class RenderingMode : uint8_t {
+    Accelerated,
+    Unaccelerated,
+};
+
+} // namespace WebCore
index 4041b3f..681ab56 100644 (file)
@@ -83,7 +83,7 @@ public:
         clearScratchBuffer();
 
         // ShadowBlur is not used with accelerated drawing, so it's OK to make an unconditionally unaccelerated buffer.
-        m_imageBuffer = ImageBuffer::create(roundedSize, Unaccelerated, 1);
+        m_imageBuffer = ImageBuffer::create(roundedSize, RenderingMode::Unaccelerated, 1);
         return m_imageBuffer.get();
     }
 
@@ -593,7 +593,7 @@ void ShadowBlur::drawInsetShadow(const AffineTransform& transform, const IntRect
 
 void ShadowBlur::drawRectShadowWithoutTiling(const AffineTransform&, const FloatRoundedRect& shadowedRect, const LayerImageProperties& layerImageProperties, const DrawBufferCallback& drawBuffer)
 {
-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), Unaccelerated, 1);
+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1);
     if (!layerImage)
         return;
 
@@ -621,7 +621,7 @@ void ShadowBlur::drawRectShadowWithoutTiling(const AffineTransform&, const Float
 
 void ShadowBlur::drawInsetShadowWithoutTiling(const AffineTransform&, const FloatRect& fullRect, const FloatRoundedRect& holeRect, const LayerImageProperties& layerImageProperties, const DrawBufferCallback& drawBuffer)
 {
-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), Unaccelerated, 1);
+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1);
     if (!layerImage)
         return;
 
@@ -685,7 +685,7 @@ void ShadowBlur::drawRectShadowWithTiling(const AffineTransform& transform, cons
     auto* layerImage = ScratchBuffer::singleton().getScratchBuffer(templateSize);
 #else
     UNUSED_PARAM(layerImageProperties);
-    auto layerImageBuffer = ImageBuffer::create(templateSize, Unaccelerated, 1);
+    auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1);
     auto* layerImage = layerImageBuffer.get();
 #endif
 
@@ -739,7 +739,7 @@ void ShadowBlur::drawInsetShadowWithTiling(const AffineTransform& transform, con
 #if USE(CG)
     auto* layerImage = ScratchBuffer::singleton().getScratchBuffer(templateSize);
 #else
-    auto layerImageBuffer = ImageBuffer::create(templateSize, Unaccelerated, 1);
+    auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1);
     auto* layerImage = layerImageBuffer.get();
 #endif
 
@@ -912,7 +912,7 @@ void ShadowBlur::drawShadowLayer(const AffineTransform& transform, const IntRect
 
     adjustBlurRadius(transform);
 
-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties->layerSize), Unaccelerated, 1);
+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties->layerSize), RenderingMode::Unaccelerated, 1);
     if (!layerImage)
         return;
 
index 1f1333a..ccc5f9c 100644 (file)
@@ -103,7 +103,7 @@ ImageBufferData::ImageBufferData(const IntSize& size, RenderingMode renderingMod
 
 ImageBufferData::~ImageBufferData()
 {
-    if (m_renderingMode != Accelerated)
+    if (m_renderingMode != RenderingMode::Accelerated)
         return;
 
 #if ENABLE(ACCELERATED_2D_CANVAS)
@@ -292,14 +292,14 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpac
         return;
 
 #if ENABLE(ACCELERATED_2D_CANVAS)
-    if (m_data.m_renderingMode == Accelerated) {
+    if (m_data.m_renderingMode == RenderingMode::Accelerated) {
         m_data.createCairoGLSurface();
         if (!m_data.m_surface || cairo_surface_status(m_data.m_surface.get()) != CAIRO_STATUS_SUCCESS)
-            m_data.m_renderingMode = Unaccelerated; // If allocation fails, fall back to non-accelerated path.
+            m_data.m_renderingMode = RenderingMode::Unaccelerated; // If allocation fails, fall back to non-accelerated path.
     }
-    if (m_data.m_renderingMode == Unaccelerated)
+    if (m_data.m_renderingMode == RenderingMode::Unaccelerated)
 #else
-    ASSERT(m_data.m_renderingMode != Accelerated);
+    ASSERT(m_data.m_renderingMode != RenderingMode::Accelerated);
 #endif
     {
         static cairo_user_data_key_t s_surfaceDataKey;
index 356f196..947ff93 100644 (file)
@@ -127,7 +127,7 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, CGColorSp
     m_size = IntSize(scaledWidth, scaledHeight);
     m_data.backingStoreSize = m_size;
 
-    bool accelerateRendering = renderingMode == Accelerated;
+    bool accelerateRendering = renderingMode == RenderingMode::Accelerated;
     if (m_size.width() <= 0 || m_size.height() <= 0)
         return;
 
index c55a54a..3e2374b 100644 (file)
@@ -26,6 +26,7 @@
 
 #pragma once
 
+#include "AlphaPremultiplication.h"
 #include "Image.h"
 #include <JavaScriptCore/Uint8ClampedArray.h>
 #include <wtf/CheckedArithmetic.h>
index 49e8c5a..dd35cc6 100644 (file)
@@ -71,7 +71,7 @@ private:
     std::unique_ptr<ImageBuffer> m_sourceImage;
     FloatSize m_filterResolution;
     AffineTransform m_absoluteTransform;
-    RenderingMode m_renderingMode { Unaccelerated };
+    RenderingMode m_renderingMode { RenderingMode::Unaccelerated };
     float m_filterScale { 1 };
 };
 
index 7d2cefd..f039138 100644 (file)
@@ -38,7 +38,7 @@ void BitmapTexture::updateContents(TextureMapper&, GraphicsLayer* sourceLayer, c
 {
     // Making an unconditionally unaccelerated buffer here is OK because this code
     // isn't used by any platforms that respect the accelerated bit.
-    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(targetRect.size(), Unaccelerated);
+    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(targetRect.size(), RenderingMode::Unaccelerated);
 
     if (!imageBuffer)
         return;
index 5e9cf05..b8e3b0b 100644 (file)
@@ -91,7 +91,7 @@ ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpac
     m_size = IntSize(scaledWidth, scaledHeight);
     m_data.backingStoreSize = m_size;
 
-    bool accelerateRendering = renderingMode == Accelerated;
+    bool accelerateRendering = renderingMode == RenderingMode::Accelerated;
     if (m_size.width() <= 0 || m_size.height() <= 0)
         return;
 
index ca11bb8..5ac9d66 100644 (file)
@@ -458,7 +458,7 @@ ImageBuffer* MockRealtimeVideoSource::imageBuffer() const
     if (m_imageBuffer)
         return m_imageBuffer.get();
 
-    m_imageBuffer = ImageBuffer::create(captureSize(), Unaccelerated);
+    m_imageBuffer = ImageBuffer::create(captureSize(), RenderingMode::Unaccelerated);
     if (!m_imageBuffer)
         return nullptr;
 
index d5b91b2..8f50e57 100644 (file)
@@ -6905,7 +6905,7 @@ void RenderLayer::updateFilterPaintingStrategy()
     }
     
     ensureLayerFilters();
-    m_filters->buildFilter(renderer(), page().deviceScaleFactor(), renderer().settings().acceleratedFiltersEnabled() ? Accelerated : Unaccelerated);
+    m_filters->buildFilter(renderer(), page().deviceScaleFactor(), renderer().settings().acceleratedFiltersEnabled() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated);
 }
 
 void RenderLayer::filterNeedsRepaint()
index 9142029..851a866 100644 (file)
@@ -181,7 +181,7 @@ std::unique_ptr<Shape> Shape::createRasterShape(Image* image, float threshold, c
     IntRect marginRect = snappedIntRect(marginR);
     auto intervals = makeUnique<RasterShapeIntervals>(marginRect.height(), -marginRect.y());
     // FIXME (149420): This buffer should not be unconditionally unaccelerated.
-    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size(), Unaccelerated);
+    std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated);
 
     if (imageBuffer) {
         GraphicsContext& graphicsContext = imageBuffer->context();
index 08e4928..1d77b63 100644 (file)
@@ -142,7 +142,7 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderElement& renderer, c
 
     if (shouldCreateClipperMaskImage && !repaintRect.isEmpty()) {
         // FIXME (149469): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks nested clipping, though.
-        clipperMaskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, ColorSpace::SRGB, Unaccelerated, &context);
+        clipperMaskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, ColorSpace::SRGB, RenderingMode::Unaccelerated, &context);
         if (!clipperMaskImage)
             return false;
 
index 75b59b6..dddba43 100644 (file)
@@ -191,7 +191,7 @@ bool RenderSVGResourceFilter::applyResource(RenderElement& renderer, const Rende
     effectiveTransform.scale(scale.width(), scale.height());
     effectiveTransform.multiply(filterData->shearFreeAbsoluteTransform);
 
-    RenderingMode renderingMode = renderer.settings().acceleratedFiltersEnabled() ? Accelerated : Unaccelerated;
+    RenderingMode renderingMode = renderer.settings().acceleratedFiltersEnabled() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated;
     auto sourceGraphic = SVGRenderingContext::createImageBuffer(filterData->drawingRegion, effectiveTransform, ColorSpace::LinearRGB, renderingMode, context);
     if (!sourceGraphic) {
         ASSERT(!m_rendererFilterDataMap.contains(&renderer));
index 1787e18..120c57b 100644 (file)
@@ -71,7 +71,7 @@ bool RenderSVGResourceMasker::applyResource(RenderElement& renderer, const Rende
         const SVGRenderStyle& svgStyle = style().svgStyle();
         ColorSpace colorSpace = svgStyle.colorInterpolation() == ColorInterpolation::LinearRGB ? ColorSpace::LinearRGB : ColorSpace::SRGB;
         // FIXME (149470): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks alpha masking, though.
-        maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, colorSpace, Unaccelerated, context);
+        maskerData->maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, colorSpace, RenderingMode::Unaccelerated, context);
         if (!maskerData->maskImage)
             return false;
 
index b821411..97867aa 100644 (file)
@@ -218,7 +218,7 @@ NativeImagePtr SVGImage::nativeImageForCurrentFrame(const GraphicsContext*)
         return nullptr;
 
     // Cairo does not use the accelerated drawing flag, so it's OK to make an unconditionally unaccelerated buffer.
-    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(size(), Unaccelerated);
+    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated);
     if (!buffer) // failed to allocate image
         return nullptr;
 
index b4c39f2..4f9199f 100644 (file)
@@ -1,3 +1,13 @@
+2020-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
+
+        Make RenderingMode and AlphaPremultiplication enum classes and move them to separate headers
+        https://bugs.webkit.org/show_bug.cgi?id=206516
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (WebContextMenuClient::imageForCurrentSharingServicePickerItem):
+
 2020-01-21  Daniel Bates  <dabates@apple.com>
 
         Add Legacy WebKit SPI and WebKit IPI to show and hide placeholder
index ef03503..2407f10 100644 (file)
@@ -202,7 +202,7 @@ RetainPtr<NSImage> WebContextMenuClient::imageForCurrentSharingServicePickerItem
         return nil;
 
     // This is effectively a snapshot, and will be painted in an unaccelerated fashion in line with FrameSnapshotting.
-    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(rect.size(), Unaccelerated);
+    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(rect.size(), RenderingMode::Unaccelerated);
     if (!buffer)
         return nil;