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

Commit a289daa

Browse files
committed
moved back to direct naming
1 parent d98c37e commit a289daa

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

impeller/renderer/backend/gles/reactor_gles.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ bool ReactorGLES::ConsolidateHandles() {
301301
WriterLock handles_lock(handles_mutex_);
302302
handles_to_delete.reserve(handles_to_collect_count_);
303303
handles_to_collect_count_ = 0;
304-
std::swap(handles_to_name, handles_to_name_);
305304
for (auto& handle : handles_) {
306305
// Collect dead handles.
307306
if (handle.second.pending_collection) {
@@ -394,12 +393,13 @@ void ReactorGLES::SetDebugLabel(const HandleGLES& handle,
394393
if (handle.IsDead()) {
395394
return;
396395
}
397-
WriterLock handles_lock(handles_mutex_);
398396
if (handle.untracked_id_.has_value()) {
399-
handles_to_name_.emplace_back(
400-
std::make_tuple(ToDebugResourceType(handle.GetType()),
401-
handle.untracked_id_.value(), std::string(label)));
397+
FML_DCHECK(CanReactOnCurrentThread());
398+
const auto& gl = GetProcTable();
399+
gl.SetDebugLabel(ToDebugResourceType(handle.GetType()),
400+
handle.untracked_id_.value(), std::string(label));
402401
} else {
402+
WriterLock handles_lock(handles_mutex_);
403403
if (auto found = handles_.find(handle); found != handles_.end()) {
404404
found->second.pending_debug_label = label;
405405
}

impeller/renderer/backend/gles/reactor_gles.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@ class ReactorGLES {
296296
mutable RWMutex handles_mutex_;
297297
LiveHandles handles_ IPLR_GUARDED_BY(handles_mutex_);
298298
int32_t handles_to_collect_count_ IPLR_GUARDED_BY(handles_mutex_) = 0;
299-
std::vector<
300-
std::tuple<DebugResourceType, GLint, std::string>> handles_to_name_
301-
IPLR_GUARDED_BY(handles_mutex_);
302299

303300
mutable Mutex workers_mutex_;
304301
mutable std::map<WorkerID, std::weak_ptr<Worker>> workers_ IPLR_GUARDED_BY(

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ TEST(ReactorGLES, NameUntrackedHandle) {
103103
HandleGLES handle = reactor->CreateUntrackedHandle(HandleType::kTexture);
104104
mock_gles->GetCapturedCalls();
105105
reactor->SetDebugLabel(handle, "hello, joe!");
106-
// Without an operation nothing is cleaned up.
107-
EXPECT_TRUE(reactor->AddOperation([&](const ReactorGLES&) {}));
108-
EXPECT_TRUE(reactor->React());
109106
std::vector<std::string> calls = mock_gles->GetCapturedCalls();
110107
EXPECT_TRUE(std::find(calls.begin(), calls.end(), "glObjectLabelKHR") !=
111108
calls.end());

0 commit comments

Comments
 (0)