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