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 #include "ui/gfx/render_text.h" | 5 #include "ui/gfx/render_text.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <climits> | 10 #include <climits> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 void SkiaTextRenderer::SetDrawLooper(sk_sp<SkDrawLooper> draw_looper) { | 234 void SkiaTextRenderer::SetDrawLooper(sk_sp<SkDrawLooper> draw_looper) { |
235 paint_.setLooper(std::move(draw_looper)); | 235 paint_.setLooper(std::move(draw_looper)); |
236 } | 236 } |
237 | 237 |
238 void SkiaTextRenderer::SetFontRenderParams(const FontRenderParams& params, | 238 void SkiaTextRenderer::SetFontRenderParams(const FontRenderParams& params, |
239 bool subpixel_rendering_suppressed) { | 239 bool subpixel_rendering_suppressed) { |
240 ApplyRenderParams(params, subpixel_rendering_suppressed, &paint_); | 240 ApplyRenderParams(params, subpixel_rendering_suppressed, &paint_); |
241 } | 241 } |
242 | 242 |
243 void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) { | 243 void SkiaTextRenderer::SetTypeface(sk_sp<SkTypeface> typeface) { |
244 paint_.setTypeface(typeface); | 244 paint_.setTypeface(std::move(typeface)); |
245 } | 245 } |
246 | 246 |
247 void SkiaTextRenderer::SetTextSize(SkScalar size) { | 247 void SkiaTextRenderer::SetTextSize(SkScalar size) { |
248 paint_.setTextSize(size); | 248 paint_.setTextSize(size); |
249 } | 249 } |
250 | 250 |
251 void SkiaTextRenderer::SetForegroundColor(SkColor foreground) { | 251 void SkiaTextRenderer::SetForegroundColor(SkColor foreground) { |
252 paint_.setColor(foreground); | 252 paint_.setColor(foreground); |
253 } | 253 } |
254 | 254 |
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 | 1587 |
1588 SetDisplayOffset(display_offset_.x() + delta_x); | 1588 SetDisplayOffset(display_offset_.x() + delta_x); |
1589 } | 1589 } |
1590 | 1590 |
1591 void RenderText::DrawSelection(Canvas* canvas) { | 1591 void RenderText::DrawSelection(Canvas* canvas) { |
1592 for (const Rect& s : GetSubstringBounds(selection())) | 1592 for (const Rect& s : GetSubstringBounds(selection())) |
1593 canvas->FillRect(s, selection_background_focused_color_); | 1593 canvas->FillRect(s, selection_background_focused_color_); |
1594 } | 1594 } |
1595 | 1595 |
1596 } // namespace gfx | 1596 } // namespace gfx |
OLD | NEW |