99
1010namespace impeller {
1111
12- // / @brief Produces an optimized draw order for a draw list given in painter's
13- // / order .
12+ // / Helper that records draw indices in painter's order and sorts the draws into
13+ // / an optimized order based on translucency and clips .
1414class DrawOrderResolver {
1515 public:
1616 using ElementRefs = std::vector<size_t >;
@@ -24,21 +24,24 @@ class DrawOrderResolver {
2424 void PopClip ();
2525
2626 // -------------------------------------------------------------------------
27- // / @brief Returns the sorted draws for the current draw order layer.
28- // / This should only be called after all recording has finished.
27+ // / @brief Returns the sorted draws for the current draw order layer.
28+ // / This should only be called after all recording has finished.
2929 // /
30- // / @param[in] opaque_skip_count The number of opaque elements to skip
31- // / when appending the combined elements.
32- // / This is used for the "clear color"
33- // / optimization.
30+ // / @param[in] opaque_skip_count The number of opaque elements to skip
31+ // / when appending the combined elements.
32+ // / This is used for the "clear color"
33+ // / optimization.
34+ // / @param[in] translucent_skip_count The number of translucent elements to
35+ // / skip when appending the combined
36+ // / elements. This is used for the
37+ // / "clear color" optimization.
3438 // /
3539 ElementRefs GetSortedDraws (size_t opaque_skip_count,
3640 size_t translucent_skip_count) const ;
3741
3842 private:
3943 // / A data structure for collecting sorted draws for a given "draw order
40- // / layer". Currently these layers just correspond to the local clip stack
41- // / corresponds to the clip stack.
44+ // / layer". Currently these layers just correspond to the local clip stack.
4245 struct DrawOrderLayer {
4346 // / The list of backdrop-independent elements (always just opaque). These
4447 // / are order independent, and so we draw them optimally render these
@@ -55,12 +58,16 @@ class DrawOrderResolver {
5558 // / @brief Appends the combined opaque and transparent elements into
5659 // / a final destination buffer.
5760 // /
58- // / @param[in] destination The buffer to append the combined
59- // / elements to.
60- // / @param[in] opaque_skip_count The number of opaque elements to skip
61- // / when appending the combined elements.
62- // / This is used for the "clear color"
63- // / optimization.
61+ // / @param[in] destination The buffer to append the combined
62+ // / elements to.
63+ // / @param[in] opaque_skip_count The number of opaque elements to
64+ // / skip when appending the combined
65+ // / elements. This is used for the
66+ // / "clear color" optimization.
67+ // / @param[in] translucent_skip_count The number of translucent elements
68+ // / to skip when appending the combined
69+ // / elements. This is used for the
70+ // / "clear color" optimization.
6471 // /
6572 void WriteCombinedDraws (ElementRefs& destination,
6673 size_t opaque_skip_count,
0 commit comments