/src/mozilla-central/layout/painting/DisplayListChecker.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef DisplayListChecker_h__ |
8 | | #define DisplayListChecker_h__ |
9 | | |
10 | | #include <sstream> |
11 | | #include <mozilla/UniquePtr.h> |
12 | | |
13 | | class nsDisplayList; |
14 | | |
15 | | namespace mozilla { |
16 | | |
17 | | class DisplayListBlueprint; |
18 | | |
19 | | class DisplayListChecker |
20 | | { |
21 | | public: |
22 | | DisplayListChecker(); |
23 | | DisplayListChecker(nsDisplayList* aList, const char* aName); |
24 | | |
25 | | ~DisplayListChecker(); |
26 | | |
27 | | void Set(nsDisplayList* aList, const char* aName); |
28 | | |
29 | 0 | explicit operator bool() const { return mBlueprint.get(); } |
30 | | |
31 | | // Compare this list with another one, output differences between the two |
32 | | // into aDiff. |
33 | | // Differences include: Display items from one tree for which a corresponding |
34 | | // item (same frame and per-frame key) cannot be found under corresponding |
35 | | // parent items. |
36 | | // Returns true if trees are similar, false if different. |
37 | | bool CompareList(const DisplayListChecker& aOther, |
38 | | std::stringstream& aDiff) const; |
39 | | |
40 | | // Output this tree to aSs. |
41 | | void Dump(std::stringstream& aSs) const; |
42 | | |
43 | | private: |
44 | | UniquePtr<DisplayListBlueprint> mBlueprint; |
45 | | }; |
46 | | |
47 | | } // namespace mozilla |
48 | | |
49 | | #endif // DisplayListChecker_h__ |