2014-07-23 03:02:25 +04: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() {};
|
|
|
|
|
2016-02-08 13:57:00 +03:00
|
|
|
virtual const char* Name() const override { return "X11DataTextureSourceBasic"; }
|
|
|
|
|
2014-07-23 03:02:25 +04:00
|
|
|
virtual bool Update(gfx::DataSourceSurface* aSurface,
|
|
|
|
nsIntRegion* aDestRegion = nullptr,
|
2015-03-21 19:28:04 +03:00
|
|
|
gfx::IntPoint* aSrcOffset = nullptr) override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual TextureSourceBasic* AsSourceBasic() override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual gfx::SourceSurface* GetSurface(gfx::DrawTarget* aTarget) override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DeallocateDeviceData() override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual gfx::IntSize GetSize() const override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual gfx::SurfaceFormat GetFormat() const override;
|
2014-07-23 03:02:25 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// We are going to buffer layer content on this xlib draw target
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget;
|
2014-07-23 03:02:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class X11BasicCompositor : public BasicCompositor
|
|
|
|
{
|
|
|
|
public:
|
2016-07-01 11:15:16 +03:00
|
|
|
explicit X11BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget)
|
2016-03-25 11:38:55 +03:00
|
|
|
: BasicCompositor(aParent, aWidget)
|
|
|
|
{}
|
2014-07-23 03:02:25 +04:00
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<DataTextureSource>
|
2015-03-21 19:28:04 +03:00
|
|
|
CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override;
|
2015-03-09 12:39:02 +03:00
|
|
|
|
2016-02-25 16:15:52 +03:00
|
|
|
virtual already_AddRefed<DataTextureSource>
|
|
|
|
CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) override { return nullptr; }
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void EndFrame() override;
|
2014-07-23 03:02:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* MOZILLA_GFX_X11BASICCOMPOSITOR_H */
|