| 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_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 struct StyleRange; | 30 struct StyleRange; |
| 31 | 31 |
| 32 namespace internal { | 32 namespace internal { |
| 33 | 33 |
| 34 // Internal helper class used by derived classes to draw text through Skia. | 34 // Internal helper class used by derived classes to draw text through Skia. |
| 35 class SkiaTextRenderer { | 35 class SkiaTextRenderer { |
| 36 public: | 36 public: |
| 37 explicit SkiaTextRenderer(Canvas* canvas); | 37 explicit SkiaTextRenderer(Canvas* canvas); |
| 38 ~SkiaTextRenderer(); | 38 ~SkiaTextRenderer(); |
| 39 | 39 |
| 40 void SetFontSmoothingSettings(bool enable_smoothing, bool enable_lcd_text); |
| 40 void SetTypeface(SkTypeface* typeface); | 41 void SetTypeface(SkTypeface* typeface); |
| 41 void SetTextSize(int size); | 42 void SetTextSize(int size); |
| 42 void SetFont(const gfx::Font& font); | 43 void SetFont(const gfx::Font& font); |
| 43 void SetFontStyle(int font_style); | 44 void SetFontStyle(int font_style); |
| 44 void SetForegroundColor(SkColor foreground); | 45 void SetForegroundColor(SkColor foreground); |
| 45 void SetShader(SkShader* shader); | 46 void SetShader(SkShader* shader); |
| 46 void DrawSelection(const std::vector<Rect>& selection, SkColor color); | 47 void DrawSelection(const std::vector<Rect>& selection, SkColor color); |
| 47 void DrawPosText(const SkPoint* pos, | 48 void DrawPosText(const SkPoint* pos, |
| 48 const uint16* glyphs, | 49 const uint16* glyphs, |
| 49 size_t glyph_count); | 50 size_t glyph_count); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 // The cached bounds and offset are invalidated by changes to the cursor, | 425 // The cached bounds and offset are invalidated by changes to the cursor, |
| 425 // selection, font, and other operations that adjust the visible text bounds. | 426 // selection, font, and other operations that adjust the visible text bounds. |
| 426 bool cached_bounds_and_offset_valid_; | 427 bool cached_bounds_and_offset_valid_; |
| 427 | 428 |
| 428 DISALLOW_COPY_AND_ASSIGN(RenderText); | 429 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 429 }; | 430 }; |
| 430 | 431 |
| 431 } // namespace gfx | 432 } // namespace gfx |
| 432 | 433 |
| 433 #endif // UI_GFX_RENDER_TEXT_H_ | 434 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |