Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_GFX_RENDER_TEXT_TEST_API_H_ | |
| 6 #define UI_GFX_RENDER_TEXT_TEST_API_H_ | |
| 7 | |
| 8 #include "ui/gfx/render_text_test_api.h" | |
| 9 | |
| 10 #include "ui/gfx/render_text.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 namespace internal { | |
| 14 class TextRunList; | |
| 15 } | |
| 16 | |
| 17 namespace test { | |
| 18 | |
| 19 class RenderTextTestApi { | |
| 20 public: | |
| 21 RenderTextTestApi(RenderText* render_text) : render_text_(render_text) {} | |
|
sky
2016/12/13 17:48:31
explicit
oshima
2016/12/13 21:18:12
Done.
| |
| 22 | |
| 23 static SkPaint& GetRendererPaint(internal::SkiaTextRenderer* renderer); | |
| 24 | |
| 25 // Callers should ensure that the associated RenderText object is a | |
| 26 // RenderTextHarfBuzz instance. | |
| 27 internal::TextRunList* GetHarfBuzzRunList(); | |
| 28 | |
| 29 void DrawVisualText(internal::SkiaTextRenderer* renderer); | |
| 30 | |
| 31 const BreakList<SkColor>& colors() const { return render_text_->colors(); } | |
| 32 | |
| 33 const BreakList<BaselineStyle>& baselines() const { | |
| 34 return render_text_->baselines(); | |
| 35 } | |
| 36 | |
| 37 const BreakList<Font::Weight>& weights() const { | |
| 38 return render_text_->weights(); | |
| 39 } | |
| 40 | |
| 41 const std::vector<BreakList<bool>>& styles() const { | |
| 42 return render_text_->styles(); | |
| 43 } | |
| 44 | |
| 45 const std::vector<internal::Line>& lines() const { | |
| 46 return render_text_->lines(); | |
| 47 } | |
| 48 | |
| 49 SelectionModel EdgeSelectionModel(VisualCursorDirection direction); | |
| 50 | |
| 51 size_t TextIndexToDisplayIndex(size_t index); | |
| 52 | |
| 53 size_t DisplayIndexToTextIndex(size_t index); | |
| 54 | |
| 55 void EnsureLayout(); | |
| 56 | |
| 57 Vector2d GetAlignmentOffset(size_t line_number); | |
| 58 | |
| 59 private: | |
| 60 RenderText* render_text_; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(RenderTextTestApi); | |
| 63 }; | |
| 64 | |
| 65 } // namespace test | |
| 66 } // namespace gfx | |
| 67 | |
| 68 #endif // UI_GFX_RENDER_TEXT_TEST_API_H_ | |
| OLD | NEW |