From 29585b2482d3c5c675335e41987470a931028485 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Tue, 11 Apr 2023 10:09:28 -0700 Subject: [PATCH] [Impeller] Move `TextRenderContext::Create` symbol into the text backend (flutter/engine#41067) Moves the `TextRenderContext::Create` symbol into the backend, so that we can easily swap out the backend when building the 2D renderer in impeller-cmake. --- .../typographer/backends/skia/text_render_context_skia.cc | 6 ++++++ .../flutter/impeller/typographer/text_render_context.cc | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc b/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc index 48e640f0f5..313a7d8b45 100644 --- a/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc +++ b/engine/src/flutter/impeller/typographer/backends/skia/text_render_context_skia.cc @@ -22,6 +22,12 @@ namespace impeller { +std::unique_ptr TextRenderContext::Create( + std::shared_ptr context) { + // There is only one backend today. + return std::make_unique(std::move(context)); +} + // TODO(bdero): We might be able to remove this per-glyph padding if we fix // the underlying causes of the overlap. // https://github.com/flutter/flutter/issues/114563 diff --git a/engine/src/flutter/impeller/typographer/text_render_context.cc b/engine/src/flutter/impeller/typographer/text_render_context.cc index 072e33ab88..8cc8dbf00a 100644 --- a/engine/src/flutter/impeller/typographer/text_render_context.cc +++ b/engine/src/flutter/impeller/typographer/text_render_context.cc @@ -6,16 +6,8 @@ #include -#include "impeller/typographer/backends/skia/text_render_context_skia.h" - namespace impeller { -std::unique_ptr TextRenderContext::Create( - std::shared_ptr context) { - // There is only one backend today. - return std::make_unique(std::move(context)); -} - TextRenderContext::TextRenderContext(std::shared_ptr context) : context_(std::move(context)) { if (!context_ || !context_->IsValid()) {