/src/mozilla-central/gfx/layers/basic/X11TextureSourceBasic.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_X11TEXTURESOURCEBASIC__H |
8 | | #define MOZILLA_GFX_X11TEXTURESOURCEBASIC__H |
9 | | |
10 | | #include "mozilla/layers/BasicCompositor.h" |
11 | | #include "mozilla/layers/TextureHostBasic.h" |
12 | | #include "mozilla/layers/X11TextureHost.h" |
13 | | #include "mozilla/gfx/2D.h" |
14 | | |
15 | | namespace mozilla { |
16 | | namespace layers { |
17 | | |
18 | | class BasicCompositor; |
19 | | |
20 | | // TextureSource for Xlib-backed surfaces. |
21 | | class X11TextureSourceBasic |
22 | | : public TextureSourceBasic |
23 | | , public X11TextureSource |
24 | | { |
25 | | public: |
26 | | X11TextureSourceBasic(BasicCompositor* aCompositor, gfxXlibSurface* aSurface); |
27 | | |
28 | 0 | virtual const char* Name() const override { return "X11TextureSourceBasic"; } |
29 | | |
30 | 0 | virtual X11TextureSourceBasic* AsSourceBasic() override { return this; } |
31 | | |
32 | | virtual gfx::IntSize GetSize() const override; |
33 | | |
34 | | virtual gfx::SurfaceFormat GetFormat() const override; |
35 | | |
36 | | virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override; |
37 | | |
38 | 0 | virtual void DeallocateDeviceData() override { } |
39 | | |
40 | 0 | virtual void Updated() override { } |
41 | | |
42 | | static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType); |
43 | | |
44 | | protected: |
45 | | RefPtr<gfxXlibSurface> mSurface; |
46 | | RefPtr<gfx::SourceSurface> mSourceSurface; |
47 | | }; |
48 | | |
49 | | } // namespace layers |
50 | | } // namespace mozilla |
51 | | |
52 | | #endif // MOZILLA_GFX_X11TEXTURESOURCEBASIC__H |