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 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 // Internal helper class used by derived classes to draw text through Skia. | 48 // Internal helper class used by derived classes to draw text through Skia. |
49 class SkiaTextRenderer { | 49 class SkiaTextRenderer { |
50 public: | 50 public: |
51 explicit SkiaTextRenderer(Canvas* canvas); | 51 explicit SkiaTextRenderer(Canvas* canvas); |
52 ~SkiaTextRenderer(); | 52 ~SkiaTextRenderer(); |
53 | 53 |
54 void SetDrawLooper(SkDrawLooper* draw_looper); | 54 void SetDrawLooper(SkDrawLooper* draw_looper); |
55 void SetFontRenderParams(const FontRenderParams& params, | 55 void SetFontRenderParams(const FontRenderParams& params, |
56 bool background_is_transparent); | 56 bool background_is_transparent); |
| 57 #if defined(OS_WIN) |
| 58 void CorrectPaintFlags(bool background_is_transparent); |
| 59 #endif // OS_WIN |
57 void SetTypeface(SkTypeface* typeface); | 60 void SetTypeface(SkTypeface* typeface); |
58 void SetTextSize(SkScalar size); | 61 void SetTextSize(SkScalar size); |
59 void SetFontFamilyWithStyle(const std::string& family, int font_style); | 62 void SetFontFamilyWithStyle(const std::string& family, int font_style); |
60 void SetForegroundColor(SkColor foreground); | 63 void SetForegroundColor(SkColor foreground); |
61 void SetShader(SkShader* shader, const Rect& bounds); | 64 void SetShader(SkShader* shader, const Rect& bounds); |
62 // Sets underline metrics to use if the text will be drawn with an underline. | 65 // Sets underline metrics to use if the text will be drawn with an underline. |
63 // If not set, default values based on the size of the text will be used. The | 66 // If not set, default values based on the size of the text will be used. The |
64 // two metrics must be set together. | 67 // two metrics must be set together. |
65 void SetUnderlineMetrics(SkScalar thickness, SkScalar position); | 68 void SetUnderlineMetrics(SkScalar thickness, SkScalar position); |
66 void DrawSelection(const std::vector<Rect>& selection, SkColor color); | 69 void DrawSelection(const std::vector<Rect>& selection, SkColor color); |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 // Lines computed by EnsureLayout. These should be invalidated with | 729 // Lines computed by EnsureLayout. These should be invalidated with |
727 // ResetLayout and on |display_rect_| changes. | 730 // ResetLayout and on |display_rect_| changes. |
728 std::vector<internal::Line> lines_; | 731 std::vector<internal::Line> lines_; |
729 | 732 |
730 DISALLOW_COPY_AND_ASSIGN(RenderText); | 733 DISALLOW_COPY_AND_ASSIGN(RenderText); |
731 }; | 734 }; |
732 | 735 |
733 } // namespace gfx | 736 } // namespace gfx |
734 | 737 |
735 #endif // UI_GFX_RENDER_TEXT_H_ | 738 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |