michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MOZILLA_GFX_X11TEXTUREHOST__H michael@0: #define MOZILLA_GFX_X11TEXTUREHOST__H michael@0: michael@0: #include "mozilla/layers/TextureHost.h" michael@0: #include "mozilla/layers/LayersSurfaces.h" michael@0: #include "mozilla/gfx/Types.h" michael@0: michael@0: class gfxXlibSurface; michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: // TextureHost for Xlib-backed TextureSources. michael@0: class X11TextureHost : public TextureHost michael@0: { michael@0: public: michael@0: X11TextureHost(TextureFlags aFlags, michael@0: const SurfaceDescriptorX11& aDescriptor); michael@0: michael@0: virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE; michael@0: michael@0: virtual bool Lock() MOZ_OVERRIDE; michael@0: michael@0: virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE; michael@0: michael@0: virtual gfx::IntSize GetSize() const MOZ_OVERRIDE; michael@0: michael@0: virtual NewTextureSource* GetTextureSources() MOZ_OVERRIDE michael@0: { michael@0: return mTextureSource; michael@0: } michael@0: michael@0: virtual TemporaryRef GetAsSurface() MOZ_OVERRIDE michael@0: { michael@0: return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) michael@0: } michael@0: michael@0: #ifdef MOZ_LAYERS_HAVE_LOG michael@0: virtual const char* Name() { return "X11TextureHost"; } michael@0: #endif michael@0: michael@0: protected: michael@0: Compositor* mCompositor; michael@0: RefPtr mTextureSource; michael@0: RefPtr mSurface; michael@0: }; michael@0: michael@0: } // namespace layers michael@0: } // namespace mozilla michael@0: michael@0: #endif // MOZILLA_GFX_X11TEXTUREHOST__H