widget/InProcessCompositorWidget.h
author Martin Stransky <stransky@redhat.com>
Thu, 01 Feb 2018 13:56:15 +0100
changeset 750088 c8b0466bc1d0f3c2ed42a71ce127c36c9185477f
parent 484159 13cfe25ef134da155ae827b5cc4a5c3a77219f85
child 489668 cbb8fdf1daf98a15f7d57f6b08d273bdf96aa1a0
child 694109 98e2b4ee9775a2a2b5cc1bb8a390bfe901814f38
child 716776 69cdd9c3ddd1a8c8499b9484e31ae787b857fbae
permissions -rw-r--r--
Bug 1434565 - Put some meanigful timestamp to nsRemoteService::HandleCommandLine(), r?jhorak We need to put a timestamp to nsRemoteService::HandleCommandLine() to allow Gtk+ focus opened Firefox window. Unfortunately we don't have much choice how to get the timestamp at DBUS remote service so ask for gtk_get_current_event_time() and when GDK_CURRENT_TIME is returned (it means we don't have the timestamp) use g_get_monotonic_time() as well as at nsWindow::GetEventTimeStamp(). MozReview-Commit-ID: 9ilVZ0kPe3x

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_widget_InProcessCompositorWidget_h__
#define mozilla_widget_InProcessCompositorWidget_h__

#include "CompositorWidget.h"

namespace mozilla {
namespace widget {

// This version of CompositorWidget implements a wrapper around
// nsBaseWidget.
class InProcessCompositorWidget : public CompositorWidget
{
public:
  explicit InProcessCompositorWidget(const layers::CompositorOptions& aOptions,
                                     nsBaseWidget* aWidget);

  virtual bool PreRender(WidgetRenderingContext* aManager) override;
  virtual void PostRender(WidgetRenderingContext* aManager) override;
  virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
                                  LayoutDeviceIntRect aRect) override;
  virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
                                 LayoutDeviceIntRect aRect) override;
  virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
  virtual already_AddRefed<gfx::DrawTarget>
  StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
                             layers::BufferMode* aBufferMode) override;
  virtual void EndRemoteDrawing() override;
  virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
                                        LayoutDeviceIntRegion& aInvalidRegion) override;
  virtual void CleanupRemoteDrawing() override;
  virtual void CleanupWindowEffects() override;
  virtual bool InitCompositor(layers::Compositor* aCompositor) override;
  virtual LayoutDeviceIntSize GetClientSize() override;
  virtual uint32_t GetGLFrameBufferFormat() override;
  virtual void ObserveVsync(VsyncObserver* aObserver) override;
  virtual uintptr_t GetWidgetKey() override;

  // If you can override this method, inherit from CompositorWidget instead.
  nsIWidget* RealWidget() override;

protected:
  nsBaseWidget* mWidget;
};

} // namespace widget
} // namespace mozilla

#endif