Chromium Code Reviews| Index: ui/gfx/test/render_text_test_api.h |
| diff --git a/ui/gfx/test/render_text_test_api.h b/ui/gfx/test/render_text_test_api.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cbe1460682aaa6649b46347311e6b4f25d0c8169 |
| --- /dev/null |
| +++ b/ui/gfx/test/render_text_test_api.h |
| @@ -0,0 +1,68 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_GFX_RENDER_TEXT_TEST_API_H_ |
| +#define UI_GFX_RENDER_TEXT_TEST_API_H_ |
| + |
| +#include "ui/gfx/render_text_test_api.h" |
| + |
| +#include "ui/gfx/render_text.h" |
| + |
| +namespace gfx { |
| +namespace internal { |
| +class TextRunList; |
| +} |
| + |
| +namespace test { |
| + |
| +class RenderTextTestApi { |
| + public: |
| + RenderTextTestApi(RenderText* render_text) : render_text_(render_text) {} |
|
sky
2016/12/13 17:48:31
explicit
oshima
2016/12/13 21:18:12
Done.
|
| + |
| + static SkPaint& GetRendererPaint(internal::SkiaTextRenderer* renderer); |
| + |
| + // Callers should ensure that the associated RenderText object is a |
| + // RenderTextHarfBuzz instance. |
| + internal::TextRunList* GetHarfBuzzRunList(); |
| + |
| + void DrawVisualText(internal::SkiaTextRenderer* renderer); |
| + |
| + const BreakList<SkColor>& colors() const { return render_text_->colors(); } |
| + |
| + const BreakList<BaselineStyle>& baselines() const { |
| + return render_text_->baselines(); |
| + } |
| + |
| + const BreakList<Font::Weight>& weights() const { |
| + return render_text_->weights(); |
| + } |
| + |
| + const std::vector<BreakList<bool>>& styles() const { |
| + return render_text_->styles(); |
| + } |
| + |
| + const std::vector<internal::Line>& lines() const { |
| + return render_text_->lines(); |
| + } |
| + |
| + SelectionModel EdgeSelectionModel(VisualCursorDirection direction); |
| + |
| + size_t TextIndexToDisplayIndex(size_t index); |
| + |
| + size_t DisplayIndexToTextIndex(size_t index); |
| + |
| + void EnsureLayout(); |
| + |
| + Vector2d GetAlignmentOffset(size_t line_number); |
| + |
| + private: |
| + RenderText* render_text_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RenderTextTestApi); |
| +}; |
| + |
| +} // namespace test |
| +} // namespace gfx |
| + |
| +#endif // UI_GFX_RENDER_TEXT_TEST_API_H_ |