Skip to content

Commit 76aeb9e

Browse files
committed
[android] Release fences and OpenGL ES intake for pushHardwareBuffer
Builds on "[android] F16/EDR compositing + direct-AHardwareBuffer producer path", which added ImageTextureEntry.pushHardwareBuffer. It also adds a surface dynamic range API. This commit is four independent changes that upstream as separate pull requests; the split is described at the end. 1. fml: copying a null JNI reference no longer needs a JVM --------------------------------------------------------- SetNewLocalRef / SetNewGlobalRef return early when both the new and the old object are null, instead of attaching the thread to the JVM first. Besides avoiding a pointless attach, this lets native unit tests (which have no JVM) construct objects that hold an empty Java reference. 2. Impeller: color transform for external (OES) textures -------------------------------------------------------- tiled_texture_fill_external.frag gains the gamut matrix and sRGB encode that texture_fill.frag already applies, so an F16 linear Display P3 external texture (an AHardwareBuffer bound through OpenGL ES) is converted to the sRGB target instead of drawing too dark. The transform is factored into a public GetTextureColorTransform(ColorSpace) shared by TextureContents and TiledTextureContents (whose external path previously used an identity). 3. Android: OpenGL ES intake and release fences for pushHardwareBuffer ----------------------------------------------------------------------- Flutter renders with OpenGL ES in the emulator and on devices Impeller's Vulkan backend rejects. ImageExternalTextureGL only read the Image slot, which pushHardwareBuffer leaves empty, so such producers drew nothing. It now takes pushed buffers like the Vulkan texture: the buffer's size, F16 format and color space describe the texture, and the producer's acquire fence is waited on by the GPU (EGL_ANDROID_native_fence_sync + eglWaitSyncKHR), not the CPU. The eventfd "release-ack" is replaced by release fences: - ImageTextureEntry.setOnHardwareBufferReleasedListener / OnHardwareBufferReleasedListener.onHardwareBufferReleased(ahbPtr, fenceFd) report every push exactly once. A push that was never drawn is released at once, on the superseding thread, with fence -1. A drawn buffer is released when a later frame replaces it, after that frame has been submitted (a task posted to the raster task runner), behind a sync fence covering every draw of it, including more than one paint in a frame. - OpenGL ES: an EGL native fence; Vulkan: an exportable SYNC_FD semaphore signalled by a submission on the graphics queue, which also hands the image back to VK_QUEUE_FAMILY_FOREIGN_EXT (intake now acquires it from there). When a device can't export a fence, the release waits without blocking: the raster thread polls an EGL fence / VkFence and releases with -1. - No fences or callbacks for buffers pushed while no listener is set. - Vulkan release objects are tracked by the texture's fence maker and waited for at teardown (they no longer go through FenceWaiterVK, whose AddFence destroys a pending fence once the waiter is terminating). - The releaseAckFd overloads are removed; pushHardwareBuffer(long, int, int) now takes a @ColorSpace. Listener exceptions are caught; the finalizer never calls the listener. 4. Android: surface dynamic range API ------------------------------------- FlutterRenderer.isSurfaceExtendedRange() and add/removeSurfaceDynamicRangeListener(FlutterSurfaceDynamicRangeListener) report whether the onscreen surface stores extended-range (F16) color: true for an F16 Vulkan swapchain, false for OpenGL ES, the RGBA8 Vulkan fallback, and no surface. Apps use it to stop requesting HDR headroom an SDR surface would clip. PlatformViewAndroid reports it after the surface is created or changed (AndroidSurface::IsExtendedRange) and reports false when destroyed. Tests ----- - FlutterRendererTest / FlutterJNITest: release listener contract (superseded, released, after-release pushes, color space, wantsRelease, throwing listener) and dynamic-range state and listeners. - image_external_texture_unittests.cc: release bookkeeping on a raster thread with a fake fence maker (after-frame release, several buffers in one frame, re-pushed buffer, no listener, unexportable fence, lifecycles). - image_external_texture_gpu_unittests.cc (device): the OpenGL ES fence maker against a real EGL context, and a Vulkan texture painted with two real AHardwareBuffers releasing the first behind a fence that signals. - texture_contents_unittests.cc: GetTextureColorTransform for each color space. Splitting for upstream ---------------------- 1. fml/platform/android/scoped_java_ref.cc 2. impeller/entity/** (texture_contents.{h,cc}, texture_contents_unittests.cc, tiled_texture_contents.cc, shaders/tiled_texture_fill_external.frag, BUILD.gn) 3. shell/platform/android/image_external_texture*.{h,cc} (incl. both new unittest files), io/flutter/view/TextureRegistry.java, the ImageTextureRegistryEntry part of FlutterRenderer.java, the releaseHardwareBuffer part of FlutterJNI.java, FlutterRendererTest.java (release-listener tests) 4. android_surface*.{h,cc}, surface/android_surface.{h,cc}, platform_view_android.{h,cc}, FlutterSurfaceDynamicRangeListener.java, the dynamic-range parts of FlutterRenderer.java, FlutterJNI.java and their tests Shared by 3 and 4, split by hunk: jni/platform_view_android_jni.h, platform_view_android_jni_impl.{h,cc}, jni/jni_mock.h, android_shell_holder_unittests.cc, shell/platform/android/BUILD.gn. Parts 3 and 4 depend on 1 only through the native unit tests; 3 depends on 2 for correct color on OpenGL ES. The formatting-only hunks in code from the base commit (TextureRegistry/FlutterJNI Javadoc, platform_view_android_jni_impl.cc, texture_contents.cc) belong with that commit.
1 parent c202364 commit 76aeb9e

