Граф коммитов

8 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert 126bd9e1a4 Bug 1412427 part 8: (automated patch) Switch a bunch of C++ files in gfx to use our standard mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: 77D61xpSmIl

--HG--
extra : rebase_source : c6162fa3cf539a07177a19838324bf368faa162b
2017-10-27 16:10:06 -07:00
Kevin Wern 16d7a2302e Bug 1227233: Increase scope of TreeTraversal.h to by-value traversal r=botond
MozReview-Commit-ID: LOw1k792T10

--HG--
extra : rebase_source : a81ac06686bc21ed69693a3a80551e0648a8299a
2016-09-22 12:31:26 -04:00
Kevin Wern 7ae5cf1e52 Bug 1227231: Use generic tree traversal algorithms for loops over Layer trees. r=botond
Create an Iterator type with classes ForwardIterator and ReverseIterator,
having GetFirstChild/GetNextSibling and GetLastChild/GetPrevSibling
methods, respectively. Specify the iterator type for each call to
ForEachNode. With this, we can support trees with forward and reverse
sibling structures.

Additionally, apply these algorithms to all Layer recursive traversals,
where applicable. Update tests to ensure both directions yield expected
results.

MozReview-Commit-ID: iYpX22XHTa

--HG--
extra : rebase_source : 016d3c37e0679df7037dacd3366d3fa7748d0703
extra : amend_source : 089c4a62bd4716be087669742bb542c39a9f97c6
2016-03-10 01:20:40 -08:00
Kevin Wern 9a846abe86 Bug 1227224 - Further improvements to generic tree traversal algorithms. r=botond
- Introduce a more general version of ForEachNode that takes two actions
  (pre-action and post-action).
- Express the one-action version of ForEachNode in terms of the two-action
  version.
- Add TraversalFlag::Abort, which stops traversal immediately.
- Express DepthFirstSearch in terms of ForEachNode.
- Add ForEachNodePostOrder and DepthFirstSearchPostOrder.
- The new functions are all recursive, and traverse children in the order
  provided by the node accessors. Adjust tests to reflect this.
- Refactor two APZCTreeManager functions, FindTargetNode and GetAPZCAtPoint,
  to use the algorithms.

MozReview-Commit-ID: 83Y7psjkUWG

--HG--
extra : commitid : JSMoSuDetUL
extra : rebase_source : 6ef99b1d6dac841eb94d99feb605ca235d9086c9
extra : amend_source : 518a636ee5a5162bca83dde6b90cb1a3b5304a3b
2016-01-25 04:04:13 -08:00
Kevin Wern 6b43e66943 Bug 1226920 - Allow calling ForEachNode() with an action returning void r=botond
--HG--
extra : rebase_source : e2d16580f20bd5dc154760803ec562fe0ed485c4
extra : source : 8e743b5913982ccd18d51544a5a93213fb700e5c
2015-11-23 13:06:01 -05:00
Kevin Wern 02d8d69dc7 Bug 1199798 - Create tests for TreeTraversal.h r=botond
Move queue and stack includes outside of mozilla namespace.

Test the following for searches:
- Null root returns null.
- Needle is root returns root.
- No needle results in full traversal.
- Needle node in middle returns that needle, and stops traversing.

Test the following for ForEachNode:
- Null root still runs correctly.
- No skips results in traversal of entire tree.
- Root skip results in only changing the root.
- First skips are still included (whether leaf or parent).

--HG--
extra : source : 6d2572c274363c7544c4f96f0016fead098b157e
2015-11-16 13:54:12 -05:00
Kevin Wern 6a1cf14315 Bug 1199798 - Use more generic tree traversal algorithms in APZCTreeManager. r=botond
Extend the tree traversal algorithms in TreeTraversal.h, and use them
instead of manual loops in APZCTreeManager.

- Create function ForEachNode(), which calls a function on each node
  of a tree. The function must return a TraversalFlag to indicate
  whether the node's children should be visited or skipped.
- Modify DepthFirstSearch() and BreadthFirstSearch() to operate on
  pointers that are not (necessarily) const. This makes them more
  general.
- Refactor functions in APZCTreeManager: Collect, FlushRepaints,
  FlushRepaintsRecursively, FlushPendingRepaint,
  FlushPendingRepaintRecursively, UpdateZoomConstraints,
  UpdateZoomConstraintsRecursively, ClearTree, FindScrollNode.

--HG--
extra : rebase_source : e7a740a9833ba49b1d41849bb43ce9077d42bc07
extra : source : ef6f195f2259e103f0c1979a5f4ebb5a8601b15d
2015-11-06 12:31:36 -05:00
Tim Stullich 78588ac104 Bug 1171312 - Add generic tree search algorithms for layers-related data structures. r=botond
--HG--
extra : source : a377fceec2fbab853eb2e847d98789250501aa96
extra : amend_source : 2e18afc459d4a2116a008e2482084d84c7c63e9c
2015-07-21 16:36:08 -07:00