|
1 /* -*- Mode: C++; tab-width: 20; 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 MOZILLA_GFX_X11TEXTUREHOST__H |
|
7 #define MOZILLA_GFX_X11TEXTUREHOST__H |
|
8 |
|
9 #include "mozilla/layers/TextureHost.h" |
|
10 #include "mozilla/layers/LayersSurfaces.h" |
|
11 #include "mozilla/gfx/Types.h" |
|
12 |
|
13 class gfxXlibSurface; |
|
14 |
|
15 namespace mozilla { |
|
16 namespace layers { |
|
17 |
|
18 // TextureHost for Xlib-backed TextureSources. |
|
19 class X11TextureHost : public TextureHost |
|
20 { |
|
21 public: |
|
22 X11TextureHost(TextureFlags aFlags, |
|
23 const SurfaceDescriptorX11& aDescriptor); |
|
24 |
|
25 virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE; |
|
26 |
|
27 virtual bool Lock() MOZ_OVERRIDE; |
|
28 |
|
29 virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE; |
|
30 |
|
31 virtual gfx::IntSize GetSize() const MOZ_OVERRIDE; |
|
32 |
|
33 virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE |
|
34 { |
|
35 return mTextureSource; |
|
36 } |
|
37 |
|
38 virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE |
|
39 { |
|
40 return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) |
|
41 } |
|
42 |
|
43 #ifdef MOZ_LAYERS_HAVE_LOG |
|
44 virtual const char* Name() { return "X11TextureHost"; } |
|
45 #endif |
|
46 |
|
47 protected: |
|
48 Compositor* mCompositor; |
|
49 RefPtr<NewTextureSource> mTextureSource; |
|
50 RefPtr<gfxXlibSurface> mSurface; |
|
51 }; |
|
52 |
|
53 } // namespace layers |
|
54 } // namespace mozilla |
|
55 |
|
56 #endif // MOZILLA_GFX_X11TEXTUREHOST__H |