Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/. */
6 #ifndef MOZILLA_GFX_TEXTURECLIENT_X11_H
7 #define MOZILLA_GFX_TEXTURECLIENT_X11_H
9 #include "mozilla/layers/TextureClient.h"
10 #include "ISurfaceAllocator.h" // For IsSurfaceDescriptorValid
11 #include "mozilla/layers/ShadowLayerUtilsX11.h"
13 namespace mozilla {
14 namespace layers {
16 /**
17 * A TextureClient implementation based on Xlib.
18 */
19 class TextureClientX11 : public TextureClient
20 {
21 public:
22 TextureClientX11(gfx::SurfaceFormat format, TextureFlags aFlags = TEXTURE_FLAGS_DEFAULT);
24 ~TextureClientX11();
26 // TextureClient
28 virtual bool IsAllocated() const MOZ_OVERRIDE;
30 virtual bool ToSurfaceDescriptor(SurfaceDescriptor& aOutDescriptor) MOZ_OVERRIDE;
32 virtual TextureClientData* DropTextureData() MOZ_OVERRIDE;
34 virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; }
36 virtual bool Lock(OpenMode aMode) MOZ_OVERRIDE;
38 virtual void Unlock() MOZ_OVERRIDE;
40 virtual bool IsLocked() const MOZ_OVERRIDE { return mLocked; }
42 virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags flags) MOZ_OVERRIDE;
44 virtual bool CanExposeDrawTarget() const MOZ_OVERRIDE { return true; }
46 virtual TemporaryRef<gfx::DrawTarget> GetAsDrawTarget() MOZ_OVERRIDE;
48 virtual gfx::SurfaceFormat GetFormat() const { return mFormat; }
50 virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }
52 private:
53 gfx::SurfaceFormat mFormat;
54 gfx::IntSize mSize;
55 RefPtr<gfxXlibSurface> mSurface;
56 bool mLocked;
57 };
59 } // namespace layers
60 } // namespace mozilla
62 #endif