Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ group("unittests") {
if (is_mac) {
public_deps += [
"//flutter/impeller/golden_tests:impeller_golden_tests",
"//flutter/shell/gpu:gpu_surface_metal_unittests",
"//flutter/shell/platform/darwin/common:availability_version_check_unittests",
"//flutter/shell/platform/darwin/common:framework_common_unittests",
"//flutter/shell/surface:metal_unittests",
"//flutter/third_party/spring_animation:spring_animation_unittests",
]
}
Expand Down
2 changes: 1 addition & 1 deletion shell/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//flutter/common/config.gni")
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/shell/gpu/gpu.gni")
import("//flutter/shell/surface/surface.gni")
import("//flutter/testing/testing.gni")

if (is_fuchsia) {
Expand Down
2 changes: 1 addition & 1 deletion shell/common/shell_test_platform_view_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <EGL/egl.h>

#include "flutter/shell/gpu/gpu_surface_gl_skia.h"
#include "flutter/shell/surface/surface_gl_skia.h"
#include "impeller/entity/gles/entity_shaders_gles.h"

#if IMPELLER_ENABLE_3D
Expand Down
2 changes: 1 addition & 1 deletion shell/common/shell_test_platform_view_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "flutter/shell/common/shell_test_external_view_embedder.h"
#include "flutter/shell/common/shell_test_platform_view.h"
#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
#include "flutter/shell/surface/surface_gl_delegate.h"
#include "flutter/testing/test_gl_surface.h"
#include "impeller/renderer/backend/gles/context_gles.h"

Expand Down
4 changes: 2 additions & 2 deletions shell/common/shell_test_platform_view_metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

#include "flutter/fml/macros.h"
#include "flutter/shell/common/shell_test_platform_view.h"
#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
#include "flutter/shell/surface/surface_metal_delegate.h"

namespace flutter {
namespace testing {

class DarwinContextMetal;

class ShellTestPlatformViewMetal final : public ShellTestPlatformView,
public GPUSurfaceMetalDelegate {
public SurfaceMetalDelegate {
public:
ShellTestPlatformViewMetal(PlatformView::Delegate& delegate,
const TaskRunners& task_runners,
Expand Down
12 changes: 6 additions & 6 deletions shell/common/shell_test_platform_view_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <utility>

#include "flutter/fml/platform/darwin/scoped_nsobject.h"
#include "flutter/shell/gpu/gpu_surface_metal_impeller.h"
#include "flutter/shell/gpu/gpu_surface_metal_skia.h"
#include "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalImpeller.h"
#include "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.h"
#include "flutter/shell/surface/surface_metal_impeller.h"
#include "flutter/shell/surface/surface_metal_skia.h"

namespace flutter {
namespace testing {
Expand Down Expand Up @@ -74,7 +74,7 @@ GPUMTLTextureInfo offscreen_texture_info() const {
std::shared_ptr<ShellTestExternalViewEmbedder> shell_test_external_view_embedder,
const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch)
: ShellTestPlatformView(delegate, task_runners),
GPUSurfaceMetalDelegate(MTLRenderTargetType::kMTLTexture),
SurfaceMetalDelegate(MTLRenderTargetType::kMTLTexture),
metal_context_(std::make_unique<DarwinContextMetal>(GetSettings().enable_impeller,
is_gpu_disabled_sync_switch)),
create_vsync_waiter_(std::move(create_vsync_waiter)),
Expand Down Expand Up @@ -113,10 +113,10 @@ GPUMTLTextureInfo offscreen_texture_info() const {
// |PlatformView|
std::unique_ptr<Surface> ShellTestPlatformViewMetal::CreateRenderingSurface() {
if (GetSettings().enable_impeller) {
return std::make_unique<GPUSurfaceMetalImpeller>(this,
[metal_context_->impeller_context() context]);
return std::make_unique<SurfaceMetalImpeller>(this,
[metal_context_->impeller_context() context]);
}
return std::make_unique<GPUSurfaceMetalSkia>(this, [metal_context_->context() mainContext]);
return std::make_unique<SurfaceMetalSkia>(this, [metal_context_->context() mainContext]);
}

// |PlatformView|
Expand Down
2 changes: 1 addition & 1 deletion shell/common/shell_test_platform_view_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "flutter/shell/common/shell_test_external_view_embedder.h"
#include "flutter/shell/common/shell_test_platform_view.h"
#include "flutter/shell/gpu/gpu_surface_vulkan_delegate.h"
#include "flutter/shell/surface/surface_vulkan_delegate.h"
#include "flutter/vulkan/vulkan_application.h"
#include "flutter/vulkan/vulkan_device.h"
#include "flutter/vulkan/vulkan_skia_proc_table.h"
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import("//flutter/build/zip_bundle.gni")
import("//flutter/common/config.gni")
import("//flutter/impeller/tools/impeller.gni")
import("//flutter/shell/config.gni")
import("//flutter/shell/gpu/gpu.gni")
import("//flutter/shell/surface/surface.gni")
import("//flutter/shell/version/version.gni")
import("//flutter/vulkan/config.gni")

Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/android_surface_gl_impeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "flutter/fml/logging.h"
#include "flutter/impeller/toolkit/egl/surface.h"
#include "flutter/shell/gpu/gpu_surface_gl_impeller.h"
#include "flutter/shell/surface/surface_gl_impeller.h"

namespace flutter {

Expand Down Expand Up @@ -35,7 +35,7 @@ bool AndroidSurfaceGLImpeller::IsValid() const {
// |AndroidSurface|
std::unique_ptr<Surface> AndroidSurfaceGLImpeller::CreateGPUSurface(
GrDirectContext* gr_context) {
auto surface = std::make_unique<GPUSurfaceGLImpeller>(
auto surface = std::make_unique<SurfaceGLImpeller>(
this, // delegate
android_context_->GetImpellerContext(), // context
true // render to surface
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/android_surface_gl_impeller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

#include "flutter/fml/macros.h"
#include "flutter/impeller/renderer/context.h"
#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
#include "flutter/shell/platform/android/android_context_gl_impeller.h"
#include "flutter/shell/platform/android/surface/android_native_window.h"
#include "flutter/shell/platform/android/surface/android_surface.h"
#include "flutter/shell/surface/surface_gl_delegate.h"

namespace flutter {

class AndroidSurfaceGLImpeller final : public GPUSurfaceGLDelegate,
class AndroidSurfaceGLImpeller final : public SurfaceGLDelegate,
public AndroidSurface {
public:
explicit AndroidSurfaceGLImpeller(
Expand Down
13 changes: 6 additions & 7 deletions shell/platform/android/android_surface_gl_skia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,15 @@ bool AndroidSurfaceGLSkia::IsValid() const {
std::unique_ptr<Surface> AndroidSurfaceGLSkia::CreateGPUSurface(
GrDirectContext* gr_context) {
if (gr_context) {
return std::make_unique<GPUSurfaceGLSkia>(sk_ref_sp(gr_context), this,
true);
return std::make_unique<SurfaceGLSkia>(sk_ref_sp(gr_context), this, true);
} else {
sk_sp<GrDirectContext> main_skia_context =
android_context_->GetMainSkiaContext();
if (!main_skia_context) {
main_skia_context = GPUSurfaceGLSkia::MakeGLContext(this);
main_skia_context = SurfaceGLSkia::MakeGLContext(this);
android_context_->SetMainSkiaContext(main_skia_context);
}
return std::make_unique<GPUSurfaceGLSkia>(main_skia_context, this, true);
return std::make_unique<SurfaceGLSkia>(main_skia_context, this, true);
}
}

Expand Down Expand Up @@ -200,7 +199,7 @@ sk_sp<const GrGLInterface> AndroidSurfaceGLSkia::GetGLInterface() const {
}
}

return GPUSurfaceGLDelegate::GetGLInterface();
return SurfaceGLDelegate::GetGLInterface();
}

std::unique_ptr<Surface> AndroidSurfaceGLSkia::CreateSnapshotSurface() {
Expand All @@ -210,11 +209,11 @@ std::unique_ptr<Surface> AndroidSurfaceGLSkia::CreateSnapshotSurface() {
sk_sp<GrDirectContext> main_skia_context =
android_context_->GetMainSkiaContext();
if (!main_skia_context) {
main_skia_context = GPUSurfaceGLSkia::MakeGLContext(this);
main_skia_context = SurfaceGLSkia::MakeGLContext(this);
android_context_->SetMainSkiaContext(main_skia_context);
}

return std::make_unique<GPUSurfaceGLSkia>(main_skia_context, this, true);
return std::make_unique<SurfaceGLSkia>(main_skia_context, this, true);
}

} // namespace flutter
4 changes: 2 additions & 2 deletions shell/platform/android/android_surface_gl_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#include <memory>

#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_gl_skia.h"
#include "flutter/shell/platform/android/android_context_gl_skia.h"
#include "flutter/shell/platform/android/android_environment_gl.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
#include "flutter/shell/platform/android/surface/android_surface.h"
#include "flutter/shell/surface/surface_gl_skia.h"

namespace flutter {

class AndroidSurfaceGLSkia final : public GPUSurfaceGLDelegate,
class AndroidSurfaceGLSkia final : public SurfaceGLDelegate,
public AndroidSurface {
public:
explicit AndroidSurfaceGLSkia(
Expand Down
3 changes: 1 addition & 2 deletions shell/platform/android/android_surface_software.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "flutter/fml/trace_event.h"
#include "flutter/shell/platform/android/android_shell_holder.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"

#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkSurface.h"

Expand Down Expand Up @@ -69,7 +68,7 @@ std::unique_ptr<Surface> AndroidSurfaceSoftware::CreateGPUSurface(
}

auto surface =
std::make_unique<GPUSurfaceSoftware>(this, true /* render to surface */);
std::make_unique<SurfaceSoftware>(this, true /* render to surface */);

if (!surface->IsValid()) {
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/android_surface_software.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#include "flutter/fml/macros.h"
#include "flutter/fml/platform/android/jni_weak_ref.h"
#include "flutter/fml/platform/android/scoped_java_ref.h"
#include "flutter/shell/gpu/gpu_surface_software.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
#include "flutter/shell/platform/android/surface/android_surface.h"
#include "flutter/shell/surface/surface_software.h"

#include "third_party/skia/include/core/SkSurface.h"

namespace flutter {

class AndroidSurfaceSoftware final : public AndroidSurface,
public GPUSurfaceSoftwareDelegate {
public SurfaceSoftwareDelegate {
public:
AndroidSurfaceSoftware();

Expand Down
8 changes: 4 additions & 4 deletions shell/platform/android/android_surface_vk_impeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "flutter/fml/memory/ref_ptr.h"
#include "flutter/impeller/renderer/backend/vulkan/context_vk.h"
#include "flutter/impeller/renderer/backend/vulkan/swapchain/swapchain_vk.h"
#include "flutter/shell/gpu/gpu_surface_vulkan_impeller.h"
#include "flutter/shell/surface/surface_vulkan_impeller.h"
#include "flutter/vulkan/vulkan_native_surface_android.h"

namespace flutter {
Expand All @@ -25,7 +25,7 @@ AndroidSurfaceVKImpeller::AndroidSurfaceVKImpeller(
impeller::ContextVK::Cast(*android_context->GetImpellerContext());
surface_context_vk_ = context_vk.CreateSurfaceContext();
eager_gpu_surface_ =
std::make_unique<GPUSurfaceVulkanImpeller>(surface_context_vk_);
std::make_unique<SurfaceVulkanImpeller>(surface_context_vk_);
}

AndroidSurfaceVKImpeller::~AndroidSurfaceVKImpeller() = default;
Expand Down Expand Up @@ -56,8 +56,8 @@ std::unique_ptr<Surface> AndroidSurfaceVKImpeller::CreateGPUSurface(
return gpu_surface;
}

std::unique_ptr<GPUSurfaceVulkanImpeller> gpu_surface =
std::make_unique<GPUSurfaceVulkanImpeller>(surface_context_vk_);
std::unique_ptr<SurfaceVulkanImpeller> gpu_surface =
std::make_unique<SurfaceVulkanImpeller>(surface_context_vk_);

if (!gpu_surface->IsValid()) {
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/android_surface_vk_impeller.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "flutter/shell/platform/android/android_context_vk_impeller.h"
#include "flutter/shell/platform/android/surface/android_native_window.h"
#include "flutter/shell/platform/android/surface/android_surface.h"
#include "shell/gpu/gpu_surface_vulkan_impeller.h"
#include "flutter/shell/surface/surface_vulkan_impeller.h"

namespace flutter {

Expand Down Expand Up @@ -53,7 +53,7 @@ class AndroidSurfaceVKImpeller : public AndroidSurface {
// The first GPU Surface is initialized as soon as the
// AndroidSurfaceVulkanImpeller is created. This ensures that the pipelines
// are bootstrapped as early as possible.
std::unique_ptr<GPUSurfaceVulkanImpeller> eager_gpu_surface_;
std::unique_ptr<SurfaceVulkanImpeller> eager_gpu_surface_;

bool is_valid_ = false;

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/external_view_embedder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ executable("android_external_view_embedder_unittests") {
":external_view_embedder",
":external_view_embedder_fixtures",
"//flutter/flow",
"//flutter/shell/gpu:gpu_surface_gl",
"//flutter/shell/platform/android/jni:jni_mock",
"//flutter/shell/platform/android/surface",
"//flutter/shell/platform/android/surface:surface_mock",
"//flutter/shell/surface:gl",
"//flutter/testing",
"//flutter/testing:dart",
"//flutter/testing:skia",
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/platform_view_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "flutter/common/graphics/texture.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/shell/common/shell_io_manager.h"
#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
#include "flutter/shell/platform/android/android_context_gl_impeller.h"
#include "flutter/shell/platform/android/android_context_gl_skia.h"
#include "flutter/shell/platform/android/android_context_vk_impeller.h"
Expand All @@ -23,6 +22,7 @@
#include "flutter/shell/platform/android/surface_texture_external_texture_gl_impeller.h"
#include "flutter/shell/platform/android/surface_texture_external_texture_gl_skia.h"
#include "flutter/shell/platform/android/surface_texture_external_texture_vk_impeller.h"
#include "flutter/shell/surface/surface_gl_delegate.h"
#include "fml/logging.h"
#if IMPELLER_ENABLE_VULKAN // b/258506856 for why this is behind an if
#include "flutter/shell/platform/android/android_surface_vk_impeller.h"
Expand Down Expand Up @@ -384,7 +384,7 @@ sk_sp<GrDirectContext> PlatformViewAndroid::CreateResourceContext() const {
// this changes, this assumption breaks. Handle the same.
resource_context = ShellIOManager::CreateCompatibleResourceLoadingContext(
GrBackendApi::kOpenGL,
GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface());
SurfaceGLDelegate::GetDefaultPlatformGLInterface());
} else {
FML_DLOG(ERROR) << "Could not make the resource context current.";
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/android/surface/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ source_set("surface_mock") {
deps = [
":surface",
"//flutter/flow",
"//flutter/shell/gpu:gpu_surface_gl",
"//flutter/shell/surface:gl",
"//flutter/third_party/googletest:gmock",
"//flutter/third_party/googletest:gtest",
]
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/surface/android_surface_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_MOCK_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_MOCK_H_

#include "flutter/shell/gpu/gpu_surface_gl_skia.h"
#include "flutter/shell/platform/android/surface/android_surface.h"
#include "flutter/shell/surface/surface_gl_skia.h"
#include "gmock/gmock.h"

namespace flutter {
Expand All @@ -15,7 +15,7 @@ namespace flutter {
/// Mock for |AndroidSurface|. This implementation can be used in unit
/// tests without requiring the Android toolchain.
///
class AndroidSurfaceMock final : public GPUSurfaceGLDelegate,
class AndroidSurfaceMock final : public SurfaceGLDelegate,
public AndroidSurface {
public:
MOCK_METHOD(bool, IsValid, (), (const, override));
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import("//build/toolchain/clang.gni")
import("//build/toolchain/toolchain.gni")
import("//flutter/common/config.gni")
import("//flutter/shell/config.gni")
import("//flutter/shell/gpu/gpu.gni")
import("//flutter/shell/platform/darwin/common/framework_common.gni")
import("//flutter/shell/surface/surface.gni")
import("//flutter/testing/testing.gni")

_flutter_framework_dir = "$root_out_dir/Flutter.framework"
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/ios_surface_metal_impeller.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_METAL_IMPELLER_H_

#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
#include "flutter/shell/platform/darwin/ios/ios_surface.h"
#include "flutter/shell/surface/surface_metal_delegate.h"

@class CAMetalLayer;

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/ios_surface_metal_impeller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "flutter/impeller/renderer/backend/metal/formats_mtl.h"
#include "flutter/impeller/renderer/context.h"
#include "flutter/shell/gpu/gpu_surface_metal_impeller.h"
#include "flutter/shell/surface/surface_metal_impeller.h"

FLUTTER_ASSERT_ARC

Expand Down
2 changes: 1 addition & 1 deletion shell/platform/darwin/ios/ios_surface_metal_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#if !SLIMPELLER

#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
#import "flutter/shell/platform/darwin/ios/ios_surface.h"
#include "flutter/shell/surface/surface_metal_delegate.h"
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"

@class CAMetalLayer;
Expand Down
Loading