gfx/layers/basic/TextureClientX11.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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

mercurial