Loading gfx/webrender_bindings/RenderCompositorSWGL.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ bool RenderCompositorSWGL::AllocateMappedBuffer() { if (!mDT) { return false; } mWidget->ClearBeforePaint(mDT, mRegion); // Attempt to lock the underlying buffer directly from the draw target. // Verify that the size at least matches what the widget claims and that // the format is BGRA8 as SWGL requires. Loading widget/CompositorWidget.h +7 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,13 @@ class CompositorWidget { */ virtual bool NeedsToDeferEndRemoteDrawing() { return false; } /** * Some widgets (namely Gtk) may need clean up underlying surface * before painting to draw transparent objects correctly. */ virtual void ClearBeforePaint(RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) {} /** * Called when shutting down the LayerManager to clean-up any cached * resources. Loading widget/gtk/GtkCompositorWidget.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ namespace mozilla { namespace widget { using namespace gfx; GtkCompositorWidget::GtkCompositorWidget( const GtkCompositorWidgetInitData& aInitData, const layers::CompositorOptions& aOptions, nsWindow* aWindow) Loading Loading @@ -125,5 +127,20 @@ void GtkCompositorWidget::SetEGLNativeWindowSize( } #endif void GtkCompositorWidget::ClearBeforePaint( RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) { // We need to clear target buffer alpha values of popup windows as // SW-WR paints with alpha blending (see Bug 1674473). if (mWidget->IsPopup()) { for (auto iter = aRegion.RectIter(); !iter.Done(); iter.Next()) { LayoutDeviceIntRect r = iter.Get(); aTarget->FillRect(gfx::Rect(r.x, r.y, r.width, r.height), ColorPattern(DeviceColor(0, 0, 0, 0)), DrawOptions(1.0f, CompositionOp::OP_SOURCE)); } aTarget->Flush(); } } } // namespace widget } // namespace mozilla widget/gtk/GtkCompositorWidget.h +3 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ class GtkCompositorWidget : public CompositorWidget, EGLNativeWindowType GetEGLNativeWindow(); int32_t GetDepth(); void ClearBeforePaint(RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) override; #if defined(MOZ_X11) Display* XDisplay() const { return mXDisplay; } Window XWindow() const { return mXWindow; } Loading widget/gtk/nsWindow.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -1248,10 +1248,12 @@ void nsWindow::Move(double aX, double aY) { } } bool nsWindow::IsWaylandPopup() { return !mIsX11Display && mIsTopLevel && mWindowType == eWindowType_popup; bool nsWindow::IsPopup() { return mIsTopLevel && mWindowType == eWindowType_popup; } bool nsWindow::IsWaylandPopup() { return !mIsX11Display && IsPopup(); } void nsWindow::HideWaylandTooltips() { while (gVisibleWaylandPopupWindows) { nsWindow* window = Loading Loading
gfx/webrender_bindings/RenderCompositorSWGL.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ bool RenderCompositorSWGL::AllocateMappedBuffer() { if (!mDT) { return false; } mWidget->ClearBeforePaint(mDT, mRegion); // Attempt to lock the underlying buffer directly from the draw target. // Verify that the size at least matches what the widget claims and that // the format is BGRA8 as SWGL requires. Loading
widget/CompositorWidget.h +7 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,13 @@ class CompositorWidget { */ virtual bool NeedsToDeferEndRemoteDrawing() { return false; } /** * Some widgets (namely Gtk) may need clean up underlying surface * before painting to draw transparent objects correctly. */ virtual void ClearBeforePaint(RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) {} /** * Called when shutting down the LayerManager to clean-up any cached * resources. Loading
widget/gtk/GtkCompositorWidget.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,8 @@ namespace mozilla { namespace widget { using namespace gfx; GtkCompositorWidget::GtkCompositorWidget( const GtkCompositorWidgetInitData& aInitData, const layers::CompositorOptions& aOptions, nsWindow* aWindow) Loading Loading @@ -125,5 +127,20 @@ void GtkCompositorWidget::SetEGLNativeWindowSize( } #endif void GtkCompositorWidget::ClearBeforePaint( RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) { // We need to clear target buffer alpha values of popup windows as // SW-WR paints with alpha blending (see Bug 1674473). if (mWidget->IsPopup()) { for (auto iter = aRegion.RectIter(); !iter.Done(); iter.Next()) { LayoutDeviceIntRect r = iter.Get(); aTarget->FillRect(gfx::Rect(r.x, r.y, r.width, r.height), ColorPattern(DeviceColor(0, 0, 0, 0)), DrawOptions(1.0f, CompositionOp::OP_SOURCE)); } aTarget->Flush(); } } } // namespace widget } // namespace mozilla
widget/gtk/GtkCompositorWidget.h +3 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,9 @@ class GtkCompositorWidget : public CompositorWidget, EGLNativeWindowType GetEGLNativeWindow(); int32_t GetDepth(); void ClearBeforePaint(RefPtr<gfx::DrawTarget> aTarget, const LayoutDeviceIntRegion& aRegion) override; #if defined(MOZ_X11) Display* XDisplay() const { return mXDisplay; } Window XWindow() const { return mXWindow; } Loading
widget/gtk/nsWindow.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -1248,10 +1248,12 @@ void nsWindow::Move(double aX, double aY) { } } bool nsWindow::IsWaylandPopup() { return !mIsX11Display && mIsTopLevel && mWindowType == eWindowType_popup; bool nsWindow::IsPopup() { return mIsTopLevel && mWindowType == eWindowType_popup; } bool nsWindow::IsWaylandPopup() { return !mIsX11Display && IsPopup(); } void nsWindow::HideWaylandTooltips() { while (gVisibleWaylandPopupWindows) { nsWindow* window = Loading