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 GFX_WEBRENDERCANVASRENDERER_H
8 #define GFX_WEBRENDERCANVASRENDERER_H
10 #include "mozilla/layers/RenderRootStateManager.h"
11 #include "ShareableCanvasRenderer.h"
16 class WebRenderCanvasRenderer
: public ShareableCanvasRenderer
{
18 explicit WebRenderCanvasRenderer(RenderRootStateManager
* aManager
)
19 : mManager(aManager
) {}
21 CompositableForwarder
* GetForwarder() override
;
22 RenderRootStateManager
* GetRenderRootStateManager() { return mManager
; }
25 RefPtr
<RenderRootStateManager
> mManager
;
28 class WebRenderCanvasRendererAsync final
: public WebRenderCanvasRenderer
{
30 explicit WebRenderCanvasRendererAsync(RenderRootStateManager
* aManager
)
31 : WebRenderCanvasRenderer(aManager
) {}
32 virtual ~WebRenderCanvasRendererAsync();
34 WebRenderCanvasRendererAsync
* AsWebRenderCanvasRendererAsync() override
{
38 void Initialize(const CanvasRendererData
& aData
) override
;
39 bool CreateCompositable() override
;
40 void EnsurePipeline() override
;
41 bool HasPipeline() override
;
43 void ClearCachedResources() override
;
45 void UpdateCompositableClientForEmptyTransaction();
47 Maybe
<wr::PipelineId
> GetPipelineId() { return mPipelineId
; }
50 Maybe
<wr::PipelineId
> mPipelineId
;
51 bool mIsAsync
= false;
55 } // namespace mozilla