RenderCompositorOGL.h (1495B)
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/. */ 6 7 #ifndef MOZILLA_GFX_RENDERCOMPOSITOR_OGL_H 8 #define MOZILLA_GFX_RENDERCOMPOSITOR_OGL_H 9 10 #include "GLTypes.h" 11 #include "mozilla/webrender/RenderCompositor.h" 12 13 namespace mozilla { 14 namespace wr { 15 16 class RenderCompositorOGL : public RenderCompositor { 17 public: 18 static UniquePtr<RenderCompositor> Create( 19 const RefPtr<widget::CompositorWidget>& aWidget, nsACString& aError); 20 21 RenderCompositorOGL(RefPtr<gl::GLContext>&& aGL, 22 const RefPtr<widget::CompositorWidget>& aWidget); 23 virtual ~RenderCompositorOGL(); 24 25 bool BeginFrame() override; 26 RenderedFrameId EndFrame(const nsTArray<DeviceIntRect>& aDirtyRects) final; 27 void Pause() override; 28 bool Resume() override; 29 30 gl::GLContext* gl() const override { return mGL; } 31 32 LayoutDeviceIntSize GetBufferSize() override; 33 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; 40 41 protected: 42 RefPtr<gl::GLContext> mGL; 43 bool mIsEGL; 44 }; 45 46 } // namespace wr 47 } // namespace mozilla 48 49 #endif