Bumping manifests a=b2g-bump
[gecko.git] / gfx / layers / LayerTreeInvalidation.h
blobab71b65e554c5cb0e5d5715396f406eb9f1a98b7
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" // for nsIntRegion
10 #include "mozilla/UniquePtr.h" // for UniquePtr
12 class nsPresContext;
13 struct nsIntPoint;
15 namespace mozilla {
16 namespace layers {
18 class Layer;
19 class ContainerLayer;
21 /**
22 * Callback for ContainerLayer invalidations.
24 * @param aContainer ContainerLayer being invalidated.
25 * @param aRegion Invalidated region in the ContainerLayer's coordinate
26 * space.
28 typedef void (*NotifySubDocInvalidationFunc)(ContainerLayer* aLayer,
29 const nsIntRegion& aRegion);
31 /**
32 * A set of cached layer properties (including those of child layers),
33 * used for comparing differences in layer trees.
35 struct LayerProperties
37 virtual ~LayerProperties() {}
39 /**
40 * Copies the current layer tree properties into
41 * a new LayerProperties object.
43 * @param Layer tree to copy, or nullptr if we have no
44 * initial layer tree.
46 static UniquePtr<LayerProperties> CloneFrom(Layer* aRoot);
48 /**
49 * Clear all invalidation status from this layer tree.
51 static void ClearInvalidations(Layer* aRoot);
53 /**
54 * Compares a set of existing layer tree properties to the current layer
55 * tree and generates the changed rectangle.
57 * @param aRoot Root layer of the layer tree to compare against.
58 * @param aCallback If specified, callback to call when ContainerLayers
59 * are invalidated.
60 * @return Painted area changed by the layer tree changes.
62 virtual nsIntRegion ComputeDifferences(Layer* aRoot,
63 NotifySubDocInvalidationFunc aCallback,
64 bool* aGeometryChanged = nullptr) = 0;
67 virtual void MoveBy(const nsIntPoint& aOffset) = 0;
70 } // namespace layers
71 } // namespace mozilla
73 #endif /* GFX_LAYER_TREE_INVALIDATON_H */