Skip to content

Commit

Permalink
Revert "[Impeller] Support for rendering Android Platform Views into …
Browse files Browse the repository at this point in the history
…a HardwareBuffer backed texture." (flutter#44262)

Reverts flutter#44087

Reverting for flutter/flutter#131772
  • Loading branch information
zanderso authored and gaaclarke committed Aug 30, 2023
1 parent 29922a8 commit 16419f4
Show file tree
Hide file tree
Showing 36 changed files with 51 additions and 1,154 deletions.
17 changes: 0 additions & 17 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1686,11 +1686,8 @@ ORIGIN: ../../../flutter/impeller/toolkit/egl/display.cc + ../../../flutter/LICE
ORIGIN: ../../../flutter/impeller/toolkit/egl/display.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/egl/egl.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/egl/egl.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/egl/image.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/egl/surface.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/egl/surface.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/gles/gles.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/toolkit/gles/texture.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/typographer/backends/skia/text_frame_skia.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/typographer/backends/skia/text_frame_skia.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/impeller/typographer/backends/skia/text_render_context_skia.cc + ../../../flutter/LICENSE
Expand Down Expand Up @@ -2325,8 +2322,6 @@ ORIGIN: ../../../flutter/shell/platform/android/external_view_embedder/surface_p
ORIGIN: ../../../flutter/shell/platform/android/external_view_embedder/surface_pool.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/flutter_main.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/flutter_main.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/io/flutter/FlutterInjector.java + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/io/flutter/Log.java + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivity.java + ../../../flutter/LICENSE
Expand Down Expand Up @@ -2468,8 +2463,6 @@ ORIGIN: ../../../flutter/shell/platform/android/jni/jni_mock.h + ../../../flutte
ORIGIN: ../../../flutter/shell/platform/android/jni/platform_view_android_jni.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/jni/platform_view_android_jni.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/library_loader.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/ndk_helpers.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/ndk_helpers.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/platform_message_handler_android.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/platform_message_response_android.cc + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/android/platform_message_response_android.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -4389,13 +4382,8 @@ FILE: ../../../flutter/impeller/toolkit/egl/display.cc
FILE: ../../../flutter/impeller/toolkit/egl/display.h
FILE: ../../../flutter/impeller/toolkit/egl/egl.cc
FILE: ../../../flutter/impeller/toolkit/egl/egl.h
FILE: ../../../flutter/impeller/toolkit/egl/image.cc
FILE: ../../../flutter/impeller/toolkit/egl/image.h
FILE: ../../../flutter/impeller/toolkit/egl/surface.cc
FILE: ../../../flutter/impeller/toolkit/egl/surface.h
FILE: ../../../flutter/impeller/toolkit/gles/gles.h
FILE: ../../../flutter/impeller/toolkit/gles/texture.cc
FILE: ../../../flutter/impeller/toolkit/gles/texture.h
FILE: ../../../flutter/impeller/tools/malioc.json
FILE: ../../../flutter/impeller/typographer/backends/skia/text_frame_skia.cc
FILE: ../../../flutter/impeller/typographer/backends/skia/text_frame_skia.h
Expand Down Expand Up @@ -5032,8 +5020,6 @@ FILE: ../../../flutter/shell/platform/android/external_view_embedder/surface_poo
FILE: ../../../flutter/shell/platform/android/external_view_embedder/surface_pool.h
FILE: ../../../flutter/shell/platform/android/flutter_main.cc
FILE: ../../../flutter/shell/platform/android/flutter_main.h
FILE: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.cc
FILE: ../../../flutter/shell/platform/android/hardware_buffer_external_texture_gl.h
FILE: ../../../flutter/shell/platform/android/io/flutter/FlutterInjector.java
FILE: ../../../flutter/shell/platform/android/io/flutter/Log.java
FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivity.java
Expand Down Expand Up @@ -5151,7 +5137,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/editing/TextInpu
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/localization/LocalizationPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/mouse/MouseCursorPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/AccessibilityEventsDelegate.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/ImageReaderPlatformViewRenderTarget.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformOverlayView.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformView.java
Expand Down Expand Up @@ -5184,8 +5169,6 @@ FILE: ../../../flutter/shell/platform/android/jni/jni_mock.h
FILE: ../../../flutter/shell/platform/android/jni/platform_view_android_jni.cc
FILE: ../../../flutter/shell/platform/android/jni/platform_view_android_jni.h
FILE: ../../../flutter/shell/platform/android/library_loader.cc
FILE: ../../../flutter/shell/platform/android/ndk_helpers.cc
FILE: ../../../flutter/shell/platform/android/ndk_helpers.h
FILE: ../../../flutter/shell/platform/android/platform_message_handler_android.cc
FILE: ../../../flutter/shell/platform/android/platform_message_handler_android.h
FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc
Expand Down
2 changes: 0 additions & 2 deletions impeller/toolkit/egl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ impeller_component("egl") {
"display.h",
"egl.cc",
"egl.h",
"image.cc",
"image.h",
"surface.cc",
"surface.h",
]
Expand Down
2 changes: 0 additions & 2 deletions impeller/toolkit/egl/egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#pragma once

