2014-02-17 16:30:05 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef MOZILLA_GFX_X11TEXTUREHOST__H
|
|
|
|
#define MOZILLA_GFX_X11TEXTUREHOST__H
|
|
|
|
|
|
|
|
#include "mozilla/layers/TextureHost.h"
|
|
|
|
#include "mozilla/layers/LayersSurfaces.h"
|
2014-04-11 07:15:01 -07:00
|
|
|
#include "mozilla/gfx/Types.h"
|
2014-02-17 16:30:05 -08:00
|
|
|
|
2014-07-22 08:29:33 -07:00
|
|
|
#include "gfxXlibSurface.h"
|
2014-02-17 16:30:05 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2014-04-11 07:15:01 -07:00
|
|
|
// TextureHost for Xlib-backed TextureSources.
|
2014-02-17 16:30:05 -08:00
|
|
|
class X11TextureHost : public TextureHost
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
X11TextureHost(TextureFlags aFlags,
|
|
|
|
const SurfaceDescriptorX11& aDescriptor);
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void SetCompositor(Compositor* aCompositor) override;
|
2014-04-11 07:15:01 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool Lock() override;
|
2014-04-11 07:15:01 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override;
|
2014-04-11 07:15:01 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::IntSize GetSize() const override;
|
2014-02-17 16:30:05 -08:00
|
|
|
|
2015-03-27 03:16:34 -07:00
|
|
|
virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override
|
2014-02-17 16:30:05 -08:00
|
|
|
{
|
2015-03-27 03:16:34 -07:00
|
|
|
aTexture = mTextureSource;
|
|
|
|
return !!aTexture;
|
2014-02-17 16:30:05 -08:00
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual TemporaryRef<gfx::DataSourceSurface> GetAsSurface() override
|
2014-02-17 16:30:05 -08:00
|
|
|
{
|
|
|
|
return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING)
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef MOZ_LAYERS_HAVE_LOG
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual const char* Name() override { return "X11TextureHost"; }
|
2014-02-17 16:30:05 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
2014-10-16 06:48:29 -07:00
|
|
|
RefPtr<Compositor> mCompositor;
|
2014-10-07 06:58:59 -07:00
|
|
|
RefPtr<TextureSource> mTextureSource;
|
2014-02-17 16:30:05 -08:00
|
|
|
RefPtr<gfxXlibSurface> mSurface;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // MOZILLA_GFX_X11TEXTUREHOST__H
|