1 /* vim:set ts=2 sw=2 sts=2 et: */ 2 /* Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 #ifndef GFX_TEST_LAYERS_H 7 #define GFX_TEST_LAYERS_H 8 9 #include "Layers.h" 10 #include "nsTArray.h" 11 #include "mozilla/layers/ISurfaceAllocator.h" 12 13 namespace mozilla { 14 namespace layers { 15 16 class TestSurfaceAllocator final : public ISurfaceAllocator { 17 public: 18 TestSurfaceAllocator() = default; 19 virtual ~TestSurfaceAllocator() = default; 20 IsSameProcess()21 bool IsSameProcess() const override { return true; } 22 }; 23 24 } // namespace layers 25 } // namespace mozilla 26 27 /* Create layer tree from a simple layer tree description syntax. 28 * Each index is either the first letter of the layer type or 29 * a '(',')' to indicate the start/end of the child layers. 30 * The aim of this function is to remove hard to read 31 * layer tree creation code. 32 * 33 * Example "c(c(c(tt)t))" would yield: 34 * c 35 * | 36 * c 37 * / \ 38 * c t 39 * / \ 40 * t t 41 */ 42 already_AddRefed<mozilla::layers::Layer> CreateLayerTree( 43 const char* aLayerTreeDescription, nsIntRegion* aVisibleRegions, 44 const mozilla::gfx::Matrix4x4* aTransforms, 45 RefPtr<mozilla::layers::LayerManager>& aLayerManager, 46 nsTArray<RefPtr<mozilla::layers::Layer> >& aLayersOut); 47 48 #endif 49