/src/mozilla-central/gfx/layers/basic/X11BasicCompositor.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef MOZILLA_GFX_X11BASICCOMPOSITOR_H |
8 | | #define MOZILLA_GFX_X11BASICCOMPOSITOR_H |
9 | | |
10 | | #include "mozilla/layers/BasicCompositor.h" |
11 | | #include "mozilla/layers/X11TextureSourceBasic.h" |
12 | | #include "mozilla/layers/TextureHostBasic.h" |
13 | | #include "gfxXlibSurface.h" |
14 | | #include "mozilla/gfx/2D.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace layers { |
18 | | |
19 | | // TextureSource for Image-backed surfaces. |
20 | | class X11DataTextureSourceBasic : public DataTextureSource |
21 | | , public TextureSourceBasic |
22 | | { |
23 | | public: |
24 | 0 | X11DataTextureSourceBasic() {}; |
25 | | |
26 | 0 | virtual const char* Name() const override { return "X11DataTextureSourceBasic"; } |
27 | | |
28 | | virtual bool Update(gfx::DataSourceSurface* aSurface, |
29 | | nsIntRegion* aDestRegion = nullptr, |
30 | | gfx::IntPoint* aSrcOffset = nullptr) override; |
31 | | |
32 | | virtual TextureSourceBasic* AsSourceBasic() override; |
33 | | |
34 | | virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override; |
35 | | |
36 | | virtual void DeallocateDeviceData() override; |
37 | | |
38 | | virtual gfx::IntSize GetSize() const override; |
39 | | |
40 | | virtual gfx::SurfaceFormat GetFormat() const override; |
41 | | |
42 | | private: |
43 | | // We are going to buffer layer content on this xlib draw target |
44 | | RefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget; |
45 | | }; |
46 | | |
47 | | class X11BasicCompositor : public BasicCompositor |
48 | | { |
49 | | public: |
50 | | explicit X11BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget) |
51 | | : BasicCompositor(aParent, aWidget) |
52 | 0 | {} |
53 | | |
54 | | virtual already_AddRefed<DataTextureSource> |
55 | | CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; |
56 | | |
57 | | virtual already_AddRefed<DataTextureSource> |
58 | 0 | CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) override { return nullptr; } |
59 | | |
60 | | virtual void EndFrame() override; |
61 | | }; |
62 | | |
63 | | } // namespace layers |
64 | | } // namespace mozilla |
65 | | |
66 | | #endif /* MOZILLA_GFX_X11BASICCOMPOSITOR_H */ |