widget/headless/HeadlessCompositorWidget.h
author Dorel Luca <dluca@mozilla.com>
Mon, 04 Dec 2017 18:01:09 +0200
changeset 394844 58fec9a96e269a57cc6f84bfe3a6dc6800acd955
parent 372798 db5a86cfd703c9bd245fd3bb26f2163c4b91b6ab
child 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Backed out 7 changesets (bug 1377007) for failing build bustage on Linux pgo and faling Cpp's jsapi-tests r=backout on a CLOSED TREE Backed out changeset 9428a4ed7dec (bug 1377007) Backed out changeset 4407b43a8aff (bug 1377007) Backed out changeset 65a37a7f78a5 (bug 1377007) Backed out changeset 276fe6d9b716 (bug 1377007) Backed out changeset 1de46e60ffba (bug 1377007) Backed out changeset 893e303e17ec (bug 1377007) Backed out changeset 081a241e25d4 (bug 1377007)

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 widget_headless_HeadlessCompositorWidget_h
#define widget_headless_HeadlessCompositorWidget_h

#include "mozilla/widget/CompositorWidget.h"

#include "HeadlessWidget.h"

namespace mozilla {
namespace widget {

class HeadlessCompositorWidgetInitData;

class HeadlessCompositorWidget final
  : public CompositorWidget
  , public CompositorWidgetDelegate
{
public:
  HeadlessCompositorWidget(const HeadlessCompositorWidgetInitData& aInitData,
                           const layers::CompositorOptions& aOptions,
                           HeadlessWidget* aWindow);

  void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize);

  // CompositorWidget Overrides

  uintptr_t GetWidgetKey() override;

  LayoutDeviceIntSize GetClientSize() override;

  nsIWidget* RealWidget() override;
  CompositorWidgetDelegate* AsDelegate() override { return this; }

  void ObserveVsync(VsyncObserver* aObserver) override;

  // CompositorWidgetDelegate Overrides

  HeadlessCompositorWidget* AsHeadlessCompositorWidget() override {
    return this;
  }

private:
  HeadlessWidget* mWidget;

  LayoutDeviceIntSize mClientSize;
};

} // namespace widget
} // namespace mozilla

#endif // widget_headless_HeadlessCompositor_h