| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 18 matching lines...) Expand all Loading... |
| 29 class RenderTextTest; | 29 class RenderTextTest; |
| 30 | 30 |
| 31 namespace internal { | 31 namespace internal { |
| 32 | 32 |
| 33 // Internal helper class used by derived classes to draw text through Skia. | 33 // Internal helper class used by derived classes to draw text through Skia. |
| 34 class SkiaTextRenderer { | 34 class SkiaTextRenderer { |
| 35 public: | 35 public: |
| 36 explicit SkiaTextRenderer(Canvas* canvas); | 36 explicit SkiaTextRenderer(Canvas* canvas); |
| 37 ~SkiaTextRenderer(); | 37 ~SkiaTextRenderer(); |
| 38 | 38 |
| 39 void SetTypeface(SkTypeface* typeface); |
| 40 void SetTextSize(int size); |
| 39 void SetFont(const gfx::Font& font); | 41 void SetFont(const gfx::Font& font); |
| 40 void SetForegroundColor(SkColor foreground); | 42 void SetForegroundColor(SkColor foreground); |
| 41 void DrawSelection(const std::vector<Rect>& selection, SkColor color); | 43 void DrawSelection(const std::vector<Rect>& selection, SkColor color); |
| 42 void DrawPosText(const SkPoint* pos, | 44 void DrawPosText(const SkPoint* pos, |
| 43 const uint16* glyphs, | 45 const uint16* glyphs, |
| 44 size_t glyph_count); | 46 size_t glyph_count); |
| 45 void DrawDecorations(int x, int y, int width, bool underline, bool strike); | 47 void DrawDecorations(int x, int y, int width, bool underline, bool strike); |
| 46 void DrawCursor(const gfx::Rect& bounds); | 48 void DrawCursor(const gfx::Rect& bounds); |
| 47 | 49 |
| 48 private: | 50 private: |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // The cached bounds and offset are invalidated by changes to the cursor, | 348 // The cached bounds and offset are invalidated by changes to the cursor, |
| 347 // selection, font, and other operations that adjust the visible text bounds. | 349 // selection, font, and other operations that adjust the visible text bounds. |
| 348 bool cached_bounds_and_offset_valid_; | 350 bool cached_bounds_and_offset_valid_; |
| 349 | 351 |
| 350 DISALLOW_COPY_AND_ASSIGN(RenderText); | 352 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 351 }; | 353 }; |
| 352 | 354 |
| 353 } // namespace gfx | 355 } // namespace gfx |
| 354 | 356 |
| 355 #endif // UI_GFX_RENDER_TEXT_H_ | 357 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |