From 47953178411d8992b462ec30257cfecb1d6bac4f Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 11 Oct 2016 11:55:23 -0700 Subject: [PATCH] Remove obsolete PlatformView::Resize and GetSize methods (flutter/engine#3112) --- engine/src/flutter/shell/common/platform_view.cc | 8 -------- engine/src/flutter/shell/common/platform_view.h | 4 ---- .../shell/platform/android/platform_view_android.cc | 13 ++----------- .../shell/platform/android/platform_view_android.h | 4 ---- 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/engine/src/flutter/shell/common/platform_view.cc b/engine/src/flutter/shell/common/platform_view.cc index 152af5756d..e5ee631be8 100644 --- a/engine/src/flutter/shell/common/platform_view.cc +++ b/engine/src/flutter/shell/common/platform_view.cc @@ -114,14 +114,6 @@ ftl::WeakPtr PlatformView::GetWeakPtr() { return weak_factory_.GetWeakPtr(); } -SkISize PlatformView::GetSize() { - return size_; -} - -void PlatformView::Resize(const SkISize& size) { - size_ = size; -} - void PlatformView::UpdateSemantics(std::vector update) {} void PlatformView::SetupResourceContextOnIOThread() { diff --git a/engine/src/flutter/shell/common/platform_view.h b/engine/src/flutter/shell/common/platform_view.h index 3aa28797a9..76dd7a2237 100644 --- a/engine/src/flutter/shell/common/platform_view.h +++ b/engine/src/flutter/shell/common/platform_view.h @@ -52,10 +52,6 @@ class PlatformView { virtual bool ResourceContextMakeCurrent() = 0; - virtual SkISize GetSize(); - - virtual void Resize(const SkISize& size); - virtual void UpdateSemantics(std::vector update); Rasterizer& rasterizer() { return *rasterizer_; } diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.cc b/engine/src/flutter/shell/platform/android/platform_view_android.cc index 30d6048ef8..095eb45aec 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.cc +++ b/engine/src/flutter/shell/platform/android/platform_view_android.cc @@ -72,7 +72,8 @@ void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, auto gl_surface = std::make_unique(surface_gl_.get()); NotifyCreated(std::move(gl_surface), [this, backgroundColor] { - rasterizer().Clear(backgroundColor, GetSize()); + if (surface_gl_) + rasterizer().Clear(backgroundColor, surface_gl_->OnScreenSurfaceSize()); }); SetupResourceContextOnIOThread(); @@ -194,16 +195,6 @@ bool PlatformViewAndroid::ResourceContextMakeCurrent() { return surface_gl_ ? surface_gl_->GLOffscreenContextMakeCurrent() : false; } -SkISize PlatformViewAndroid::GetSize() { - return surface_gl_ ? surface_gl_->OnScreenSurfaceSize() : SkISize::Make(0, 0); -} - -void PlatformViewAndroid::Resize(const SkISize& size) { - if (surface_gl_) { - surface_gl_->OnScreenSurfaceResize(size); - } -} - void PlatformViewAndroid::UpdateSemantics( std::vector update) { constexpr size_t kBytesPerNode = 25 * sizeof(int32_t); diff --git a/engine/src/flutter/shell/platform/android/platform_view_android.h b/engine/src/flutter/shell/platform/android/platform_view_android.h index 3a04f2ce09..66c0b1d31f 100644 --- a/engine/src/flutter/shell/platform/android/platform_view_android.h +++ b/engine/src/flutter/shell/platform/android/platform_view_android.h @@ -53,10 +53,6 @@ class PlatformViewAndroid : public PlatformView { bool ResourceContextMakeCurrent() override; - SkISize GetSize() override; - - void Resize(const SkISize& size) override; - void UpdateSemantics(std::vector update) override; void RunFromSource(const std::string& main,