Skip to content

Commit

Permalink
Replace kLegacyFontHost_InitType with kUnknown_SkPixelGeometry. (flut…
Browse files Browse the repository at this point in the history
…ter#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.
  • Loading branch information
bungeman committed Sep 29, 2020
1 parent 41ce791 commit a6a6fd1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
4 changes: 1 addition & 3 deletions shell/gpu/gpu_surface_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ static sk_sp<SkSurface> WrapOnscreenSurface(GrDirectContext* context,
);

sk_sp<SkColorSpace> colorspace = SkColorSpace::MakeSRGB();

SkSurfaceProps surface_props(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);

return SkSurface::MakeFromBackendRenderTarget(
context, // gr context
Expand Down
6 changes: 2 additions & 4 deletions shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
texture_info //
);

SkSurfaceProps surface_properties(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

auto surface = SkSurface::MakeFromBackendTexture(
context, // context
Expand Down Expand Up @@ -398,8 +397,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
framebuffer_info // framebuffer info
);

SkSurfaceProps surface_properties(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

auto surface = SkSurface::MakeFromBackendRenderTarget(
context, // context
Expand Down
3 changes: 1 addition & 2 deletions shell/platform/fuchsia/flutter/vulkan_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrDirectContext> context,
GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0,
image_info);

SkSurfaceProps sk_surface_props(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps sk_surface_props(0, kUnknown_SkPixelGeometry);

auto sk_surface =
SkSurface::MakeFromBackendRenderTarget(context.get(), //
Expand Down
3 changes: 1 addition & 2 deletions testing/test_gl_surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,7 @@ sk_sp<SkSurface> TestGLSurface::GetOnscreenSurface() {
framebuffer_info // framebuffer info
);

SkSurfaceProps surface_properties(
SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps surface_properties(0, kUnknown_SkPixelGeometry);

auto surface = SkSurface::MakeFromBackendRenderTarget(
GetGrContext().get(), // context
Expand Down
2 changes: 1 addition & 1 deletion vulkan/vulkan_swapchain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ sk_sp<SkSurface> VulkanSwapchain::CreateSkiaSurface(
// TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt.
GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0,
image_info);
SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType);
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);

return SkSurface::MakeFromBackendRenderTarget(
gr_context, // context
Expand Down

0 comments on commit a6a6fd1

Please sign in to comment.