/src/mozilla-central/gfx/tests/gtest/TestLayers.h
Line | Count | Source (jump to first uncovered line) |
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 | | { |
18 | | public: |
19 | 0 | TestSurfaceAllocator() {} |
20 | 0 | ~TestSurfaceAllocator() override {} |
21 | | |
22 | 0 | bool IsSameProcess() const override { return true; } |
23 | | }; |
24 | | |
25 | | } // layers |
26 | | } // mozilla |
27 | | |
28 | | /* Create layer tree from a simple layer tree description syntax. |
29 | | * Each index is either the first letter of the layer type or |
30 | | * a '(',')' to indicate the start/end of the child layers. |
31 | | * The aim of this function is to remove hard to read |
32 | | * layer tree creation code. |
33 | | * |
34 | | * Example "c(c(c(tt)t))" would yield: |
35 | | * c |
36 | | * | |
37 | | * c |
38 | | * / \ |
39 | | * c t |
40 | | * / \ |
41 | | * t t |
42 | | */ |
43 | | already_AddRefed<mozilla::layers::Layer> CreateLayerTree( |
44 | | const char* aLayerTreeDescription, |
45 | | nsIntRegion* aVisibleRegions, |
46 | | const mozilla::gfx::Matrix4x4* aTransforms, |
47 | | RefPtr<mozilla::layers::LayerManager>& aLayerManager, |
48 | | nsTArray<RefPtr<mozilla::layers::Layer> >& aLayersOut); |
49 | | |
50 | | |
51 | | #endif |
52 | | |