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"
25 class CompositorWidget
;
30 class RenderCompositor
{
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(); }
61 RefPtr
<widget::CompositorWidget
> mWidget
;
62 RefPtr
<layers::SyncObjectHost
> mSyncObject
;
66 } // namespace mozilla