gfx/layers/composite/X11TextureHost.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/composite/X11TextureHost.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef MOZILLA_GFX_X11TEXTUREHOST__H
    1.10 +#define MOZILLA_GFX_X11TEXTUREHOST__H
    1.11 +
    1.12 +#include "mozilla/layers/TextureHost.h"
    1.13 +#include "mozilla/layers/LayersSurfaces.h"
    1.14 +#include "mozilla/gfx/Types.h"
    1.15 +
    1.16 +class gfxXlibSurface;
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace layers {
    1.20 +
    1.21 +// TextureHost for Xlib-backed TextureSources.
    1.22 +class X11TextureHost : public TextureHost
    1.23 +{
    1.24 +public:
    1.25 +  X11TextureHost(TextureFlags aFlags,
    1.26 +                 const SurfaceDescriptorX11& aDescriptor);
    1.27 +
    1.28 +  virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
    1.29 +
    1.30 +  virtual bool Lock() MOZ_OVERRIDE;
    1.31 +
    1.32 +  virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
    1.33 +
    1.34 +  virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
    1.35 +
    1.36 +  virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE
    1.37 +  {
    1.38 +    return mTextureSource;
    1.39 +  }
    1.40 +
    1.41 +  virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() MOZ_OVERRIDE
    1.42 +  {
    1.43 +    return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
    1.44 +  }
    1.45 +
    1.46 +#ifdef MOZ_LAYERS_HAVE_LOG
    1.47 +  virtual const char* Name() { return "X11TextureHost"; }
    1.48 +#endif
    1.49 +
    1.50 +protected:
    1.51 +  Compositor* mCompositor;
    1.52 +  RefPtr<NewTextureSource> mTextureSource;
    1.53 +  RefPtr<gfxXlibSurface> mSurface;
    1.54 +};
    1.55 +
    1.56 +} // namespace layers
    1.57 +} // namespace mozilla
    1.58 +
    1.59 +#endif // MOZILLA_GFX_X11TEXTUREHOST__H

mercurial