widget/InProcessCompositorWidget.h
author Gerald Squelart <gsquelart@mozilla.com>
Sun, 18 Sep 2016 19:50:01 -0700
changeset 315335 da7b4f4ff12fd650b55e990936b5e1da49016b15
parent 305741 522249786c4c5cd027df51e2369f74366ea3374f
child 321514 dd859148673c2ac94c827e2da05e7f89120c633d
permissions -rw-r--r--
Bug 1247056 - DecDoc::StoreEvent for singular playback issues/solutions - r=jwwang MozReview-Commit-ID: GYoitdB8Sj0

/* 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(nsBaseWidget* aWidget);

  virtual bool PreRender(layers::LayerManagerComposite* aManager) override;
  virtual void PostRender(layers::LayerManagerComposite* aManager) override;
  virtual void DrawWindowUnderlay(layers::LayerManagerComposite* aManager,
                                  LayoutDeviceIntRect aRect) override;
  virtual void DrawWindowOverlay(layers::LayerManagerComposite* aManager,
                                 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 layers::Composer2D* GetComposer2D() 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;

private:
  nsBaseWidget* mWidget;
};

} // namespace widget
} // namespace mozilla

#endif