Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ec8326c

Browse files
authored
Reenabled labelling test with a capabilities check. (#57160)
fixes flutter/flutter#160180 I'm unable to reproduce the problem locally but this is the most likely cause. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 7ec5b81 commit ec8326c

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

impeller/renderer/backend/gles/proc_table_gles.cc

+11-4
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,20 @@ static bool ResourceIsLive(const ProcTableGLES& gl,
357357
FML_UNREACHABLE();
358358
}
359359

360-
bool ProcTableGLES::SetDebugLabel(DebugResourceType type,
361-
GLint name,
362-
std::string_view label) const {
360+
bool ProcTableGLES::SupportsDebugLabels() const {
363361
if (debug_label_max_length_ <= 0) {
364-
return true;
362+
return false;
365363
}
366364
if (!ObjectLabelKHR.IsAvailable()) {
365+
return false;
366+
}
367+
return true;
368+
}
369+
370+
bool ProcTableGLES::SetDebugLabel(DebugResourceType type,
371+
GLint name,
372+
std::string_view label) const {
373+
if (!SupportsDebugLabels()) {
367374
return true;
368375
}
369376
if (!ResourceIsLive(*this, type, name)) {

impeller/renderer/backend/gles/proc_table_gles.h

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ class ProcTableGLES {
314314

315315
bool IsCurrentFramebufferComplete() const;
316316

317+
bool SupportsDebugLabels() const;
318+
317319
bool SetDebugLabel(DebugResourceType type,
318320
GLint name,
319321
std::string_view label) const;

impeller/renderer/backend/gles/test/reactor_unittests.cc

+6-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ TEST(ReactorGLES, UntrackedHandle) {
9595
EXPECT_TRUE(reactor->React());
9696
}
9797

98-
TEST(ReactorGLES, DISABLED_NameUntrackedHandle) {
98+
TEST(ReactorGLES, NameUntrackedHandle) {
9999
auto mock_gles_impl = std::make_unique<MockGLESImpl>();
100100

101101
EXPECT_CALL(*mock_gles_impl, GenTextures(1, _))
@@ -108,6 +108,11 @@ TEST(ReactorGLES, DISABLED_NameUntrackedHandle) {
108108
MockGLES::Init(std::move(mock_gles_impl));
109109
ProcTableGLES::Resolver resolver = kMockResolverGLES;
110110
auto proc_table = std::make_unique<ProcTableGLES>(resolver);
111+
112+
if (!proc_table->SupportsDebugLabels()) {
113+
GTEST_SKIP() << "This device doesn't support labelling.";
114+
}
115+
111116
auto worker = std::make_shared<TestWorker>();
112117
auto reactor = std::make_shared<ReactorGLES>(std::move(proc_table));
113118
reactor->AddWorker(worker);

0 commit comments

Comments
 (0)