Bug 853551 - Implement the doppler part of AudioPannerNode. r=ehsan
[gecko.git] / gfx / layers / LayerTreeInvalidation.h
blob6a309d49499ad3fb5ffe9ca7acc963de8eae85c8
1 /*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GFX_LAYER_TREE_INVALIDATION_H
7 #define GFX_LAYER_TREE_INVALIDATION_H
9 #include "nsRegion.h"
11 class nsPresContext;
13 namespace mozilla {
14 namespace layers {
16 class Layer;
17 class ContainerLayer;
19 /**
20 * Callback for ContainerLayer invalidations.
22 * @param aContainer ContainerLayer being invalidated.
23 * @param aRegion Invalidated region in the ContainerLayer's coordinate
24 * space.
26 typedef void (*NotifySubDocInvalidationFunc)(ContainerLayer* aLayer,
27 const nsIntRegion& aRegion);
29 /**
30 * A set of cached layer properties (including those of child layers),
31 * used for comparing differences in layer trees.
33 struct LayerProperties
35 virtual ~LayerProperties() {}
37 /**
38 * Copies the current layer tree properties into
39 * a new LayerProperties object.
41 * @param Layer tree to copy, or nullptr if we have no
42 * initial layer tree.
44 static LayerProperties* CloneFrom(Layer* aRoot);
46 /**
47 * Clear all invalidation status from this layer tree.
49 static void ClearInvalidations(Layer* aRoot);
51 /**
52 * Compares a set of existing layer tree properties to the current layer
53 * tree and generates the changed rectangle.
55 * @param aRoot Root layer of the layer tree to compare against.
56 * @param aCallback If specified, callback to call when ContainerLayers
57 * are invalidated.
58 * @return Painted area changed by the layer tree changes.
60 virtual nsIntRegion ComputeDifferences(Layer* aRoot,
61 NotifySubDocInvalidationFunc aCallback) = 0;
64 virtual void MoveBy(const nsIntPoint& aOffset) = 0;
67 } // namespace layers
68 } // namespace mozilla
70 #endif /* GFX_LAYER_TREE_INVALIDATON_H */