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() {};
|
|
|
|
|
|
|
|
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 07:40:10 +03:00
|
|
|
nsRefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget;
|
2014-07-23 03:02:25 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class X11BasicCompositor : public BasicCompositor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-09-02 17:47:43 +04:00
|
|
|
explicit X11BasicCompositor(nsIWidget *aWidget) : BasicCompositor(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
|
|
|
|
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 */
|