Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: ui/gfx/render_text.cc

Issue 10332205: Fix logging of string16s from gfx namespace on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/range/range.cc ('k') | ui/gfx/selection_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "ui/gfx/render_text.h" 5 #include "ui/gfx/render_text.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/i18n/break_iterator.h" 10 #include "base/i18n/break_iterator.h"
(...skipping 29 matching lines...) Expand all
40 #ifndef NDEBUG 40 #ifndef NDEBUG
41 // Check StyleRanges invariant conditions: sorted and non-overlapping ranges. 41 // Check StyleRanges invariant conditions: sorted and non-overlapping ranges.
42 void CheckStyleRanges(const gfx::StyleRanges& style_ranges, size_t length) { 42 void CheckStyleRanges(const gfx::StyleRanges& style_ranges, size_t length) {
43 if (length == 0) { 43 if (length == 0) {
44 DCHECK(style_ranges.empty()) << "Style ranges exist for empty text."; 44 DCHECK(style_ranges.empty()) << "Style ranges exist for empty text.";
45 return; 45 return;
46 } 46 }
47 for (gfx::StyleRanges::size_type i = 0; i < style_ranges.size() - 1; i++) { 47 for (gfx::StyleRanges::size_type i = 0; i < style_ranges.size() - 1; i++) {
48 const ui::Range& former = style_ranges[i].range; 48 const ui::Range& former = style_ranges[i].range;
49 const ui::Range& latter = style_ranges[i + 1].range; 49 const ui::Range& latter = style_ranges[i + 1].range;
50 DCHECK(!former.is_empty()) << "Empty range at " << i << ":" << former; 50 DCHECK(!former.is_empty()) << "Empty range at " << i << ":" <<
51 DCHECK(former.IsValid()) << "Invalid range at " << i << ":" << former; 51 former.ToString();
52 DCHECK(!former.is_reversed()) << "Reversed range at " << i << ":" << former; 52 DCHECK(former.IsValid()) << "Invalid range at " << i << ":" <<
53 former.ToString();
54 DCHECK(!former.is_reversed()) << "Reversed range at " << i << ":" <<
55 former.ToString();
53 DCHECK(former.end() == latter.start()) << "Ranges gap/overlap/unsorted." << 56 DCHECK(former.end() == latter.start()) << "Ranges gap/overlap/unsorted." <<
54 "former:" << former << ", latter:" << latter; 57 "former:" << former.ToString() << ", latter:" << latter.ToString();
55 } 58 }
56 const gfx::StyleRange& end_style = *style_ranges.rbegin(); 59 const gfx::StyleRange& end_style = *style_ranges.rbegin();
57 DCHECK(!end_style.range.is_empty()) << "Empty range at end."; 60 DCHECK(!end_style.range.is_empty()) << "Empty range at end.";
58 DCHECK(end_style.range.IsValid()) << "Invalid range at end."; 61 DCHECK(end_style.range.IsValid()) << "Invalid range at end.";
59 DCHECK(!end_style.range.is_reversed()) << "Reversed range at end."; 62 DCHECK(!end_style.range.is_reversed()) << "Reversed range at end.";
60 DCHECK(end_style.range.end() == length) << "Style and text length mismatch."; 63 DCHECK(end_style.range.end() == length) << "Style and text length mismatch.";
61 } 64 }
62 #endif 65 #endif
63 66
64 void ApplyStyleRangeImpl(gfx::StyleRanges* style_ranges, 67 void ApplyStyleRangeImpl(gfx::StyleRanges* style_ranges,
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 if (cursor_enabled() && cursor_visible() && focused()) { 990 if (cursor_enabled() && cursor_visible() && focused()) {
988 const Rect& bounds = GetUpdatedCursorBounds(); 991 const Rect& bounds = GetUpdatedCursorBounds();
989 if (bounds.width() != 0) 992 if (bounds.width() != 0)
990 canvas->FillRect(bounds, cursor_color_); 993 canvas->FillRect(bounds, cursor_color_);
991 else 994 else
992 canvas->DrawRect(bounds, cursor_color_); 995 canvas->DrawRect(bounds, cursor_color_);
993 } 996 }
994 } 997 }
995 998
996 } // namespace gfx 999 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/base/range/range.cc ('k') | ui/gfx/selection_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698