| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_BREAK_LIST_H_ | 5 #ifndef UI_GFX_BREAK_LIST_H_ |
| 6 #define UI_GFX_BREAK_LIST_H_ | 6 #define UI_GFX_BREAK_LIST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include <utility> | 10 #include <utility> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "ui/gfx/range/range.h" | 14 #include "ui/gfx/range/range.h" |
| 14 | 15 |
| 15 namespace gfx { | 16 namespace gfx { |
| 16 | 17 |
| 17 // BreakLists manage ordered, non-overlapping, and non-repeating ranged values. | 18 // BreakLists manage ordered, non-overlapping, and non-repeating ranged values. |
| 18 // These may be used to apply ranged colors and styles to text, for an example. | 19 // These may be used to apply ranged colors and styles to text, for an example. |
| 19 // | 20 // |
| 20 // Each break stores the start position and value of its associated range. | 21 // Each break stores the start position and value of its associated range. |
| 21 // A solitary break at position 0 applies to the entire space [0, max_). | 22 // A solitary break at position 0 applies to the entire space [0, max_). |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 DCHECK_NE(breaks_[i].second, breaks_[i + 1].second) << "Redundant break."; | 167 DCHECK_NE(breaks_[i].second, breaks_[i + 1].second) << "Redundant break."; |
| 167 } | 168 } |
| 168 if (max_ > 0) | 169 if (max_ > 0) |
| 169 DCHECK_LT(breaks_.back().first, max_) << "Break beyond max position."; | 170 DCHECK_LT(breaks_.back().first, max_) << "Break beyond max position."; |
| 170 } | 171 } |
| 171 #endif | 172 #endif |
| 172 | 173 |
| 173 } // namespace gfx | 174 } // namespace gfx |
| 174 | 175 |
| 175 #endif // UI_GFX_BREAK_LIST_H_ | 176 #endif // UI_GFX_BREAK_LIST_H_ |
| OLD | NEW |