Bug 1833753 [wpt PR 40065] - Allow newly-added test to also pass when mutation events...
[gecko.git] / gfx / webrender_bindings / RenderCompositorOGL.h
blob78429a2db4f40a0d07520747fbbebb64f64fc96c
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_OGL_H
8 #define MOZILLA_GFX_RENDERCOMPOSITOR_OGL_H
10 #include "GLTypes.h"
11 #include "mozilla/webrender/RenderCompositor.h"
13 namespace mozilla {
14 namespace wr {
16 class RenderCompositorOGL : public RenderCompositor {
17 public:
18 static UniquePtr<RenderCompositor> Create(
19 const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError);
21 RenderCompositorOGL(RefPtr<gl::GLContext>&& aGL,
22 const RefPtr<widget::CompositorWidget>& aWidget);
23 virtual ~RenderCompositorOGL();
25 bool BeginFrame() override;
26 RenderedFrameId EndFrame(const nsTArray<DeviceIntRect>& aDirtyRects) final;
27 void Pause() override;
28 bool Resume() override;
30 gl::GLContext* gl() const override { return mGL; }
32 LayoutDeviceIntSize GetBufferSize() override;
34 // Interface for partial present
35 bool UsePartialPresent() override;
36 bool RequestFullRender() override;
37 uint32_t GetMaxPartialPresentRects() override;
38 bool ShouldDrawPreviousPartialPresentRegions() override;
39 size_t GetBufferAge() const override;
41 protected:
42 RefPtr<gl::GLContext> mGL;
43 bool mIsEGL;
46 } // namespace wr
47 } // namespace mozilla
49 #endif