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
11 #include "mozilla/webrender/RenderCompositor.h"
16 class RenderCompositorOGL
: public RenderCompositor
{
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
;
42 RefPtr
<gl::GLContext
> mGL
;
47 } // namespace mozilla