2013-07-02 20:27:17 +04:00
|
|
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GFX_TEST_LAYERS_H
|
|
|
|
#define GFX_TEST_LAYERS_H
|
|
|
|
|
|
|
|
#include "Layers.h"
|
|
|
|
#include "nsTArray.h"
|
2018-02-07 17:33:12 +03:00
|
|
|
#include "mozilla/layers/ISurfaceAllocator.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
class TestSurfaceAllocator final : public ISurfaceAllocator {
|
|
|
|
public:
|
2019-04-11 15:36:51 +03:00
|
|
|
TestSurfaceAllocator() = default;
|
|
|
|
virtual ~TestSurfaceAllocator() = default;
|
2018-02-07 17:33:12 +03:00
|
|
|
|
|
|
|
bool IsSameProcess() const override { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
2013-07-02 20:27:17 +04:00
|
|
|
|
2013-08-13 00:40:28 +04:00
|
|
|
/* Create layer tree from a simple layer tree description syntax.
|
|
|
|
* Each index is either the first letter of the layer type or
|
|
|
|
* a '(',')' to indicate the start/end of the child layers.
|
|
|
|
* The aim of this function is to remove hard to read
|
|
|
|
* layer tree creation code.
|
|
|
|
*
|
|
|
|
* Example "c(c(c(tt)t))" would yield:
|
|
|
|
* c
|
|
|
|
* |
|
|
|
|
* c
|
|
|
|
* / \
|
|
|
|
* c t
|
|
|
|
* / \
|
|
|
|
* t t
|
|
|
|
*/
|
2013-07-02 20:27:17 +04:00
|
|
|
already_AddRefed<mozilla::layers::Layer> CreateLayerTree(
|
|
|
|
const char* aLayerTreeDescription, nsIntRegion* aVisibleRegions,
|
2014-08-01 16:31:48 +04:00
|
|
|
const mozilla::gfx::Matrix4x4* aTransforms,
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::layers::LayerManager>& aLayerManager,
|
|
|
|
nsTArray<RefPtr<mozilla::layers::Layer> >& aLayersOut);
|
2013-07-02 20:27:17 +04:00
|
|
|
|
|
|
|
#endif
|