Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,6 @@ FILE: ../../../flutter/shell/common/vsync_waiter_fallback.cc
FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h
FILE: ../../../flutter/shell/common/vsync_waiters_test.cc
FILE: ../../../flutter/shell/common/vsync_waiters_test.h
FILE: ../../../flutter/shell/gpu/gpu_surface_delegate.h
FILE: ../../../flutter/shell/gpu/gpu_surface_gl.cc
FILE: ../../../flutter/shell/gpu/gpu_surface_gl.h
FILE: ../../../flutter/shell/gpu/gpu_surface_gl_delegate.cc
Expand Down
4 changes: 0 additions & 4 deletions flow/surface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ Surface::Surface() = default;

Surface::~Surface() = default;

flutter::ExternalViewEmbedder* Surface::GetExternalViewEmbedder() {
return nullptr;
}

std::unique_ptr<GLContextResult> Surface::MakeRenderContextCurrent() {
return std::make_unique<GLContextDefaultResult>(true);
}
Expand Down
2 changes: 0 additions & 2 deletions flow/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class Surface {

virtual GrDirectContext* GetContext() = 0;

virtual flutter::ExternalViewEmbedder* GetExternalViewEmbedder();

virtual std::unique_ptr<GLContextResult> MakeRenderContextCurrent();

virtual bool ClearRenderContext();
Expand Down
5 changes: 0 additions & 5 deletions shell/common/shell_test_platform_view_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,5 @@ ShellTestPlatformViewGL::GetGLProcResolver() const {
};
}

// |GPUSurfaceGLDelegate|
ExternalViewEmbedder* ShellTestPlatformViewGL::GetExternalViewEmbedder() {
return shell_test_external_view_embedder_.get();
}

} // namespace testing
} // namespace flutter
3 changes: 0 additions & 3 deletions shell/common/shell_test_platform_view_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ class ShellTestPlatformViewGL : public ShellTestPlatformView,
// |GPUSurfaceGLDelegate|
GLProcResolver GetGLProcResolver() const override;

// |GPUSurfaceGLDelegate|
ExternalViewEmbedder* GetExternalViewEmbedder() override;

FML_DISALLOW_COPY_AND_ASSIGN(ShellTestPlatformViewGL);
};

Expand Down
5 changes: 0 additions & 5 deletions shell/common/shell_test_platform_view_vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,5 @@ SkMatrix ShellTestPlatformViewVulkan::OffScreenSurface::GetRootTransformation()
return matrix;
}

