Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release
[gecko.git] / gfx / layers / wr / WebRenderCanvasRenderer.h
blob42e77b509c916ad2925f1f633595b01c1112a7a5
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"
13 namespace mozilla {
14 namespace layers {
16 class WebRenderCanvasRenderer : public ShareableCanvasRenderer {
17 public:
18 explicit WebRenderCanvasRenderer(RenderRootStateManager* aManager)
19 : mManager(aManager) {}
21 CompositableForwarder* GetForwarder() override;
22 RenderRootStateManager* GetRenderRootStateManager() { return mManager; }
24 protected:
25 RefPtr<RenderRootStateManager> mManager;
28 class WebRenderCanvasRendererAsync final : public WebRenderCanvasRenderer {
29 public:
30 explicit WebRenderCanvasRendererAsync(RenderRootStateManager* aManager)
31 : WebRenderCanvasRenderer(aManager) {}
32 virtual ~WebRenderCanvasRendererAsync();
34 WebRenderCanvasRendererAsync* AsWebRenderCanvasRendererAsync() override {
35 return this;
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; }
49 protected:
50 Maybe<wr::PipelineId> mPipelineId;
51 bool mIsAsync = false;
54 } // namespace layers
55 } // namespace mozilla
57 #endif