From cdeafd299ccc47e6f605831552a044daf5690d02 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 28 Nov 2020 21:52:14 +0100 Subject: [PATCH] Fix build after merge. Large rework of image/BBitmap handling, making things a bit simpler. --- Source/WebCore/PlatformHaiku.cmake | 5 +- .../WebCore/page/haiku/EventHandlerHaiku.cpp | 4 +- .../WebCore/platform/graphics/PlatformImage.h | 29 +++++++ .../DisplayListDrawGlyphsRecorderHaiku.cpp | 51 ++++++++++++ .../graphics/haiku/BitmapImageHaiku.cpp | 2 +- .../graphics/haiku/GraphicsContextHaiku.cpp | 47 ++--------- .../graphics/haiku/ImageBufferDataHaiku.h | 3 +- .../graphics/haiku/ImageBufferHaiku.cpp | 67 ++++++--------- .../haiku/ImageBufferHaikuSurfaceBackend.h | 7 +- .../platform/graphics/haiku/ImageHaiku.cpp | 30 ------- .../haiku/MediaPlayerPrivateHaiku.cpp | 3 - ...StillImageHaiku.h => NativeImageHaiku.cpp} | 53 +++++------- .../graphics/haiku/StillImageHaiku.cpp | 82 ------------------- .../haiku/ImageDecoderHaiku.cpp | 2 +- Source/WebKitLegacy/haiku/API/WebPage.cpp | 57 ++++++++----- Source/WebKitLegacy/haiku/API/WebSettings.cpp | 2 +- .../WebCoreSupport/FrameLoaderClientHaiku.cpp | 7 -- .../WebCoreSupport/FrameLoaderClientHaiku.h | 3 - .../haiku/WebCoreSupport/IconDatabase.cpp | 6 +- .../haiku/WebCoreSupport/IconDatabase.h | 6 +- Source/cmake/WebKitCommon.cmake | 1 + Tools/DumpRenderTree/PlatformHaiku.cmake | 1 + Tools/DumpRenderTree/haiku/DumpRenderTree.cpp | 5 +- .../DumpRenderTree/haiku/TestRunnerHaiku.cpp | 50 ----------- 24 files changed, 193 insertions(+), 330 deletions(-) create mode 100644 Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHaiku.cpp rename Source/WebCore/platform/graphics/haiku/{StillImageHaiku.h => NativeImageHaiku.cpp} (51%) delete mode 100644 Source/WebCore/platform/graphics/haiku/StillImageHaiku.cpp diff --git a/Source/WebCore/PlatformHaiku.cmake b/Source/WebCore/PlatformHaiku.cmake index 729f82efe2f73..1fcfa39823cbe 100644 --- a/Source/WebCore/PlatformHaiku.cmake +++ b/Source/WebCore/PlatformHaiku.cmake @@ -46,7 +46,6 @@ list(APPEND WebCore_SOURCES platform/haiku/PlatformKeyboardEventHaiku.cpp platform/haiku/PlatformMouseEventHaiku.cpp platform/haiku/PlatformScreenHaiku.cpp - platform/haiku/PlatformWheelEventHaiku.cpp platform/haiku/PopupMenuHaiku.cpp platform/haiku/RenderThemeHaiku.cpp platform/haiku/ScrollbarThemeHaiku.cpp @@ -59,6 +58,7 @@ list(APPEND WebCore_SOURCES platform/posix/SharedBufferPOSIX.cpp platform/graphics/WOFFFileFormat.cpp + platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHaiku.cpp platform/graphics/haiku/AffineTransformHaiku.cpp platform/graphics/haiku/BitmapImageHaiku.cpp @@ -83,9 +83,9 @@ list(APPEND WebCore_SOURCES platform/graphics/haiku/IntRectHaiku.cpp platform/graphics/haiku/IntSizeHaiku.cpp platform/graphics/haiku/MediaPlayerPrivateHaiku.cpp + platform/graphics/haiku/NativeImageHaiku.cpp platform/graphics/haiku/PathHaiku.cpp platform/graphics/haiku/SimpleFontDataHaiku.cpp - platform/graphics/haiku/StillImageHaiku.cpp platform/graphics/haiku/TileHaiku.cpp platform/graphics/haiku/TiledBackingStoreHaiku.cpp platform/graphics/haiku/GraphicsLayerHaiku.cpp @@ -355,7 +355,6 @@ list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS platform/DateTimeChooser.h platform/DateTimeChooserClient.h - platform/graphics/haiku/StillImageHaiku.h platform/graphics/haiku/ImageBufferDataHaiku.h platform/graphics/Image.h ) diff --git a/Source/WebCore/page/haiku/EventHandlerHaiku.cpp b/Source/WebCore/page/haiku/EventHandlerHaiku.cpp index 4ab625fbcd981..e60a225f93e65 100644 --- a/Source/WebCore/page/haiku/EventHandlerHaiku.cpp +++ b/Source/WebCore/page/haiku/EventHandlerHaiku.cpp @@ -96,12 +96,12 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const return false; } -bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget& widget) +bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget& widget, OptionSet processingSteps) { if (!widget.isFrameView()) return false; - return static_cast(widget).frame().eventHandler().handleWheelEvent(event); + return static_cast(widget).frame().eventHandler().handleWheelEvent(event, processingSteps); } bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame& subframe) diff --git a/Source/WebCore/platform/graphics/PlatformImage.h b/Source/WebCore/platform/graphics/PlatformImage.h index 192d07f944e9e..f17d298182346 100644 --- a/Source/WebCore/platform/graphics/PlatformImage.h +++ b/Source/WebCore/platform/graphics/PlatformImage.h @@ -32,6 +32,8 @@ typedef struct CGImage* CGImageRef; #include "RefPtrCairo.h" #elif USE(WINGDI) #include "SharedBitmap.h" +#elif USE(HAIKU) +#include #endif namespace WebCore { @@ -44,6 +46,33 @@ using PlatformImagePtr = COMPtr; using PlatformImagePtr = RefPtr; #elif USE(WINGDI) using PlatformImagePtr = RefPtr; +#elif USE(HAIKU) +class BitmapRef: public BBitmap, public RefCounted +{ + public: + BitmapRef(BRect r, uint32 f, color_space c, int32 b) + : BBitmap(r, f, c, b) + { + } + + BitmapRef(BRect r, color_space c, bool v) + : BBitmap(r, c, v) + { + } + + BitmapRef(const BBitmap& other) + : BBitmap(other) + { + } + + BitmapRef(const BitmapRef& other) = delete; + + ~BitmapRef() + { + } +}; + +using PlatformImagePtr = RefPtr; #endif } diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHaiku.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHaiku.cpp new file mode 100644 index 0000000000000..b1dd3e0902c2a --- /dev/null +++ b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHaiku.cpp @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#include "config.h" +#include "DisplayListDrawGlyphsRecorder.h" + +#include "DisplayListItems.h" +#include "DisplayListRecorder.h" +#include "FloatPoint.h" +#include "Font.h" +#include "GlyphBuffer.h" + +namespace WebCore { + +namespace DisplayList { + +DrawGlyphsRecorder::DrawGlyphsRecorder(Recorder& owner, DrawGlyphsDeconstruction) + : m_owner(owner) +{ +} + +void DrawGlyphsRecorder::drawGlyphs(const Font& font, const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs, const FloatPoint& startPoint, FontSmoothingMode smoothingMode) +{ + m_owner.append(font, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs, startPoint, smoothingMode); +} + +} // namespace DisplayList + +} // namespace WebCore diff --git a/Source/WebCore/platform/graphics/haiku/BitmapImageHaiku.cpp b/Source/WebCore/platform/graphics/haiku/BitmapImageHaiku.cpp index 2c74ce4d19a59..5eed0d0d901da 100644 --- a/Source/WebCore/platform/graphics/haiku/BitmapImageHaiku.cpp +++ b/Source/WebCore/platform/graphics/haiku/BitmapImageHaiku.cpp @@ -62,7 +62,7 @@ float subsamplingScale(GraphicsContext&, const FloatRect&, const FloatRect&) return 1; } -void clearNativeImageSubimages(const NativeImagePtr&) +void clearNativeImageSubimages(const PlatformImagePtr&) { } diff --git a/Source/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/Source/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp index 394eeca0d1eae..196323265eda5 100644 --- a/Source/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp +++ b/Source/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp @@ -186,7 +186,7 @@ void GraphicsContext::drawRect(const FloatRect& rect, float borderThickness) } } -void GraphicsContext::drawNativeImage(const NativeImagePtr& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options) +void GraphicsContext::drawPlatformImage(const PlatformImagePtr& image, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options) { if (paintingDisabled()) return; @@ -444,56 +444,25 @@ void GraphicsContext::clipPath(const Path& path, WindRule windRule) // TODO: reset wind rule } -void GraphicsContext::clipToImageBuffer(ImageBuffer& buffer, const FloatRect& destRect) -{ - if (paintingDisabled()) - return; - - NativeImagePtr surface = buffer.copyNativeImage(DontCopyBackingStore); - BPicture picture; - BView* view = platformContext(); - - if (!view) - return; - - view->LockLooper(); - view->BeginPicture(&picture); - view->PushState(); - - view->SetLowColor(make_color(255, 255, 255, 0)); - view->SetViewColor(make_color(255, 255, 255, 0)); - view->SetHighColor(make_color(0, 0, 0, 255)); - view->SetDrawingMode(B_OP_ALPHA); - view->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE); - - view->DrawBitmap(surface.get(), destRect); - - view->PopState(); - view->EndPicture(); - view->ClipToPicture(&picture); - view->UnlockLooper(); -} - -void GraphicsContext::drawPattern(Image& image, const FloatRect& destRect, +void GraphicsContext::drawPlatformPattern(const PlatformImagePtr& image, const WebCore::FloatSize& size, const FloatRect& destRect, const FloatRect& tileRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions&) { if (paintingDisabled()) return; - NativeImagePtr pixels = image.nativeImageForCurrentFrame(); - if (!pixels || !pixels->IsValid()) // If the image hasn't fully loaded. + if (!image->IsValid()) // If the image hasn't fully loaded. return; // Figure out if the image has any alpha transparency, we can use faster drawing if not bool hasAlpha = false; - uint8* bits = reinterpret_cast(pixels->Bits()); - uint32 width = pixels->Bounds().IntegerWidth() + 1; - uint32 height = pixels->Bounds().IntegerHeight() + 1; + uint8* bits = reinterpret_cast(image->Bits()); + uint32 width = image->Bounds().IntegerWidth() + 1; + uint32 height = image->Bounds().IntegerHeight() + 1; - uint32 bytesPerRow = pixels->BytesPerRow(); + uint32 bytesPerRow = image->BytesPerRow(); for (uint32 y = 0; y < height && !hasAlpha; y++) { uint8* p = bits; for (uint32 x = 0; x < width && !hasAlpha; x++) { @@ -516,7 +485,7 @@ void GraphicsContext::drawPattern(Image& image, const FloatRect& destRect, phaseOffsetX -= std::trunc(phaseOffsetX / tileRect.width()) * tileRect.width(); phaseOffsetY -= std::trunc(phaseOffsetY / tileRect.height()) * tileRect.height(); platformContext()->DrawTiledBitmapAsync( - pixels.get(), destRect, BPoint(phaseOffsetX, phaseOffsetY)); + image.get(), destRect, BPoint(phaseOffsetX, phaseOffsetY)); restore(); } diff --git a/Source/WebCore/platform/graphics/haiku/ImageBufferDataHaiku.h b/Source/WebCore/platform/graphics/haiku/ImageBufferDataHaiku.h index 5d58c1961cbe7..5192292342b7b 100644 --- a/Source/WebCore/platform/graphics/haiku/ImageBufferDataHaiku.h +++ b/Source/WebCore/platform/graphics/haiku/ImageBufferDataHaiku.h @@ -44,11 +44,10 @@ class ImageBufferData { ImageBufferData(const IntSize&); ~ImageBufferData(); - NativeImagePtr m_bitmap; BView* m_view; GraphicsContext* m_context; - RefPtr m_image; + RefPtr m_image; }; } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/haiku/ImageBufferHaiku.cpp b/Source/WebCore/platform/graphics/haiku/ImageBufferHaiku.cpp index 648ffcef229ac..697b04d41e5cb 100644 --- a/Source/WebCore/platform/graphics/haiku/ImageBufferHaiku.cpp +++ b/Source/WebCore/platform/graphics/haiku/ImageBufferHaiku.cpp @@ -26,13 +26,13 @@ #include "config.h" #include "ImageBufferHaikuSurfaceBackend.h" +#include "BitmapImage.h" #include "ColorUtilities.h" #include "GraphicsContext.h" #include "ImageData.h" #include "IntRect.h" #include "MIMETypeRegistry.h" #include "NotImplemented.h" -#include "StillImageHaiku.h" #include "JavaScriptCore/JSCInlines.h" #include "JavaScriptCore/TypedArrayInlines.h" @@ -49,23 +49,24 @@ namespace WebCore { ImageBufferData::ImageBufferData(const IntSize& size) - : m_bitmap(adoptRef(new BitmapRef(BRect(0, 0, size.width() - 1, size.height() - 1), B_RGBA32, true))) + : m_image(NativeImage::create(new BitmapRef(BRect(0, 0, size.width() - 1, size.height() - 1), B_RGBA32, true))) , m_view(NULL) , m_context(NULL) { // Always keep the bitmap locked, we are the only client. - m_bitmap->Lock(); + PlatformImagePtr bitmap = m_image->platformImage(); + bitmap->Lock(); if(size.isEmpty()) return; - if (!m_bitmap->IsLocked() || !m_bitmap->IsValid()) + if (!bitmap->IsLocked() || !bitmap->IsValid()) return; - m_view = new BView(m_bitmap->Bounds(), "WebKit ImageBufferData", 0, 0); - m_bitmap->AddChild(m_view); + m_view = new BView(bitmap->Bounds(), "WebKit ImageBufferData", 0, 0); + bitmap->AddChild(m_view); // Fill with completely transparent color. - memset(m_bitmap->Bits(), 0, m_bitmap->BitsLength()); + memset(bitmap->Bits(), 0, bitmap->BitsLength()); // Since ImageBuffer is used mainly for Canvas, explicitly initialize // its view's graphics state with the corresponding canvas defaults @@ -74,8 +75,6 @@ ImageBufferData::ImageBufferData(const IntSize& size) m_view->SetDrawingMode(B_OP_ALPHA); m_view->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE); m_context = new GraphicsContext(m_view); - - m_image = StillImage::createForRendering(m_bitmap); } @@ -85,23 +84,24 @@ ImageBufferData::~ImageBufferData() // m_bitmap owns m_view and deletes it when going out of this destructor. m_image = nullptr; delete m_context; - - m_bitmap->Unlock(); } -NativeImagePtr ImageBufferHaikuSurfaceBackend::copyNativeImage(WebCore::BackingStoreCopy doCopy) const +WTF::RefPtr ImageBufferHaikuSurfaceBackend::copyNativeImage(WebCore::BackingStoreCopy doCopy) const { - if (doCopy == DontCopyBackingStore) - return m_data.m_bitmap; - else - return new BitmapRef(m_data.m_bitmap.get()); + if (doCopy == DontCopyBackingStore) { + PlatformImagePtr ref = m_data.m_image->platformImage(); + return NativeImage::create(std::move(ref)); + } else { + BitmapRef* ref = new BitmapRef(*(BBitmap*)m_data.m_image->platformImage().get()); + return NativeImage::create(ref); + } } std::unique_ptr ImageBufferHaikuSurfaceBackend::create(const FloatSize& size, float resolutionScale, - ColorSpace colorSpace, const HostWindow* window) + ColorSpace colorSpace, PixelFormat, const HostWindow* window) { IntSize backendSize = calculateBackendSize(size, resolutionScale); if (backendSize.isEmpty()) @@ -117,14 +117,14 @@ std::unique_ptr ImageBufferHaikuSurfaceBackend::create(const FloatSize& size, const GraphicsContext&) { - return create(size, 1, ColorSpace::SRGB, NULL); + return create(size, 1, ColorSpace::SRGB, PixelFormat::BGRA8, NULL); } ImageBufferHaikuSurfaceBackend::ImageBufferHaikuSurfaceBackend( const FloatSize& logicalSize, const IntSize& backendSize, float resolutionScale, ColorSpace colorSpace, const HostWindow*) - : ImageBufferBackend(logicalSize, backendSize, resolutionScale, colorSpace) + : ImageBufferBackend(logicalSize, backendSize, resolutionScale, colorSpace, PixelFormat::BGRA8) , m_data(backendSize) { } @@ -133,16 +133,6 @@ ImageBufferHaikuSurfaceBackend::~ImageBufferHaikuSurfaceBackend() { } -ColorFormat ImageBufferHaikuSurfaceBackend::backendColorFormat() const -{ - return ColorFormat::BGRA; -} - -AlphaPremultiplication ImageBufferHaikuSurfaceBackend::backendAlphaPremultiplication() const -{ - return AlphaPremultiplication::Unpremultiplied; -} - GraphicsContext& ImageBufferHaikuSurfaceBackend::context() const { return *m_data.m_context; @@ -153,10 +143,7 @@ RefPtr ImageBufferHaikuSurfaceBackend::copyImage(BackingStoreCopy copyBeh if (m_data.m_view) m_data.m_view->Sync(); - if (copyBehavior == CopyBackingStore) - return StillImage::create(NativeImagePtr(new BitmapRef(*dynamic_cast(m_data.m_bitmap.get())))); - - return StillImage::createForRendering(m_data.m_bitmap); + return BitmapImage::create(copyNativeImage(copyBehavior)); } void ImageBufferHaikuSurfaceBackend::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, @@ -171,7 +158,7 @@ void ImageBufferHaikuSurfaceBackend::draw(GraphicsContext& destContext, const Fl RefPtr copy = copyImage(CopyBackingStore, PreserveResolution::Yes); destContext.drawImage(*copy.get(), destRect, srcRect, options); } else - destContext.drawImage(*m_data.m_image.get(), destRect, srcRect, options); + destContext.drawNativeImage(*m_data.m_image.get(), srcRect.size(), destRect, srcRect, options); } void ImageBufferHaikuSurfaceBackend::drawPattern(GraphicsContext& destContext, @@ -188,23 +175,23 @@ void ImageBufferHaikuSurfaceBackend::drawPattern(GraphicsContext& destContext, RefPtr copy = copyImage(CopyBackingStore, PreserveResolution::Yes); copy->drawPattern(destContext, destRect, srcRect, patternTransform, phase, size, options.compositeOperator()); } else - m_data.m_image->drawPattern(destContext, destRect, srcRect, patternTransform, phase, size, options.compositeOperator()); + destContext.drawPattern(*m_data.m_image.get(), srcRect.size(), destRect, srcRect, patternTransform, phase, size, options.compositeOperator()); } Vector ImageBufferHaikuSurfaceBackend::toBGRAData() const { - return ImageBufferBackend::toBGRAData(m_data.m_bitmap->Bits()); + return ImageBufferBackend::toBGRAData(m_data.m_image->platformImage()->Bits()); } RefPtr ImageBufferHaikuSurfaceBackend::getImageData(AlphaPremultiplication outputFormat, const IntRect& srcRect) const { - return ImageBufferBackend::getImageData(outputFormat, srcRect, m_data.m_bitmap->Bits()); + return ImageBufferBackend::getImageData(outputFormat, srcRect, m_data.m_image->platformImage()->Bits()); } -void ImageBufferHaikuSurfaceBackend::putImageData(AlphaPremultiplication sourceFormat, const ImageData& imageData, const IntRect& sourceRect, const IntPoint& destPoint, AlphaPremultiplication) +void ImageBufferHaikuSurfaceBackend::putImageData(AlphaPremultiplication sourceFormat, const ImageData& imageData, const IntRect& sourceRect, const IntPoint& destPoint, AlphaPremultiplication premultiplication) { - ImageBufferBackend::putImageData(sourceFormat, imageData, sourceRect, destPoint, backendAlphaPremultiplication(), m_data.m_bitmap->Bits()); + ImageBufferBackend::putImageData(sourceFormat, imageData, sourceRect, destPoint, premultiplication, m_data.m_image->platformImage()->Bits()); } // TODO: PreserveResolution @@ -266,7 +253,7 @@ Vector ImageBufferHaikuSurfaceBackend::toData(const String& mimeType, O BMallocIO translatedStream; // BBitmapStream doesn't take "const Bitmap*"... - BBitmapStream bitmapStream(m_data.m_bitmap.get()); + BBitmapStream bitmapStream(m_data.m_image->platformImage().get()); BBitmap* tmp = NULL; if (roster->Translate(&bitmapStream, 0, 0, &translatedStream, translatorType, B_TRANSLATOR_BITMAP, mimeType.utf8().data()) != B_OK) { diff --git a/Source/WebCore/platform/graphics/haiku/ImageBufferHaikuSurfaceBackend.h b/Source/WebCore/platform/graphics/haiku/ImageBufferHaikuSurfaceBackend.h index 285ee1fd27552..ea61b3965588b 100644 --- a/Source/WebCore/platform/graphics/haiku/ImageBufferHaikuSurfaceBackend.h +++ b/Source/WebCore/platform/graphics/haiku/ImageBufferHaikuSurfaceBackend.h @@ -42,12 +42,12 @@ class ImageBufferHaikuSurfaceBackend : public ImageBufferBackend { WTF_MAKE_ISO_ALLOCATED(ImageBufferHaikuSurfaceBackend); WTF_MAKE_NONCOPYABLE(ImageBufferHaikuSurfaceBackend); public: - static std::unique_ptr create(const FloatSize&, float resolutionScale, ColorSpace, const HostWindow*); + static std::unique_ptr create(const FloatSize&, float resolutionScale, ColorSpace, PixelFormat, const HostWindow*); static std::unique_ptr create(const FloatSize&, const GraphicsContext&); ~ImageBufferHaikuSurfaceBackend(); GraphicsContext& context() const override; - NativeImagePtr copyNativeImage(BackingStoreCopy) const override; + WTF::RefPtr copyNativeImage(BackingStoreCopy) const override; RefPtr copyImage(BackingStoreCopy, PreserveResolution) const override; void draw(GraphicsContext&, const FloatRect&, const FloatRect&, const ImagePaintingOptions&) override; void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions&) override; @@ -61,9 +61,6 @@ class ImageBufferHaikuSurfaceBackend : public ImageBufferBackend { private: ImageBufferHaikuSurfaceBackend(const FloatSize& logicalSize, const IntSize& backendSize, float resolutionScale, ColorSpace, const HostWindow*); - ColorFormat backendColorFormat() const override; - AlphaPremultiplication backendAlphaPremultiplication() const override; - ImageBufferData m_data; }; diff --git a/Source/WebCore/platform/graphics/haiku/ImageHaiku.cpp b/Source/WebCore/platform/graphics/haiku/ImageHaiku.cpp index cd65326f2a7ec..7cf5a78329980 100644 --- a/Source/WebCore/platform/graphics/haiku/ImageHaiku.cpp +++ b/Source/WebCore/platform/graphics/haiku/ImageHaiku.cpp @@ -57,35 +57,5 @@ FloatSize nativeImageDrawingScale(GraphicsContext& context, const FloatRect& des return { static_cast(transformedDestinationRect.width() / srcRect.width()), static_cast(transformedDestinationRect.height() / srcRect.height()) }; } - -void drawNativeImage(WTF::RefPtr const& image, - WebCore::GraphicsContext& ctxt, WebCore::FloatRect const& dst, - WebCore::FloatRect const& src, WebCore::IntSize const& size, - WebCore::ImagePaintingOptions const& options) -{ - ctxt.drawNativeImage(image, size, dst, src, options); -} - - -NativeImagePtr BitmapImage::getBBitmap() -{ - return frameImageAtIndex(0); -} - -NativeImagePtr BitmapImage::getFirstBBitmapOfSize(const IntSize& size) -{ - size_t count = frameCount(); - for (size_t i = 0; i < count; ++i) { - NativeImagePtr bitmap = frameImageAtIndex(i); - if (bitmap && bitmap->Bounds().IntegerWidth() + 1 == size.width() - && bitmap->Bounds().IntegerHeight() + 1 == size.height()) { - return bitmap; - } - } - - // Fallback to the default getBBitmap if we can't find the right size - return getBBitmap(); -} - } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/haiku/MediaPlayerPrivateHaiku.cpp b/Source/WebCore/platform/graphics/haiku/MediaPlayerPrivateHaiku.cpp index 8d3fcbeaf1d6a..004f9d866986e 100644 --- a/Source/WebCore/platform/graphics/haiku/MediaPlayerPrivateHaiku.cpp +++ b/Source/WebCore/platform/graphics/haiku/MediaPlayerPrivateHaiku.cpp @@ -333,9 +333,6 @@ void MediaPlayerPrivate::paint(GraphicsContext& context, const FloatRect& r) if (context.paintingDisabled()) return; - if (!m_player->visible()) - return; - if (m_frameBuffer) { BView* target = context.platformContext(); target->SetDrawingMode(B_OP_COPY); diff --git a/Source/WebCore/platform/graphics/haiku/StillImageHaiku.h b/Source/WebCore/platform/graphics/haiku/NativeImageHaiku.cpp similarity index 51% rename from Source/WebCore/platform/graphics/haiku/StillImageHaiku.h rename to Source/WebCore/platform/graphics/haiku/NativeImageHaiku.cpp index 1f804074d3053..844b21ed8c0e4 100644 --- a/Source/WebCore/platform/graphics/haiku/StillImageHaiku.h +++ b/Source/WebCore/platform/graphics/haiku/NativeImageHaiku.cpp @@ -1,7 +1,5 @@ /* - * Copyright (C) 2010 Stephan Aßmus - * - * All rights reserved. + * Copyright (C) 2016-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 @@ -12,10 +10,10 @@ * 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 COMPUTER, INC. ``AS IS'' AND ANY + * 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 COMPUTER, INC. OR + * 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 @@ -25,40 +23,33 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef StillImageHaiku_h -#define StillImageHaiku_h +#include "config.h" +#include "NativeImage.h" -#include "Image.h" #include namespace WebCore { -class StillImage : public Image { -public: - static RefPtr create(NativeImagePtr bitmap) - { - return adoptRef(new StillImage(bitmap)); - } - - static RefPtr createForRendering(NativeImagePtr bitmap) - { - return adoptRef(new StillImage(bitmap)); - } +IntSize NativeImage::size() const +{ + return IntSize(m_platformImage.get()->Bounds().Size()); +} - virtual bool currentFrameKnownToBeOpaque() const override; - virtual void destroyDecodedData(bool = true) override; +bool NativeImage::hasAlpha() const +{ + return m_platformImage.get()->ColorSpace() == B_RGBA32; +} - virtual FloatSize size(ImageOrientation) const override; - virtual NativeImagePtr nativeImageForCurrentFrame(const GraphicsContext*) override; - virtual ImageDrawResult draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const ImagePaintingOptions&) override; +Color NativeImage::singlePixelSolidColor() const +{ + if (size() != IntSize(1, 1)) + return Color(); -private: - StillImage(NativeImagePtr bitmap); - ~StillImage(); + return (asSRGBA(PackedColor::ARGB { *(int32*)m_platformImage.get()->Bits()})); +} - NativeImagePtr m_bitmap; -}; +void NativeImage::clearSubimages() +{ +} } // namespace WebCore - -#endif // StillImageHaiku_h diff --git a/Source/WebCore/platform/graphics/haiku/StillImageHaiku.cpp b/Source/WebCore/platform/graphics/haiku/StillImageHaiku.cpp deleted file mode 100644 index afcfddc08d498..0000000000000 --- a/Source/WebCore/platform/graphics/haiku/StillImageHaiku.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2010 Stephan Aßmus - * - * 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 COMPUTER, 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 COMPUTER, 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. - */ - -#include "config.h" -#include "StillImageHaiku.h" - -#include "GraphicsContext.h" -#include "IntSize.h" -#include - -namespace WebCore { - -StillImage::StillImage(NativeImagePtr bitmap) - : m_bitmap(bitmap) -{} - -StillImage::~StillImage() -{ -} - - -bool StillImage::currentFrameKnownToBeOpaque() const -{ - color_space space = m_bitmap->ColorSpace(); - return space != B_RGB32 && space != B_RGBA15; -} - -void StillImage::destroyDecodedData(bool destroyAll) -{ - // This is used for "large" animations to free image data. - // It appears it would not apply to StillImage. -} - -FloatSize StillImage::size(ImageOrientation) const -{ - return FloatSize(m_bitmap->Bounds().Width() + 1., m_bitmap->Bounds().Height() + 1.); -} - -NativeImagePtr StillImage::nativeImageForCurrentFrame(const GraphicsContext*) -{ - return m_bitmap; -} - -ImageDrawResult StillImage::draw(GraphicsContext& context, const FloatRect& destRect, - const FloatRect& sourceRect, const WebCore::ImagePaintingOptions& options) -{ - if (!m_bitmap->IsValid()) - return ImageDrawResult::DidNothing; - - context.save(); - context.setCompositeOperation(options.compositeOperator()); - context.platformContext()->DrawBitmap(m_bitmap.get(), sourceRect, destRect); - context.restore(); - - return ImageDrawResult::DidDraw; -} - -} diff --git a/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp index 49809a456867a..b971a8fbe858b 100644 --- a/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp +++ b/Source/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp @@ -32,7 +32,7 @@ namespace WebCore { -NativeImagePtr ImageBackingStore::image() const +PlatformImagePtr ImageBackingStore::image() const { int bytesPerRow = size().width() * sizeof(rgb_color); RefPtr bitmap = adoptRef(new BitmapRef(BRect(0, 0, size().width() - 1, size().height() - 1), 0, B_RGBA32, bytesPerRow)); diff --git a/Source/WebKitLegacy/haiku/API/WebPage.cpp b/Source/WebKitLegacy/haiku/API/WebPage.cpp index cdb68026408d5..7f60d77793dcf 100644 --- a/Source/WebKitLegacy/haiku/API/WebPage.cpp +++ b/Source/WebKitLegacy/haiku/API/WebPage.cpp @@ -45,6 +45,7 @@ #include "DiagnosticLoggingClient.h" #include "DOMTimer.h" #include "DragClientHaiku.h" +#include "DummySpeechRecognitionProvider.h" #include "Editor.h" #include "EditorClientHaiku.h" #include "EmptyClients.h" @@ -74,7 +75,6 @@ #include "PlatformMouseEvent.h" #include "PlatformStrategiesHaiku.h" #include "PlatformWheelEvent.h" -#include "PlugInClient.h" #include "PluginInfoProvider.h" #include "PointerLockController.h" #include "ProgressTracker.h" @@ -262,39 +262,40 @@ BWebPage::BWebPage(BWebView* webView, BUrlContext* context) RefPtr viewGroup = WebViewGroup::getOrCreate("default", storagePath.Path()); - auto storageProvider = PageStorageSessionProvider::create(); + auto storageProvider = PageStorageSessionProvider::create(); PageConfiguration pageClients( - PAL::SessionID::defaultSessionID(), - makeUniqueRef(this), - SocketProvider::create(), + PAL::SessionID::defaultSessionID(), + makeUniqueRef(this), + SocketProvider::create(), makeUniqueRef(), - CacheStorageProvider::create(), - BackForwardList::create(), - CookieJar::create(storageProvider.copyRef()), - makeUniqueRef(this), - makeUniqueRef(this), - makeUniqueRef() - ); - - // alternativeText + CacheStorageProvider::create(), + BackForwardList::create(), + CookieJar::create(storageProvider.copyRef()), + makeUniqueRef(this), + makeUniqueRef(this), + makeUniqueRef(), + makeUniqueRef() + ); + + // alternativeText pageClients.chromeClient = new ChromeClientHaiku(this, webView); pageClients.contextMenuClient = new ContextMenuClientHaiku(this); pageClients.dragClient = std::make_unique(webView); pageClients.inspectorClient = new InspectorClientHaiku(); - pageClients.diagnosticLoggingClient = std::make_unique(); + pageClients.diagnosticLoggingClient = std::make_unique(); pageClients.applicationCacheStorage = &WebApplicationCache::storage(); pageClients.databaseProvider = &WebDatabaseProvider::singleton(); - // performanceLogging + // performanceLogging // pluginInClient pageClients.pluginInfoProvider = adoptRef(*new EmptyPluginInfoProvider); pageClients.storageNamespaceProvider = &viewGroup->storageNamespaceProvider(); pageClients.userContentProvider = &viewGroup->userContentController(); - // validationMessage * + // validationMessage * pageClients.visitedLinkStore = &viewGroup->visitedLinkStore(); - // webGLStateTracker * + // webGLStateTracker * fPage = new Page(WTFMove(pageClients)); - storageProvider->setPage(*fPage); + storageProvider->setPage(*fPage); #if ENABLE(GEOLOCATION) WebCore::provideGeolocationTo(fPage, new GeolocationClientMock()); @@ -1307,8 +1308,22 @@ void BWebPage::handleMouseWheelChanged(BMessage* message) if (!frame->view() || !frame->document()) return; - PlatformWheelEvent event(message); - frame->eventHandler().handleWheelEvent(event); + BPoint position = message->FindPoint("be:view_where"); + BPoint globalPosition = message->FindPoint("screen_where"); + float deltaX = -message->FindFloat("be:wheel_delta_x"); + float deltaY = -message->FindFloat("be:wheel_delta_y"); + float wheelTicksX = deltaX; + float wheelTicksY = deltaY; + + deltaX *= Scrollbar::pixelsPerLineStep(); + deltaY *= Scrollbar::pixelsPerLineStep(); + + int32 modifiers = message->FindInt32("modifiers"); + + PlatformWheelEvent event(IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, + wheelTicksX, wheelTicksY, ScrollByPixelWheelEvent, modifiers & B_SHIFT_KEY, + modifiers & B_COMMAND_KEY, modifiers & B_CONTROL_KEY, modifiers & B_OPTION_KEY); + frame->eventHandler().handleWheelEvent(event, { WheelEventProcessingSteps::MainThreadForScrolling, WheelEventProcessingSteps::MainThreadForDOMEventDispatch }); } void BWebPage::handleKeyEvent(BMessage* message) diff --git a/Source/WebKitLegacy/haiku/API/WebSettings.cpp b/Source/WebKitLegacy/haiku/API/WebSettings.cpp index 9f6a359d45105..5d6ef853fb11f 100644 --- a/Source/WebKitLegacy/haiku/API/WebSettings.cpp +++ b/Source/WebKitLegacy/haiku/API/WebSettings.cpp @@ -420,7 +420,7 @@ void BWebSettings::_HandleSendIconForURL(BMessage* message) reply.RemoveName("icon"); reply.AddString("url", url); - std::pair icon + std::pair icon = WebKit::iconDatabase().synchronousIconForPageURL(url, WebCore::IntSize(16, 16)); BMessage iconArchive; if (icon.second == WebKit::IconDatabase::IsKnownIcon::Yes diff --git a/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp index 879a750494b20..6f5b0c593ed02 100644 --- a/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp +++ b/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp @@ -963,13 +963,6 @@ void FrameLoaderClientHaiku::redirectDataToPlugin(Widget& pluginWidge) debugger("plugins are not implemented on Haiku!"); } -RefPtr FrameLoaderClientHaiku::createJavaAppletWidget(const IntSize&, HTMLAppletElement&, const URL& /*baseURL*/, - const Vector& /*paramNames*/, const Vector& /*paramValues*/) -{ - notImplemented(); - return 0; -} - String FrameLoaderClientHaiku::overrideMediaType() const { // This will do, until we support printing. diff --git a/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.h index 57d933a4b0fdd..77f7fd8b8c309 100644 --- a/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.h +++ b/Source/WebKitLegacy/haiku/WebCoreSupport/FrameLoaderClientHaiku.h @@ -204,9 +204,6 @@ class FrameLoaderClientHaiku : public FrameLoaderClient { const Vector&, const String&, bool) override; void redirectDataToPlugin(Widget& pluginWidget) override; - RefPtr createJavaAppletWidget(const IntSize&, HTMLAppletElement&, const URL& baseURL, - const Vector& paramNames, const Vector& paramValues) override; - ObjectContentType objectContentType(const URL&, const String& mimeType) override; String overrideMediaType() const override; diff --git a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp index bee918363d010..b613dbfb19e45 100644 --- a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp +++ b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp @@ -107,7 +107,7 @@ IconDatabase::IconRecord::~IconRecord() LOG(IconDatabase, "Destroying IconRecord for icon url %s", m_iconURL.ascii().data()); } -NativeImagePtr IconDatabase::IconRecord::image(const IntSize&) +PlatformImagePtr IconDatabase::IconRecord::image(const IntSize&) { // FIXME rdar://4680377 - For size right now, we are returning our one and only image and the Bridge // is resizing it in place. We need to actually store all the original representations here and return a native @@ -133,7 +133,7 @@ void IconDatabase::IconRecord::setImageData(RefPtr&& data) return; } - m_image = image->nativeImageForCurrentFrame(); + m_image = image->nativeImageForCurrentFrame()->platformImage(); if (!m_image) { LOG(IconDatabase, "Manual image data for iconURL '%s' FAILED - it was probably invalid image data", m_iconURL.ascii().data()); m_imageData = nullptr; @@ -301,7 +301,7 @@ static bool documentCanHaveIcon(const String& documentURL) return !documentURL.isEmpty() && !protocolIs(documentURL, "about"); } -std::pair IconDatabase::synchronousIconForPageURL(const String& pageURLOriginal, const IntSize& size) +std::pair IconDatabase::synchronousIconForPageURL(const String& pageURLOriginal, const IntSize& size) { ASSERT_NOT_SYNC_THREAD(); diff --git a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.h b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.h index fd668a2dcbe08..11ae51f578d18 100644 --- a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.h +++ b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.h @@ -92,7 +92,7 @@ class IconDatabase { void setTimestamp(time_t stamp) { m_stamp = stamp; } void setImageData(RefPtr&&); - WebCore::NativeImagePtr image(const WebCore::IntSize&); + WebCore::PlatformImagePtr image(const WebCore::IntSize&); String iconURL() { return m_iconURL; } @@ -109,7 +109,7 @@ class IconDatabase { String m_iconURL; time_t m_stamp { 0 }; RefPtr m_imageData; - WebCore::NativeImagePtr m_image; + WebCore::PlatformImagePtr m_image; HashSet m_retainingPageURLs; @@ -253,7 +253,7 @@ class IconDatabase { void setIconURLForPageURL(const String& iconURL, const String& pageURL); enum class IsKnownIcon { No, Yes }; - std::pair synchronousIconForPageURL(const String&, const WebCore::IntSize&); + std::pair synchronousIconForPageURL(const String&, const WebCore::IntSize&); String synchronousIconURLForPageURL(const String&); bool synchronousIconDataKnownForIconURL(const String&); IconLoadDecision synchronousLoadDecisionForIconURL(const String&); diff --git a/Source/cmake/WebKitCommon.cmake b/Source/cmake/WebKitCommon.cmake index 7ec75afb54a71..363c7cce0be73 100644 --- a/Source/cmake/WebKitCommon.cmake +++ b/Source/cmake/WebKitCommon.cmake @@ -35,6 +35,7 @@ if (NOT HAS_RUN_WEBKIT_COMMON) Efl FTW GTK + Haiku JSCOnly Mac PlayStation diff --git a/Tools/DumpRenderTree/PlatformHaiku.cmake b/Tools/DumpRenderTree/PlatformHaiku.cmake index f9b989714ca62..a6021226dbd2b 100644 --- a/Tools/DumpRenderTree/PlatformHaiku.cmake +++ b/Tools/DumpRenderTree/PlatformHaiku.cmake @@ -13,6 +13,7 @@ list(APPEND DumpRenderTree_SOURCES list(APPEND DumpRenderTree_LIBRARIES WebKitLegacy WebCore + stdc++fs ) list(APPEND DumpRenderTree_INCLUDE_DIRECTORIES diff --git a/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp b/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp index 6a33b30232587..50bf5eddd0e67 100644 --- a/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp @@ -39,6 +39,7 @@ #include "Frame.h" #include #include "PixelDumpSupport.h" +#include "TestCommand.h" #include "TestRunner.h" #include "WebCoreTestSupport.h" #include "WebFrame.h" @@ -262,7 +263,6 @@ static void createTestRunner(const String& testURL, const String& expectedPixelH if (shouldLogFrameLoadDelegates(testURL)) gTestRunner->setDumpFrameLoadCallbacks(true); - gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(testURL)) gTestRunner->showWebInspector(); @@ -374,7 +374,7 @@ static void resetDefaultsToConsistentValues() static void runTest(const string& inputLine) { - TestCommand command = parseInputLine(inputLine); + auto command = WTR::parseInputLine(inputLine); const String testPathOrURL(command.pathOrURL.c_str()); ASSERT(!testPathOrURL.isEmpty()); dumpPixelsForCurrentTest = command.shouldDumpPixels || dumpPixelsForAllTests; @@ -713,7 +713,6 @@ void DumpRenderTreeApp::MessageReceived(BMessage* message) // sure the test is done running. gTestRunner->closeWebInspector(); - gTestRunner->setDeveloperExtrasEnabled(false); //browser->clearExtraViews(); diff --git a/Tools/DumpRenderTree/haiku/TestRunnerHaiku.cpp b/Tools/DumpRenderTree/haiku/TestRunnerHaiku.cpp index 1de3f4cbda427..12be4584d4ca3 100644 --- a/Tools/DumpRenderTree/haiku/TestRunnerHaiku.cpp +++ b/Tools/DumpRenderTree/haiku/TestRunnerHaiku.cpp @@ -274,41 +274,6 @@ void TestRunner::setPrivateBrowsingEnabled(bool flag) notImplemented(); } -void TestRunner::setJavaScriptCanAccessClipboard(bool flag) -{ - notImplemented(); -} - -void TestRunner::setXSSAuditorEnabled(bool flag) -{ - notImplemented(); -} - -void TestRunner::setSpatialNavigationEnabled(bool flag) -{ - notImplemented(); -} - -void TestRunner::setAllowUniversalAccessFromFileURLs(bool flag) -{ - notImplemented(); -} - -void TestRunner::setAllowFileAccessFromFileURLs(bool flag) -{ - notImplemented(); -} - -void TestRunner::setNeedsStorageAccessFromFileURLsQuirk(bool needsQuirk) -{ - notImplemented(); -} - -void TestRunner::setAuthorAndUserStylesEnabled(bool flag) -{ - notImplemented(); -} - void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, double) { // FIXME: Implement for DeviceOrientation layout tests. @@ -350,16 +315,6 @@ void TestRunner::setIconDatabaseEnabled(bool enabled) notImplemented(); } -void TestRunner::setPopupBlockingEnabled(bool flag) -{ - notImplemented(); -} - -void TestRunner::setPluginsEnabled(bool flag) -{ - notImplemented(); -} - void TestRunner::execCommand(JSStringRef name, JSStringRef value) { WebCore::DumpRenderTreeClient::executeCoreCommandByName(webView, name->string(), value->string()); @@ -506,11 +461,6 @@ void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) notImplemented(); } -void TestRunner::setDeveloperExtrasEnabled(bool enabled) -{ - webView->WebPage()->SetDeveloperExtrasEnabled(enabled); -} - void TestRunner::showWebInspector() { notImplemented();