39 files changed

Lines changed: 2331 additions & 553 deletions

‎engine/src/flutter/fml/platform/android/scoped_java_ref.cc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ JavaRef<jobject>::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) {
3939
JavaRef<jobject>::~JavaRef() = default;
4040

4141
JNIEnv* JavaRef<jobject>::SetNewLocalRef(JNIEnv* env, jobject obj) {
42+
if (!obj && !obj_) {
43+
// Null to null: nothing to create or delete, so no need for a JVM.
44+
return env;
45+
}
4246
if (!env) {
4347
env = AttachCurrentThread();
4448
} else {
@@ -55,6 +59,10 @@ JNIEnv* JavaRef<jobject>::SetNewLocalRef(JNIEnv* env, jobject obj) {
5559
}
5660

5761
void JavaRef<jobject>::SetNewGlobalRef(JNIEnv* env, jobject obj) {
62+
if (!obj && !obj_) {
63+
// Null to null: nothing to create or delete, so no need for a JVM.
64+
return;
65+
}
5866
if (!env) {
5967
env = AttachCurrentThread();
6068
} else {

‎engine/src/flutter/impeller/entity/BUILD.gn‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ impeller_component("entity_unittests") {
285285
"contents/host_buffer_unittests.cc",
286286
"contents/line_contents_unittests.cc",
287287
"contents/text_contents_unittests.cc",
288+
"contents/texture_contents_unittests.cc",
288289
"contents/tiled_texture_contents_unittests.cc",
289290
"draw_order_resolver_unittests.cc",
290291
"entity_pass_target_unittests.cc",

‎engine/src/flutter/impeller/entity/contents/texture_contents.cc‎

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -103,32 +103,21 @@ std::optional<Snapshot> TextureContents::RenderToSnapshot(
103103
.coverage_expansion = options.coverage_expansion});
104104
}
105105

106-
// Computes the gamut conversion matrix rows and whether gamma encoding is
107-
// needed for the given source color space targeting an sRGB gamma surface.
108-
//
109-
// Gamut: kLinearDisplayP3 / kDisplayP3 → P3→sRGB matrix
110-
// everything else → identity
111-
// Gamma: kLinearDisplayP3 / kLinearP3Native → encode (source is linear)
112-
// everything else → no encode (source is gamma)
113-
static void GetColorTransform(ColorSpace source,
114-
Vector3& row0,
115-
Vector3& row1,
116-
Vector3& row2,
117-
bool& needs_gamma_encode) {
106+
TextureColorTransform GetTextureColorTransform(ColorSpace source) {
118107
constexpr Vector3 kP3ToSRGBRow0 = {1.2249401f, -0.2249402f, 0.0f};
119108
constexpr Vector3 kP3ToSRGBRow1 = {-0.0420569f, 1.0420571f, 0.0f};
120109
constexpr Vector3 kP3ToSRGBRow2 = {-0.0196376f, -0.0786507f, 1.0982884f};
121-
constexpr Vector3 kIdentityRow0 = {1.0f, 0.0f, 0.0f};
122-
constexpr Vector3 kIdentityRow1 = {0.0f, 1.0f, 0.0f};
123-
constexpr Vector3 kIdentityRow2 = {0.0f, 0.0f, 1.0f};
124-
125-
const bool is_p3 = (source == ColorSpace::kLinearDisplayP3 ||
126-
source == ColorSpace::kDisplayP3);
127-
row0 = is_p3 ? kP3ToSRGBRow0 : kIdentityRow0;
128-
row1 = is_p3 ? kP3ToSRGBRow1 : kIdentityRow1;
129-
row2 = is_p3 ? kP3ToSRGBRow2 : kIdentityRow2;
130-
needs_gamma_encode = (source == ColorSpace::kLinearDisplayP3 ||
131-
source == ColorSpace::kLinearP3Native);
110+
111+
TextureColorTransform transform;
112+
if (source == ColorSpace::kLinearDisplayP3 ||
113+
source == ColorSpace::kDisplayP3) {
114+
transform.row0 = kP3ToSRGBRow0;
115+
transform.row1 = kP3ToSRGBRow1;
116+
transform.row2 = kP3ToSRGBRow2;
117+
}
118+
transform.gamma_encode = (source == ColorSpace::kLinearDisplayP3 ||
119+
source == ColorSpace::kLinearP3Native);
120+
return transform;
132121
}
133122

134123
bool TextureContents::Render(const ContentContext& renderer,
@@ -205,11 +194,8 @@ bool TextureContents::Render(const ContentContext& renderer,
205194
pass.SetVertexBuffer(vertex_buffer);
206195
VS::BindFrameInfo(pass, data_host_buffer.EmplaceUniform(frame_info));
207196

208-
// Compute the color transform (gamut conversion + gamma flag).
209-
Vector3 color_row0, color_row1, color_row2;
210-
bool needs_gamma_encode = false;
211-
GetColorTransform(texture_->GetTextureDescriptor().color_space,
212-
color_row0, color_row1, color_row2, needs_gamma_encode);
197+
const TextureColorTransform color_transform =
198+
GetTextureColorTransform(texture_->GetTextureDescriptor().color_space);
213199

214200
if (strict_source_rect_enabled_) {
215201
// For a strict source rect, shrink the texture coordinate range by half a
@@ -221,10 +207,10 @@ bool TextureContents::Render(const ContentContext& renderer,
221207
FSStrict::FragInfo frag_info;
222208
frag_info.source_rect = Vector4(strict_texture_coords.GetLTRB());
223209
frag_info.alpha = GetOpacity();
224-
frag_info.gamma_encode = needs_gamma_encode ? 1.0f : 0.0f;
225-
frag_info.color_row0 = color_row0;
226-
frag_info.color_row1 = color_row1;
227-
frag_info.color_row2 = color_row2;
210+
frag_info.gamma_encode = color_transform.gamma_encode ? 1.0f : 0.0f;
211+
frag_info.color_row0 = color_transform.row0;
212+
frag_info.color_row1 = color_transform.row1;
213+
frag_info.color_row2 = color_transform.row2;
228214
FSStrict::BindFragInfo(pass, data_host_buffer.EmplaceUniform((frag_info)));
229215
FSStrict::BindTextureSampler(
230216
pass, texture_,
@@ -238,6 +224,10 @@ bool TextureContents::Render(const ContentContext& renderer,
238224
frag_info.y_tile_mode =
239225
static_cast<Scalar>(sampler_descriptor_.height_address_mode);
240226
frag_info.alpha = GetOpacity();
227+
frag_info.gamma_encode = color_transform.gamma_encode ? 1.0f : 0.0f;
228+
frag_info.color_row0 = color_transform.row0;
229+
frag_info.color_row1 = color_transform.row1;
230+
frag_info.color_row2 = color_transform.row2;
241231
FSExternal::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
242232

243233
SamplerDescriptor sampler_desc;
@@ -257,10 +247,10 @@ bool TextureContents::Render(const ContentContext& renderer,
257247
} else {
258248
FS::FragInfo frag_info;
259249
frag_info.alpha = GetOpacity();
260-
frag_info.gamma_encode = needs_gamma_encode ? 1.0f : 0.0f;
261-
frag_info.color_row0 = color_row0;
262-
frag_info.color_row1 = color_row1;
263-
frag_info.color_row2 = color_row2;
250+
frag_info.gamma_encode = color_transform.gamma_encode ? 1.0f : 0.0f;
251+
frag_info.color_row0 = color_transform.row0;
252+
frag_info.color_row1 = color_transform.row1;
253+
frag_info.color_row2 = color_transform.row2;
264254
FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform((frag_info)));
265255
FS::BindTextureSampler(
266256
pass, texture_,

‎engine/src/flutter/impeller/entity/contents/texture_contents.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,27 @@
88
#include <memory>
99

1010
#include "impeller/core/sampler_descriptor.h"
11+
#include "impeller/core/texture_descriptor.h"
1112
#include "impeller/entity/contents/contents.h"
13+
#include "impeller/geometry/vector.h"
1214

1315
namespace impeller {
1416

17+
/// The gamut conversion and transfer encoding that a texture fill applies to
18+
/// draw a texture of a given color space onto an sRGB (gamma-encoded) target.
19+
struct TextureColorTransform {
20+
/// Rows of the 3x3 gamut conversion matrix; identity when none is needed.
21+
Vector3 row0 = {1.0f, 0.0f, 0.0f};
22+
Vector3 row1 = {0.0f, 1.0f, 0.0f};
23+
Vector3 row2 = {0.0f, 0.0f, 1.0f};
24+
/// Whether the source is linear and needs the sRGB transfer function.
25+
bool gamma_encode = false;
26+
};
27+
28+
/// Display P3 sources are converted to sRGB primaries; linear sources
29+
/// (kLinearDisplayP3, kLinearP3Native) are sRGB-encoded.
30+
TextureColorTransform GetTextureColorTransform(ColorSpace source);
31+
1532
class Texture;
1633

1734
/// Represents the contents of a texture to be rendered.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#include "flutter/impeller/geometry/geometry_asserts.h"
6+
#include "impeller/entity/contents/texture_contents.h"
7+
#include "third_party/googletest/googletest/include/gtest/gtest.h"
8+
9+
namespace impeller {
10+
namespace testing {
11+
12+
namespace {
13+
14+
constexpr Vector3 kIdentityRow0 = {1.0f, 0.0f, 0.0f};
15+
constexpr Vector3 kIdentityRow1 = {0.0f, 1.0f, 0.0f};
16+
constexpr Vector3 kIdentityRow2 = {0.0f, 0.0f, 1.0f};
17+
18+
// Applies the gamut rows of `transform` to `rgb`.
19+
Vector3 Convert(const TextureColorTransform& transform, Vector3 rgb) {
20+
return {transform.row0.Dot(rgb), transform.row1.Dot(rgb),
21+
transform.row2.Dot(rgb)};
22+
}
23+
24+
} // namespace
25+
26+
TEST(TextureColorTransformTest, SRGBIsDrawnAsIs) {
27+
const TextureColorTransform transform =
28+
GetTextureColorTransform(ColorSpace::kSRGB);
29+
EXPECT_VECTOR3_NEAR(transform.row0, kIdentityRow0);
30+
EXPECT_VECTOR3_NEAR(transform.row1, kIdentityRow1);
31+
EXPECT_VECTOR3_NEAR(transform.row2, kIdentityRow2);
32+
EXPECT_FALSE(transform.gamma_encode);
33+
}
34+
35+
TEST(TextureColorTransformTest, DisplayP3IsConvertedToSRGBPrimaries) {
36+
const TextureColorTransform transform =
37+
GetTextureColorTransform(ColorSpace::kDisplayP3);
38+
// Already gamma encoded.
39+
EXPECT_FALSE(transform.gamma_encode);
40+
// White stays white; pure P3 red lies outside sRGB.
41+
EXPECT_VECTOR3_NEAR(Convert(transform, {1.0f, 1.0f, 1.0f}),
42+
Vector3(1.0f, 1.0f, 1.0f));
43+
const Vector3 red = Convert(transform, {1.0f, 0.0f, 0.0f});
44+
EXPECT_GT(red.x, 1.0f);
45+
EXPECT_LT(red.y, 0.0f);
46+
}
47+
48+
TEST(TextureColorTransformTest, LinearDisplayP3IsConvertedAndEncoded) {
49+
const TextureColorTransform transform =
50+
GetTextureColorTransform(ColorSpace::kLinearDisplayP3);
51+
const TextureColorTransform gamma_p3 =
52+
GetTextureColorTransform(ColorSpace::kDisplayP3);
53+
EXPECT_TRUE(transform.gamma_encode);
54+
EXPECT_VECTOR3_NEAR(transform.row0, gamma_p3.row0);
55+
EXPECT_VECTOR3_NEAR(transform.row1, gamma_p3.row1);
56+
EXPECT_VECTOR3_NEAR(transform.row2, gamma_p3.row2);
57+
}
58+
59+
TEST(TextureColorTransformTest, LinearP3NativeIsOnlyEncoded) {
60+
const TextureColorTransform transform =
61+
GetTextureColorTransform(ColorSpace::kLinearP3Native);
62+
EXPECT_TRUE(transform.gamma_encode);
63+
EXPECT_VECTOR3_NEAR(transform.row0, kIdentityRow0);
64+
EXPECT_VECTOR3_NEAR(transform.row1, kIdentityRow1);
65+
EXPECT_VECTOR3_NEAR(transform.row2, kIdentityRow2);
66+
}
67+
68+
} // namespace testing
69+
} // namespace impeller

‎engine/src/flutter/impeller/entity/contents/tiled_texture_contents.cc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "fml/logging.h"
88
#include "impeller/core/formats.h"
99
#include "impeller/entity/contents/content_context.h"
10+
#include "impeller/entity/contents/texture_contents.h"
1011
#include "impeller/entity/tiled_texture_fill.frag.h"
1112
#include "impeller/entity/tiled_texture_fill_external.frag.h"
1213
#include "impeller/renderer/render_pass.h"
@@ -153,6 +154,13 @@ bool TiledTextureContents::Render(const ContentContext& renderer,
153154
frag_info.y_tile_mode =
154155
static_cast<Scalar>(sampler_descriptor_.height_address_mode);
155156
frag_info.alpha = GetOpacityFactor();
157+
const TextureColorTransform color_transform =
158+
GetTextureColorTransform(
159+
texture_->GetTextureDescriptor().color_space);
160+
frag_info.gamma_encode = color_transform.gamma_encode ? 1.0f : 0.0f;
161+
frag_info.color_row0 = color_transform.row0;
162+
frag_info.color_row1 = color_transform.row1;
163+
frag_info.color_row2 = color_transform.row2;
156164
FSExternal::BindFragInfo(pass,
157165
data_host_buffer.EmplaceUniform(frag_info));
158166

‎engine/src/flutter/impeller/entity/shaders/tiled_texture_fill_external.frag‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
precision mediump float;
66

7+
#include <impeller/color.glsl>
78
#include <impeller/external_texture_oes.glsl>
89

910
uniform sampler2D SAMPLER_EXTERNAL_OES_texture_sampler;
@@ -12,6 +13,14 @@ uniform FragInfo {
1213
float x_tile_mode;
1314
float y_tile_mode;
1415
float alpha;
16+
// 1.0 when source texture is linear and needs sRGB gamma encoding.
17+
// 0.0 when source is already gamma-encoded (default for most textures).
18+
float gamma_encode;
19+
// Rows of a 3x3 gamut conversion matrix, as in texture_fill.frag. Identity
20+
// when source and destination color spaces match.
21+
vec3 color_row0;
22+
vec3 color_row1;
23+
vec3 color_row2;
1524
}
1625
frag_info;
1726

@@ -20,11 +29,18 @@ in highp vec2 v_texture_coords;
2029
out vec4 frag_color;
2130

2231
void main() {
23-
frag_color =
32+
vec4 sampled =
2433
IPSampleWithTileModeOES(SAMPLER_EXTERNAL_OES_texture_sampler, // sampler
2534
v_texture_coords, // texture coordinates
2635
frag_info.x_tile_mode, // x tile mode
2736
frag_info.y_tile_mode // y tile mode
28-
) *
29-
frag_info.alpha;
37+
);
38+
vec3 rgb = sampled.rgb;
39+
rgb = vec3(dot(frag_info.color_row0, rgb), dot(frag_info.color_row1, rgb),
40+
dot(frag_info.color_row2, rgb));
41+
if (frag_info.gamma_encode > 0.5) {
42+
rgb = IPSrgbOETF(rgb);
43+
}
44+
sampled.rgb = rgb;
45+
frag_color = sampled * frag_info.alpha;
3046
}

‎engine/src/flutter/shell/platform/android/BUILD.gn‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ executable("flutter_shell_native_unittests") {
4747
"android_shell_holder_unittests.cc",
4848
"apk_asset_provider_unittests.cc",
4949
"flutter_shell_native_unittests.cc",
50+
"image_external_texture_gpu_unittests.cc",
51+
"image_external_texture_unittests.cc",
5052
"image_lru_unittests.cc",
5153
"platform_view_android_unittests.cc",
5254
]
@@ -293,6 +295,7 @@ android_java_sources = [
293295
"io/flutter/embedding/engine/plugins/service/ServicePluginBinding.java",
294296
"io/flutter/embedding/engine/plugins/util/GeneratedPluginRegister.java",
295297
"io/flutter/embedding/engine/renderer/FlutterRenderer.java",
298+
"io/flutter/embedding/engine/renderer/FlutterSurfaceDynamicRangeListener.java",
296299
"io/flutter/embedding/engine/renderer/FlutterUiDisplayListener.java",
297300
"io/flutter/embedding/engine/renderer/FlutterUiResizeListener.java",
298301
"io/flutter/embedding/engine/renderer/RenderSurface.java",

‎engine/src/flutter/shell/platform/android/android_shell_holder_unittests.cc‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class MockPlatformViewAndroidJNI : public PlatformViewAndroidJNI {
4343
std::vector<std::string> strings),
4444
(override));
4545
MOCK_METHOD(void, FlutterViewOnFirstFrame, (), (override));
46+
MOCK_METHOD(void,
47+
FlutterViewOnSurfaceDynamicRangeChanged,
48+
(bool extended_range),
49+
(override));
4650
MOCK_METHOD(void, FlutterViewOnPreEngineRestart, (), (override));
4751
MOCK_METHOD(void,
4852
SurfaceTextureAttachToGLContext,
@@ -72,6 +76,13 @@ class MockPlatformViewAndroidJNI : public PlatformViewAndroidJNI {
7276
ImageProducerTextureEntryAcquireLatestHardwareBuffer,
7377
(JavaLocalRef image_texture_entry),
7478
(override));
79+
80+
MOCK_METHOD(void,
81+
ImageProducerTextureEntryOnHardwareBufferReleased,
82+
(JavaLocalRef image_texture_entry,
83+
AHardwareBuffer* buffer,
84+
int release_fence_fd),
85+
(override));
7586
MOCK_METHOD(JavaLocalRef,
7687
ImageGetHardwareBuffer,
7788
(JavaLocalRef image),

‎engine/src/flutter/shell/platform/android/android_surface_dynamic_impeller.cc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ AndroidSurfaceDynamicImpeller::CreateSnapshotSurface() {
113113
return nullptr;
114114
}
115115

116+
bool AndroidSurfaceDynamicImpeller::IsExtendedRange() const {
117+
// The OpenGL ES surface is always SDR.
118+
return vulkan_surface_ && vulkan_surface_->IsExtendedRange();
119+
}
120+
116121
std::shared_ptr<impeller::Context>
117122
AndroidSurfaceDynamicImpeller::GetImpellerContext() {
118123
return android_context_->GetImpellerContext();

0 commit comments

Comments
 (0)