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
4 changes: 0 additions & 4 deletions shell/platform/android/android_shell_holder_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class MockPlatformViewAndroidJNI : public PlatformViewAndroidJNI {
SurfaceTextureAttachToGLContext,
(JavaLocalRef surface_texture, int textureId),
(override));
MOCK_METHOD(bool,
SurfaceTextureShouldUpdate,
(JavaLocalRef surface_texture),
(override));
MOCK_METHOD(void,
SurfaceTextureUpdateTexImage,
(JavaLocalRef surface_texture),
Expand Down
6 changes: 4 additions & 2 deletions shell/platform/android/image_external_texture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ void ImageExternalTexture::Paint(PaintContext& context,
return;
}
Attach(context);
const bool should_process_frame = !freeze;
const bool should_process_frame =
(!freeze && new_frame_ready_) || dl_image_ == nullptr;
if (should_process_frame) {
ProcessFrame(context, bounds);
new_frame_ready_ = false;
}
if (dl_image_) {
context.canvas->DrawImageRect(
Expand All @@ -46,7 +48,7 @@ void ImageExternalTexture::Paint(PaintContext& context,

// Implementing flutter::Texture.
void ImageExternalTexture::MarkNewFrameAvailable() {
// NOOP.
new_frame_ready_ = true;
}

// Implementing flutter::Texture.
Expand Down
1 change: 1 addition & 0 deletions shell/platform/android/image_external_texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ImageExternalTexture : public flutter::Texture {

enum class AttachmentState { kUninitialized, kAttached, kDetached };
AttachmentState state_ = AttachmentState::kUninitialized;
bool new_frame_ready_ = false;

sk_sp<flutter::DlImage> dl_image_;

Expand Down
10 changes: 0 additions & 10 deletions shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -951,16 +951,6 @@ public void markTextureFrameAvailable(long textureId) {

private native void nativeMarkTextureFrameAvailable(long nativeShellHolderId, long textureId);

/** Schedule the engine to draw a frame but does not invalidate the layout tree. */
@UiThread
public void scheduleFrame() {
ensureRunningOnMainThread();
ensureAttachedToNative();
nativeScheduleFrame(nativeShellHolderId);
}

private native void nativeScheduleFrame(long nativeShellHolderId);

/**
* Unregisters a texture that was registered with {@link #registerTexture(long,
* SurfaceTextureWrapper)}.
Expand Down
Loading