#include <EGL/egl.h>
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/eglext.h>

#include <functional>

Expand Down
3 changes: 0 additions & 3 deletions impeller/toolkit/egl/image.cc

This file was deleted.

74 changes: 0 additions & 74 deletions impeller/toolkit/egl/image.h

This file was deleted.

20 changes: 0 additions & 20 deletions impeller/toolkit/gles/BUILD.gn

This file was deleted.

9 changes: 0 additions & 9 deletions impeller/toolkit/gles/gles.h

This file was deleted.

3 changes: 0 additions & 3 deletions impeller/toolkit/gles/texture.cc

This file was deleted.

39 changes: 0 additions & 39 deletions impeller/toolkit/gles/texture.h

This file was deleted.

6 changes: 0 additions & 6 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ source_set("flutter_shell_native_src") {
"apk_asset_provider.h",
"flutter_main.cc",
"flutter_main.h",
"hardware_buffer_external_texture_gl.cc",
"hardware_buffer_external_texture_gl.h",
"library_loader.cc",
"ndk_helpers.cc",
"ndk_helpers.h",
"platform_message_handler_android.cc",
"platform_message_handler_android.h",
"platform_message_response_android.cc",
Expand All @@ -126,7 +122,6 @@ source_set("flutter_shell_native_src") {
"//flutter/fml",
"//flutter/impeller",
"//flutter/impeller/toolkit/egl",
"//flutter/impeller/toolkit/gles",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/runtime:libdart",
Expand Down Expand Up @@ -292,7 +287,6 @@ android_java_sources = [
"io/flutter/plugin/localization/LocalizationPlugin.java",
"io/flutter/plugin/mouse/MouseCursorPlugin.java",
"io/flutter/plugin/platform/AccessibilityEventsDelegate.java",
"io/flutter/plugin/platform/ImageReaderPlatformViewRenderTarget.java",
"io/flutter/plugin/platform/PlatformOverlayView.java",
"io/flutter/plugin/platform/PlatformPlugin.java",
"io/flutter/plugin/platform/PlatformView.java",
Expand Down
8 changes: 0 additions & 8 deletions shell/platform/android/android_context_gl_skia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ bool AndroidContextGLSkia::ClearCurrent() const {
return true;
}

EGLContext AndroidContextGLSkia::GetEGLContext() const {
return context_;
}

EGLDisplay AndroidContextGLSkia::GetEGLDisplay() const {
return environment_->Display();
}

EGLContext AndroidContextGLSkia::CreateNewContext() const {
bool success;
EGLContext context;
Expand Down
14 changes: 0 additions & 14 deletions shell/platform/android/android_context_gl_skia.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,6 @@ class AndroidContextGLSkia : public AndroidContext {
///
bool ClearCurrent() const;

//----------------------------------------------------------------------------
/// @brief Returns the EGLContext.
///
/// @return EGLContext.
///
EGLContext GetEGLContext() const;

//----------------------------------------------------------------------------
/// @brief Returns the EGLDisplay.
///
/// @return EGLDisplay.
///
EGLDisplay GetEGLDisplay() const;

//----------------------------------------------------------------------------
/// @brief Create a new EGLContext using the same EGLConfig.
///
Expand Down
14 changes: 7 additions & 7 deletions shell/platform/android/android_external_texture_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ AndroidExternalTextureGL::AndroidExternalTextureGL(
transform(SkMatrix::I()) {}

AndroidExternalTextureGL::~AndroidExternalTextureGL() {
if (state_ == AttachmentState::kAttached) {
if (state_ == AttachmentState::attached) {
glDeleteTextures(1, &texture_name_);
}
}

void AndroidExternalTextureGL::OnGrContextCreated() {
state_ = AttachmentState::kUninitialized;
state_ = AttachmentState::uninitialized;
}

void AndroidExternalTextureGL::MarkNewFrameAvailable() {
Expand All @@ -46,13 +46,13 @@ void AndroidExternalTextureGL::Paint(PaintContext& context,
const SkRect& bounds,
bool freeze,
const DlImageSampling sampling) {
if (state_ == AttachmentState::kDetached) {
if (state_ == AttachmentState::detached) {
return;
}
if (state_ == AttachmentState::kUninitialized) {
if (state_ == AttachmentState::uninitialized) {
glGenTextures(1, &texture_name_);
Attach(static_cast<jint>(texture_name_));
state_ = AttachmentState::kAttached;
state_ = AttachmentState::attached;
}
if (!freeze && new_frame_ready_) {
Update();
Expand Down Expand Up @@ -108,11 +108,11 @@ void AndroidExternalTextureGL::UpdateTransform() {
}

void AndroidExternalTextureGL::OnGrContextDestroyed() {
if (state_ == AttachmentState::kAttached) {
if (state_ == AttachmentState::attached) {
Detach();
glDeleteTextures(1, &texture_name_);
}
state_ = AttachmentState::kDetached;
state_ = AttachmentState::detached;
}

void AndroidExternalTextureGL::Attach(jint textureName) {
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/android_external_texture_gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class AndroidExternalTextureGL : public flutter::Texture {

void UpdateTransform();

enum class AttachmentState { kUninitialized, kAttached, kDetached };
enum class AttachmentState { uninitialized, attached, detached };

std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;

fml::jni::ScopedJavaGlobalRef<jobject> surface_texture_;

AttachmentState state_ = AttachmentState::kUninitialized;
AttachmentState state_ = AttachmentState::uninitialized;

bool new_frame_ready_ = false;

Expand Down
6 changes: 0 additions & 6 deletions shell/platform/android/android_shell_holder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "flutter/shell/platform/android/android_shell_holder.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "shell/platform/android/jni/platform_view_android_jni.h"

namespace flutter {
namespace testing {
Expand Down Expand Up @@ -31,11 +30,6 @@ class MockPlatformViewAndroidJNI : public PlatformViewAndroidJNI {
void(JavaLocalRef surface_texture, SkMatrix& transform));
MOCK_METHOD1(SurfaceTextureDetachFromGLContext,
void(JavaLocalRef surface_texture));
MOCK_METHOD1(ImageTextureEntryAcquireLatestImage,
JavaLocalRef(JavaLocalRef image_texture_entry));
MOCK_METHOD1(ImageGetHardwareBuffer, JavaLocalRef(JavaLocalRef image));
MOCK_METHOD1(ImageClose, void(JavaLocalRef image));
MOCK_METHOD1(HardwareBufferClose, void(JavaLocalRef hardware_buffer));
MOCK_METHOD8(FlutterViewOnDisplayPlatformView,
void(int view_id,
int x,
Expand Down
Loading

0 comments on commit 16419f4

Please sign in to comment.