Bug 1557368 [wpt PR 16856] - Update error type test for attachInternals(), a=testonly
[gecko.git] / gfx / webrender_bindings / RenderCompositor.h
blob287670ff7b5e578953f69f65bb63273f7da5ef91
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_RENDERCOMPOSITOR_H
8 #define MOZILLA_GFX_RENDERCOMPOSITOR_H
10 #include "mozilla/RefPtr.h"
11 #include "mozilla/UniquePtr.h"
12 #include "Units.h"
14 namespace mozilla {
16 namespace gl {
17 class GLContext;
20 namespace layers {
21 class SyncObjectHost;
24 namespace widget {
25 class CompositorWidget;
28 namespace wr {
30 class RenderCompositor {
31 public:
32 static UniquePtr<RenderCompositor> Create(
33 RefPtr<widget::CompositorWidget>&& aWidget);
35 RenderCompositor(RefPtr<widget::CompositorWidget>&& aWidget);
36 virtual ~RenderCompositor();
38 virtual bool BeginFrame() = 0;
39 virtual void EndFrame() = 0;
40 virtual void WaitForGPU() = 0;
41 virtual void Pause() = 0;
42 virtual bool Resume() = 0;
44 virtual gl::GLContext* gl() const { return nullptr; }
46 virtual bool MakeCurrent();
48 virtual bool UseANGLE() const { return false; }
50 virtual bool UseDComp() const { return false; }
52 virtual bool UseTripleBuffering() const { return false; }
54 virtual LayoutDeviceIntSize GetBufferSize() = 0;
56 widget::CompositorWidget* GetWidget() const { return mWidget; }
58 layers::SyncObjectHost* GetSyncObject() const { return mSyncObject.get(); }
60 protected:
61 RefPtr<widget::CompositorWidget> mWidget;
62 RefPtr<layers::SyncObjectHost> mSyncObject;
65 } // namespace wr
66 } // namespace mozilla
68 #endif