gfx/layers/basic/X11TextureSourceBasic.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/layers/basic/X11TextureSourceBasic.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     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_X11TEXTURESOURCEBASIC__H
    1.10 +#define MOZILLA_GFX_X11TEXTURESOURCEBASIC__H
    1.11 +
    1.12 +#include "mozilla/layers/TextureHostBasic.h"
    1.13 +#include "mozilla/gfx/2D.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +namespace layers {
    1.17 +
    1.18 +class BasicCompositor;
    1.19 +
    1.20 +// TextureSource for Xlib-backed surfaces.
    1.21 +class X11TextureSourceBasic
    1.22 +  : public TextureSourceBasic
    1.23 +  , public NewTextureSource
    1.24 +{
    1.25 +public:
    1.26 +  X11TextureSourceBasic(BasicCompositor* aCompositor, gfxXlibSurface* aSurface);
    1.27 +
    1.28 +  virtual X11TextureSourceBasic* AsSourceBasic() MOZ_OVERRIDE { return this; }
    1.29 +
    1.30 +  virtual gfx::IntSize GetSize() const MOZ_OVERRIDE;
    1.31 +
    1.32 +  virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE;
    1.33 +
    1.34 +  virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) MOZ_OVERRIDE;
    1.35 +
    1.36 +  virtual void DeallocateDeviceData() MOZ_OVERRIDE { }
    1.37 +
    1.38 +  virtual void SetCompositor(Compositor* aCompositor);
    1.39 +
    1.40 +  static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType);
    1.41 +
    1.42 +protected:
    1.43 +  BasicCompositor* mCompositor;
    1.44 +  RefPtr<gfxXlibSurface> mSurface;
    1.45 +  RefPtr<gfx::SourceSurface> mSourceSurface;
    1.46 +};
    1.47 +
    1.48 +} // namespace layers
    1.49 +} // namespace mozilla
    1.50 +
    1.51 +#endif // MOZILLA_GFX_X11TEXTURESOURCEBASIC__H

mercurial