flutter::ExternalViewEmbedder*
ShellTestPlatformViewVulkan::OffScreenSurface::GetExternalViewEmbedder() {
return shell_test_external_view_embedder_.get();
}

} // namespace testing
} // namespace flutter
2 changes: 0 additions & 2 deletions shell/common/shell_test_platform_view_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class ShellTestPlatformViewVulkan : public ShellTestPlatformView {
// |Surface|
GrDirectContext* GetContext() override;

flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;

private:
bool valid_;
fml::RefPtr<vulkan::VulkanProcTable> vk_;
Expand Down
4 changes: 0 additions & 4 deletions shell/gpu/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ gpu_common_deps = [

source_set("gpu_surface_software") {
sources = [
"gpu_surface_delegate.h",
"gpu_surface_software.cc",
"gpu_surface_software.h",
"gpu_surface_software_delegate.cc",
Expand All @@ -28,7 +27,6 @@ source_set("gpu_surface_software") {

source_set("gpu_surface_gl") {
sources = [
"gpu_surface_delegate.h",
"gpu_surface_gl.cc",
"gpu_surface_gl.h",
"gpu_surface_gl_delegate.cc",
Expand All @@ -40,7 +38,6 @@ source_set("gpu_surface_gl") {

source_set("gpu_surface_vulkan") {
sources = [
"gpu_surface_delegate.h",
"gpu_surface_vulkan.cc",
"gpu_surface_vulkan.h",
"gpu_surface_vulkan_delegate.cc",
Expand All @@ -52,7 +49,6 @@ source_set("gpu_surface_vulkan") {

source_set("gpu_surface_metal") {
sources = [
"gpu_surface_delegate.h",
"gpu_surface_metal.h",
"gpu_surface_metal.mm",
]
Expand Down
28 changes: 0 additions & 28 deletions shell/gpu/gpu_surface_delegate.h

This file was deleted.

5 changes: 0 additions & 5 deletions shell/gpu/gpu_surface_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,6 @@ GrDirectContext* GPUSurfaceGL::GetContext() {
return context_.get();
}

// |Surface|
flutter::ExternalViewEmbedder* GPUSurfaceGL::GetExternalViewEmbedder() {
return delegate_->GetExternalViewEmbedder();
}

// |Surface|
std::unique_ptr<GLContextResult> GPUSurfaceGL::MakeRenderContextCurrent() {
return delegate_->GLContextMakeCurrent();
Expand Down
3 changes: 0 additions & 3 deletions shell/gpu/gpu_surface_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ class GPUSurfaceGL : public Surface {
// |Surface|
GrDirectContext* GetContext() override;

// |Surface|
flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;

// |Surface|
std::unique_ptr<GLContextResult> MakeRenderContextCurrent() override;

Expand Down
4 changes: 0 additions & 4 deletions shell/gpu/gpu_surface_gl_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,4 @@ GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface() {
return CreateGLInterface(nullptr);
}

ExternalViewEmbedder* GPUSurfaceGLDelegate::GetExternalViewEmbedder() {
return nullptr;
}

} // namespace flutter
8 changes: 2 additions & 6 deletions shell/gpu/gpu_surface_gl_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "flutter/common/graphics/gl_context_switch.h"
#include "flutter/flow/embedded_views.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_delegate.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"

Expand All @@ -21,12 +20,9 @@ struct GLFrameInfo {
uint32_t height;
};

class GPUSurfaceGLDelegate : public GPUSurfaceDelegate {
class GPUSurfaceGLDelegate {
public:
~GPUSurfaceGLDelegate() override;

// |GPUSurfaceDelegate|
ExternalViewEmbedder* GetExternalViewEmbedder() override;
~GPUSurfaceGLDelegate();

// Called to make the main GL context current on the current thread.
virtual std::unique_ptr<GLContextResult> GLContextMakeCurrent() = 0;
Expand Down
10 changes: 2 additions & 8 deletions shell/gpu/gpu_surface_metal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "flutter/flow/surface.h"
#include "flutter/fml/macros.h"
#include "flutter/fml/platform/darwin/scoped_nsobject.h"
#include "flutter/shell/gpu/gpu_surface_delegate.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"
#include "third_party/skia/include/gpu/mtl/GrMtlTypes.h"

Expand All @@ -20,16 +19,14 @@ namespace flutter {

class SK_API_AVAILABLE_CA_METAL_LAYER GPUSurfaceMetal : public Surface {
public:
GPUSurfaceMetal(GPUSurfaceDelegate* delegate,
fml::scoped_nsobject<CAMetalLayer> layer,
GPUSurfaceMetal(fml::scoped_nsobject<CAMetalLayer> layer,
sk_sp<GrDirectContext> context,
fml::scoped_nsprotocol<id<MTLCommandQueue>> command_queue);

// |Surface|
~GPUSurfaceMetal() override;
~GPUSurfaceMetal();

private:
GPUSurfaceDelegate* delegate_;
fml::scoped_nsobject<CAMetalLayer> layer_;
sk_sp<GrDirectContext> context_;
fml::scoped_nsprotocol<id<MTLCommandQueue>> command_queue_;
Expand All @@ -47,9 +44,6 @@ class SK_API_AVAILABLE_CA_METAL_LAYER GPUSurfaceMetal : public Surface {
// |Surface|
GrDirectContext* GetContext() override;

// |Surface|
flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;

// |Surface|
std::unique_ptr<GLContextResult> MakeRenderContextCurrent() override;

Expand Down
11 changes: 2 additions & 9 deletions shell/gpu/gpu_surface_metal.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@

namespace flutter {

GPUSurfaceMetal::GPUSurfaceMetal(GPUSurfaceDelegate* delegate,
fml::scoped_nsobject<CAMetalLayer> layer,
GPUSurfaceMetal::GPUSurfaceMetal(fml::scoped_nsobject<CAMetalLayer> layer,
sk_sp<GrDirectContext> context,
fml::scoped_nsprotocol<id<MTLCommandQueue>> command_queue)
: delegate_(delegate),
layer_(std::move(layer)),
: layer_(std::move(layer)),
context_(std::move(context)),
command_queue_(std::move(command_queue)) {
layer_.get().pixelFormat = MTLPixelFormatBGRA8Unorm;
Expand Down Expand Up @@ -121,11 +119,6 @@
return context_.get();
}

// |Surface|
flutter::ExternalViewEmbedder* GPUSurfaceMetal::GetExternalViewEmbedder() {
return delegate_->GetExternalViewEmbedder();
}

// |Surface|
std::unique_ptr<GLContextResult> GPUSurfaceMetal::MakeRenderContextCurrent() {
// This backend has no such concept.
Expand Down
5 changes: 0 additions & 5 deletions shell/gpu/gpu_surface_software.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,4 @@ GrDirectContext* GPUSurfaceSoftware::GetContext() {
return nullptr;
}

// |Surface|
flutter::ExternalViewEmbedder* GPUSurfaceSoftware::GetExternalViewEmbedder() {
return delegate_->GetExternalViewEmbedder();
}

} // namespace flutter
3 changes: 0 additions & 3 deletions shell/gpu/gpu_surface_software.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ class GPUSurfaceSoftware : public Surface {
// |Surface|
GrDirectContext* GetContext() override;

// |Surface|
flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;

private:
GPUSurfaceSoftwareDelegate* delegate_;
// TODO(38466): Refactor GPU surface APIs take into account the fact that an
Expand Down
4 changes: 0 additions & 4 deletions shell/gpu/gpu_surface_software_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ namespace flutter {

GPUSurfaceSoftwareDelegate::~GPUSurfaceSoftwareDelegate() = default;

ExternalViewEmbedder* GPUSurfaceSoftwareDelegate::GetExternalViewEmbedder() {
return nullptr;
}

} // namespace flutter
8 changes: 2 additions & 6 deletions shell/gpu/gpu_surface_software_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "flutter/flow/embedded_views.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_delegate.h"
#include "third_party/skia/include/core/SkSurface.h"

namespace flutter {
Expand All @@ -25,12 +24,9 @@ namespace flutter {
/// @see |IOSurfaceSoftware|, |AndroidSurfaceSoftware|,
/// |EmbedderSurfaceSoftware|.
///
class GPUSurfaceSoftwareDelegate : public GPUSurfaceDelegate {
class GPUSurfaceSoftwareDelegate {
public:
~GPUSurfaceSoftwareDelegate() override;

// |GPUSurfaceDelegate|
ExternalViewEmbedder* GetExternalViewEmbedder() override;
~GPUSurfaceSoftwareDelegate();

//----------------------------------------------------------------------------
/// @brief Called when the GPU surface needs a new buffer to render a new
Expand Down
5 changes: 0 additions & 5 deletions shell/gpu/gpu_surface_vulkan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ GPUSurfaceVulkan::GPUSurfaceVulkan(
std::unique_ptr<vulkan::VulkanNativeSurface> native_surface,
bool render_to_surface)
: window_(delegate->vk(), std::move(native_surface), render_to_surface),
delegate_(delegate),
render_to_surface_(render_to_surface),
weak_factory_(this) {}

Expand Down Expand Up @@ -67,8 +66,4 @@ GrDirectContext* GPUSurfaceVulkan::GetContext() {
return window_.GetSkiaGrContext();
}

flutter::ExternalViewEmbedder* GPUSurfaceVulkan::GetExternalViewEmbedder() {
return delegate_->GetExternalViewEmbedder();
}

} // namespace flutter
4 changes: 0 additions & 4 deletions shell/gpu/gpu_surface_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ class GPUSurfaceVulkan : public Surface {
// |Surface|
GrDirectContext* GetContext() override;

// |Surface|
flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;

private:
vulkan::VulkanWindow window_;
GPUSurfaceVulkanDelegate* delegate_;
const bool render_to_surface_;

fml::WeakPtrFactory<GPUSurfaceVulkan> weak_factory_;
Expand Down
4 changes: 0 additions & 4 deletions shell/gpu/gpu_surface_vulkan_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ namespace flutter {

GPUSurfaceVulkanDelegate::~GPUSurfaceVulkanDelegate() = default;

ExternalViewEmbedder* GPUSurfaceVulkanDelegate::GetExternalViewEmbedder() {
return nullptr;
}

} // namespace flutter
8 changes: 2 additions & 6 deletions shell/gpu/gpu_surface_vulkan_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
#define FLUTTER_SHELL_GPU_GPU_SURFACE_VULKAN_DELEGATE_H_

#include "flutter/fml/memory/ref_ptr.h"
#include "flutter/shell/gpu/gpu_surface_delegate.h"
#include "flutter/vulkan/vulkan_proc_table.h"

namespace flutter {

class GPUSurfaceVulkanDelegate : public GPUSurfaceDelegate {
class GPUSurfaceVulkanDelegate {
public:
~GPUSurfaceVulkanDelegate() override;

// |GPUSurfaceDelegate|
ExternalViewEmbedder* GetExternalViewEmbedder() override;
~GPUSurfaceVulkanDelegate();

// Obtain a reference to the Vulkan implementation's proc table.
virtual fml::RefPtr<vulkan::VulkanProcTable> vk() = 0;
Expand Down
5 changes: 0 additions & 5 deletions shell/platform/android/android_surface_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ intptr_t AndroidSurfaceGL::GLContextFBO(GLFrameInfo frame_info) const {
return 0;
}

// |GPUSurfaceGLDelegate|
ExternalViewEmbedder* AndroidSurfaceGL::GetExternalViewEmbedder() {
return external_view_embedder_.get();
}

// |GPUSurfaceGLDelegate|
sk_sp<const GrGLInterface> AndroidSurfaceGL::GetGLInterface() const {
// This is a workaround for a bug in the Android emulator EGL/GLES
Expand Down
3 changes: 0 additions & 3 deletions shell/platform/android/android_surface_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ class AndroidSurfaceGL final : public GPUSurfaceGLDelegate,
// |GPUSurfaceGLDelegate|
intptr_t GLContextFBO(GLFrameInfo frame_info) const override;

// |GPUSurfaceGLDelegate|
ExternalViewEmbedder* GetExternalViewEmbedder() override;

// |GPUSurfaceGLDelegate|
sk_sp<const GrGLInterface> GetGLInterface() const override;

Expand Down
5 changes: 0 additions & 5 deletions shell/platform/android/android_surface_software.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ bool AndroidSurfaceSoftware::PresentBackingStore(
return true;
}

// |GPUSurfaceSoftwareDelegate|
ExternalViewEmbedder* AndroidSurfaceSoftware::GetExternalViewEmbedder() {
return external_view_embedder_.get();
}

void AndroidSurfaceSoftware::TeardownOnScreenContext() {}

bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) {
Expand Down
Loading