Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a43b69e

Browse files
committed
Install the skia text backend when building shell surfaces
1 parent 5c5ea90 commit a43b69e

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

shell/common/rasterizer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "flutter/fml/synchronization/waitable_event.h"
2424
#include "flutter/fml/time/time_delta.h"
2525
#include "flutter/fml/time/time_point.h"
26+
#include "impeller/typographer/backends/skia/text_render_context_skia.h"
2627
#if IMPELLER_SUPPORTS_RENDERING
2728
// GN is having trouble understanding how this works in the Fuchsia builds.
2829
#include "flutter/impeller/aiks/aiks_context.h" // nogncheck
@@ -544,7 +545,8 @@ class Rasterizer final : public SnapshotDelegate,
544545
return surface_->GetAiksContext();
545546
}
546547
if (auto context = impeller_context_.lock()) {
547-
return std::make_shared<impeller::AiksContext>(context);
548+
return std::make_shared<impeller::AiksContext>(
549+
context, impeller::TextRenderContextSkia::Make());
548550
}
549551
#endif
550552
return nullptr;

shell/gpu/gpu_surface_gl_impeller.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
#include "flutter/shell/gpu/gpu_surface_gl_impeller.h"
66

77
#include "flutter/fml/make_copyable.h"
8-
#include "flutter/impeller/display_list/dl_dispatcher.h"
9-
#include "flutter/impeller/renderer/backend/gles/surface_gles.h"
10-
#include "flutter/impeller/renderer/renderer.h"
8+
#include "impeller/display_list/dl_dispatcher.h"
9+
#include "impeller/renderer/backend/gles/surface_gles.h"
10+
#include "impeller/renderer/renderer.h"
11+
#include "impeller/typographer/backends/skia/text_render_context_skia.h"
1112

1213
namespace flutter {
1314

@@ -28,7 +29,8 @@ GPUSurfaceGLImpeller::GPUSurfaceGLImpeller(
2829
return;
2930
}
3031

31-
auto aiks_context = std::make_shared<impeller::AiksContext>(context);
32+
auto aiks_context = std::make_shared<impeller::AiksContext>(
33+
context, impeller::TextRenderContextSkia::Make());
3234

3335
if (!aiks_context->IsValid()) {
3436
return;

shell/gpu/gpu_surface_metal_impeller.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#include "flutter/fml/make_copyable.h"
1212
#include "flutter/fml/mapping.h"
1313
#include "flutter/fml/trace_event.h"
14-
#include "flutter/impeller/display_list/dl_dispatcher.h"
15-
#include "flutter/impeller/renderer/backend/metal/surface_mtl.h"
14+
#include "impeller/display_list/dl_dispatcher.h"
15+
#include "impeller/renderer/backend/metal/surface_mtl.h"
16+
#include "impeller/typographer/backends/skia/text_render_context_skia.h"
1617

1718
static_assert(!__has_feature(objc_arc), "ARC must be disabled.");
1819

@@ -35,7 +36,8 @@
3536
render_target_type_(delegate->GetRenderTargetType()),
3637
impeller_renderer_(CreateImpellerRenderer(context)),
3738
aiks_context_(
38-
std::make_shared<impeller::AiksContext>(impeller_renderer_ ? context : nullptr)),
39+
std::make_shared<impeller::AiksContext>(impeller_renderer_ ? context : nullptr,
40+
impeller::TextRenderContextSkia::Make())),
3941
render_to_surface_(render_to_surface) {
4042
// If this preference is explicitly set, we allow for disabling partial repaint.
4143
NSNumber* disablePartialRepaint =

shell/gpu/gpu_surface_vulkan_impeller.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
#include "flutter/shell/gpu/gpu_surface_vulkan_impeller.h"
66

77
#include "flutter/fml/make_copyable.h"
8-
#include "flutter/impeller/display_list/dl_dispatcher.h"
9-
#include "flutter/impeller/renderer/renderer.h"
8+
#include "impeller/display_list/dl_dispatcher.h"
109
#include "impeller/renderer/backend/vulkan/surface_context_vk.h"
10+
#include "impeller/renderer/renderer.h"
1111
#include "impeller/renderer/surface.h"
12+
#include "impeller/typographer/backends/skia/text_render_context_skia.h"
1213

1314
namespace flutter {
1415

@@ -23,7 +24,8 @@ GPUSurfaceVulkanImpeller::GPUSurfaceVulkanImpeller(
2324
return;
2425
}
2526

26-
auto aiks_context = std::make_shared<impeller::AiksContext>(context);
27+
auto aiks_context = std::make_shared<impeller::AiksContext>(
28+
context, impeller::TextRenderContextSkia::Make());
2729
if (!aiks_context->IsValid()) {
2830
return;
2931
}

0 commit comments

Comments
 (0)