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_SHAREABLECANVASRENDERER_H
8 #define GFX_SHAREABLECANVASRENDERER_H
10 #include "CompositorTypes.h"
11 #include "CanvasRenderer.h"
12 #include "mozilla/layers/CanvasClient.h"
25 class ShareableCanvasRenderer
: public CanvasRenderer
{
26 friend class CanvasClient2D
;
27 friend class CanvasClientSharedSurface
;
30 RefPtr
<CanvasClient
> mCanvasClient
;
33 layers::SurfaceDescriptor mFrontBufferDesc
;
34 RefPtr
<TextureClient
> mFrontBufferFromDesc
;
37 ShareableCanvasRenderer();
38 virtual ~ShareableCanvasRenderer();
41 void Initialize(const CanvasRendererData
&) override
;
43 virtual CompositableForwarder
* GetForwarder() = 0;
45 virtual bool CreateCompositable() = 0;
47 void ClearCachedResources() override
;
48 void DisconnectClient() override
;
50 void UpdateCompositableClient();
52 CanvasClient
* GetCanvasClient() { return mCanvasClient
; }
55 RefPtr
<TextureClient
> GetFrontBufferFromDesc(const layers::SurfaceDescriptor
&,
60 } // namespace mozilla