gecko-dev/gfx/tests/gtest/TestLayers.h
Jean-Yves Avenard 11ac9e9cf8 Bug 1540581 - P6. Tidy some C++ declarations in gfx/. r=gerald,jrmuizel
* Remove redundant virtual keywords
* Mark all destructors of inheriting classes as virtual for clarity
* Mark all classes without virtual destructor as final (exposed errors)
* Make destructor virtual where it needed to be (some were missing)
* Replace empty ({}) code declaration in header with = default
* Remove virtual unused methods

I probably missed some, it quickly became a rabbit hole.

Differential Revision: https://phabricator.services.mozilla.com/D26060

--HG--
extra : moz-landing-system : lando
2019-04-11 12:36:51 +00:00

49 lines
1.3 KiB
C++

/* 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"
#include "mozilla/layers/ISurfaceAllocator.h"
namespace mozilla {
namespace layers {
class TestSurfaceAllocator final : public ISurfaceAllocator {
public:
TestSurfaceAllocator() = default;
virtual ~TestSurfaceAllocator() = default;
bool IsSameProcess() const override { return true; }
};
} // namespace layers
} // namespace mozilla
/* 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
*/
already_AddRefed<mozilla::layers::Layer> CreateLayerTree(
const char* aLayerTreeDescription, nsIntRegion* aVisibleRegions,
const mozilla::gfx::Matrix4x4* aTransforms,
RefPtr<mozilla::layers::LayerManager>& aLayerManager,
nsTArray<RefPtr<mozilla::layers::Layer> >& aLayersOut);
#endif