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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // Maximum baseline of all segments on this line. | 172 // Maximum baseline of all segments on this line. |
173 int baseline; | 173 int baseline; |
174 }; | 174 }; |
175 | 175 |
176 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|. | 176 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|. |
177 // May return NULL. | 177 // May return NULL. |
178 skia::RefPtr<SkTypeface> CreateSkiaTypeface(const std::string& family, | 178 skia::RefPtr<SkTypeface> CreateSkiaTypeface(const std::string& family, |
179 int style); | 179 int style); |
180 | 180 |
| 181 // Applies the given FontRenderParams to a Skia |paint|. |
| 182 void ApplyRenderParams(const FontRenderParams& params, |
| 183 bool background_is_transparent, |
| 184 SkPaint* paint); |
| 185 |
181 } // namespace internal | 186 } // namespace internal |
182 | 187 |
183 // RenderText represents an abstract model of styled text and its corresponding | 188 // RenderText represents an abstract model of styled text and its corresponding |
184 // visual layout. Support is built in for a cursor, a selection, simple styling, | 189 // visual layout. Support is built in for a cursor, a selection, simple styling, |
185 // complex scripts, and bi-directional text. Implementations provide mechanisms | 190 // complex scripts, and bi-directional text. Implementations provide mechanisms |
186 // for rendering and translation between logical and visual data. | 191 // for rendering and translation between logical and visual data. |
187 class GFX_EXPORT RenderText { | 192 class GFX_EXPORT RenderText { |
188 public: | 193 public: |
189 virtual ~RenderText(); | 194 virtual ~RenderText(); |
190 | 195 |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 // Lines computed by EnsureLayout. These should be invalidated with | 726 // Lines computed by EnsureLayout. These should be invalidated with |
722 // ResetLayout and on |display_rect_| changes. | 727 // ResetLayout and on |display_rect_| changes. |
723 std::vector<internal::Line> lines_; | 728 std::vector<internal::Line> lines_; |
724 | 729 |
725 DISALLOW_COPY_AND_ASSIGN(RenderText); | 730 DISALLOW_COPY_AND_ASSIGN(RenderText); |
726 }; | 731 }; |
727 | 732 |
728 } // namespace gfx | 733 } // namespace gfx |
729 | 734 |
730 #endif // UI_GFX_RENDER_TEXT_H_ | 735 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |