2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2017-08-03 08:55:14 +03:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef GFX_WEBRENDERCANVASRENDERER_H
|
|
|
|
#define GFX_WEBRENDERCANVASRENDERER_H
|
|
|
|
|
|
|
|
#include "ShareableCanvasRenderer.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2019-01-08 00:33:10 +03:00
|
|
|
class RenderRootStateManager;
|
2017-08-03 08:55:14 +03:00
|
|
|
|
|
|
|
class WebRenderCanvasRenderer : public ShareableCanvasRenderer {
|
|
|
|
public:
|
2019-01-08 00:33:10 +03:00
|
|
|
explicit WebRenderCanvasRenderer(RenderRootStateManager* aManager)
|
2017-08-03 08:55:14 +03:00
|
|
|
: mManager(aManager) {}
|
|
|
|
|
|
|
|
void Initialize(const CanvasInitializeData& aData) override;
|
|
|
|
|
|
|
|
CompositableForwarder* GetForwarder() override;
|
|
|
|
|
|
|
|
protected:
|
2019-01-08 00:33:10 +03:00
|
|
|
RenderRootStateManager* mManager;
|
2017-08-03 08:55:14 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class WebRenderCanvasRendererAsync : public WebRenderCanvasRenderer {
|
|
|
|
public:
|
2019-01-08 00:33:10 +03:00
|
|
|
explicit WebRenderCanvasRendererAsync(RenderRootStateManager* aManager)
|
2017-08-03 08:55:14 +03:00
|
|
|
: WebRenderCanvasRenderer(aManager) {}
|
|
|
|
virtual ~WebRenderCanvasRendererAsync();
|
|
|
|
|
|
|
|
WebRenderCanvasRendererAsync* AsWebRenderCanvasRendererAsync() override {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Initialize(const CanvasInitializeData& aData) override;
|
|
|
|
bool CreateCompositable() override;
|
|
|
|
|
|
|
|
void ClearCachedResources() override;
|
|
|
|
void Destroy() override;
|
|
|
|
|
2018-07-19 01:51:37 +03:00
|
|
|
void UpdateCompositableClientForEmptyTransaction();
|
|
|
|
|
2017-08-03 08:55:14 +03:00
|
|
|
Maybe<wr::PipelineId> GetPipelineId() { return mPipelineId; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-08-03 08:55:14 +03:00
|
|
|
protected:
|
|
|
|
Maybe<wr::PipelineId> mPipelineId;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|