Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef GFX_WEBRENDERCANVASLAYER_H
7 : #define GFX_WEBRENDERCANVASLAYER_H
8 :
9 : #include "mozilla/layers/WebRenderLayer.h"
10 : #include "mozilla/layers/WebRenderLayerManager.h"
11 : #include "ShareableCanvasLayer.h"
12 :
13 : namespace mozilla {
14 : namespace gfx {
15 : class SourceSurface;
16 : }; // namespace gfx
17 :
18 : namespace layers {
19 :
20 : class WebRenderCanvasLayer : public WebRenderLayer,
21 : public ShareableCanvasLayer
22 : {
23 : public:
24 0 : explicit WebRenderCanvasLayer(WebRenderLayerManager* aLayerManager)
25 0 : : ShareableCanvasLayer(aLayerManager, static_cast<WebRenderLayer*>(this))
26 : {
27 0 : MOZ_COUNT_CTOR(WebRenderCanvasLayer);
28 0 : }
29 :
30 : virtual void Initialize(const Data& aData) override;
31 :
32 : virtual CompositableForwarder* GetForwarder() override;
33 :
34 : virtual void AttachCompositable() override;
35 :
36 : protected:
37 : virtual ~WebRenderCanvasLayer();
38 :
39 : public:
40 0 : Layer* GetLayer() override { return this; }
41 : void RenderLayer(wr::DisplayListBuilder& aBuilder,
42 : const StackingContextHelper& aSc) override;
43 :
44 : protected:
45 : wr::MaybeExternalImageId mExternalImageId;
46 : };
47 :
48 : } // namespace layers
49 : } // namespace mozilla
50 :
51 : #endif // GFX_WEBRENDERCANVASLAYER_H
|