Skip to content

Commit a6a6fd1

Browse files
authored
Replace kLegacyFontHost_InitType with kUnknown_SkPixelGeometry. (flutter#21474)
Skia is removing the deprecated legacy display setting globals and associated kLegacyFontHost_InitType. This change replaces all such uses with default surface properties with no special flags and an unknown pixel geometry. Flutter never set the associated globals, leaving them with their initial default values, which were no special flags and horizontal RGB pixel geometry. The values used here are different but this change should make no difference as Flutter never mentions SkFont::kSubpixelAntiAlias to take advantage of the pixel geometry.
1 parent 41ce791 commit a6a6fd1

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

shell/gpu/gpu_surface_gl.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrDirectContext* context,
170170
);
171171

172172
sk_sp<SkColorSpace> colorspace = SkColorSpace::MakeSRGB();
173-
174-
SkSurfaceProps surface_props(
175-
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
173+
SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
176174

177175
return SkSurface::MakeFromBackendRenderTarget(
178176
context, // gr context

shell/platform/embedder/embedder.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
353353
texture_info //
354354
);
355355

356-
SkSurfaceProps surface_properties(
357-
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
356+
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
358357

359358
auto surface = SkSurface::MakeFromBackendTexture(
360359
context, // context
@@ -398,8 +397,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
398397
framebuffer_info // framebuffer info
399398
);
400399

401-
SkSurfaceProps surface_properties(
402-
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
400+
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
403401

404402
auto surface = SkSurface::MakeFromBackendRenderTarget(
405403
context, // context

shell/platform/fuchsia/flutter/vulkan_surface.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrDirectContext> context,
349349
GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0,
350350
image_info);
351351

352-
SkSurfaceProps sk_surface_props(
353-
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
352+
SkSurfaceProps sk_surface_props(0, kUnknown_SkPixelGeometry);
354353

355354
auto sk_surface =
356355
SkSurface::MakeFromBackendRenderTarget(context.get(), //

testing/test_gl_surface.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,7 @@ sk_sp<SkSurface> TestGLSurface::GetOnscreenSurface() {
312312
framebuffer_info // framebuffer info
313313
);
314314

315-
SkSurfaceProps surface_properties(
316-
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
315+
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);
317316

318317
auto surface = SkSurface::MakeFromBackendRenderTarget(
319318
GetGrContext().get(), // context

vulkan/vulkan_swapchain.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ sk_sp<SkSurface> VulkanSwapchain::CreateSkiaSurface(
232232
// TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt.
233233
GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0,
234234
image_info);
235-
SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType);
235+
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
236236

237237
return SkSurface::MakeFromBackendRenderTarget(
238238
gr_context, // context

0 commit comments

Comments
 (0)