Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2289)

Unified Diff: ui/gfx/test/render_text_test_api.h

Issue 2556083002: Don't subtract border from max size for display rect. (Closed)
Patch Set: RenderTextTestApi Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | ui/gfx/test/render_text_test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/gfx/render_text_unittest.cc ('k') | ui/gfx/test/render_text_test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698