2014-07-22 16:02:25 -07: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_X11BASICCOMPOSITOR_H
|
|
|
|
#define MOZILLA_GFX_X11BASICCOMPOSITOR_H
|
|
|
|
|
|
|
|
#include "mozilla/layers/BasicCompositor.h"
|
|
|
|
#include "mozilla/layers/X11TextureSourceBasic.h"
|
|
|
|
#include "mozilla/layers/TextureHostBasic.h"
|
|
|
|
#include "gfxXlibSurface.h"
|
|
|
|
#include "mozilla/gfx/2D.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
// TextureSource for Image-backed surfaces.
|
|
|
|
class X11DataTextureSourceBasic : public DataTextureSource
|
|
|
|
, public TextureSourceBasic
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
X11DataTextureSourceBasic() {};
|
|
|
|
|
|
|
|
virtual bool Update(gfx::DataSourceSurface* aSurface,
|
|
|
|
nsIntRegion* aDestRegion = nullptr,
|
2015-03-21 09:28:04 -07:00
|
|
|
gfx::IntPoint* aSrcOffset = nullptr) override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual TextureSourceBasic* AsSourceBasic() override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void DeallocateDeviceData() override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::IntSize GetSize() const override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override;
|
2014-07-22 16:02:25 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
// We are going to buffer layer content on this xlib draw target
|
2015-10-17 22:24:48 -07:00
|
|
|
RefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget;
|
2014-07-22 16:02:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class X11BasicCompositor : public BasicCompositor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-09-02 06:47:43 -07:00
|
|
|
explicit X11BasicCompositor(nsIWidget *aWidget) : BasicCompositor(aWidget) {}
|
2014-07-22 16:02:25 -07:00
|
|
|
|
2015-06-17 07:00:52 -07:00
|
|
|
virtual already_AddRefed<DataTextureSource>
|
2015-03-21 09:28:04 -07:00
|
|
|
CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override;
|
2015-03-09 02:39:02 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void EndFrame() override;
|
2014-07-22 16:02:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_X11BASICCOMPOSITOR_H */
|