Commit b96acf81 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Chromium LUCI CQ

Fix use-after-move in //components/viz/service/display_embedder/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Error: "'overlays' used after it was moved".

Bug: 1122844
Change-Id: I8eb3ffe4d54bf442ad55c184e47b4b922a6043b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601362Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839110}
parent 4c95890a
......@@ -683,10 +683,6 @@ void SkiaOutputSurfaceImpl::ScheduleOverlays(
OverlayList overlays,
std::vector<gpu::SyncToken> sync_tokens,
base::OnceClosure on_finished) {
auto task = base::BindOnce(
&SkiaOutputSurfaceImplOnGpu::ScheduleOverlays,
base::Unretained(impl_on_gpu_.get()), std::move(overlays),
std::move(images_in_current_paint_), std::move(on_finished));
#if defined(OS_APPLE)
DCHECK_EQ(dependency_->gr_context_type(), gpu::GrContextType::kGL);
// If there are render pass overlays, then a gl context is needed for drawing
......@@ -703,6 +699,10 @@ void SkiaOutputSurfaceImpl::ScheduleOverlays(
#else
bool make_current = false;
#endif
auto task = base::BindOnce(
&SkiaOutputSurfaceImplOnGpu::ScheduleOverlays,
base::Unretained(impl_on_gpu_.get()), std::move(overlays),
std::move(images_in_current_paint_), std::move(on_finished));
EnqueueGpuTask(std::move(task), std::move(sync_tokens), make_current,
/*need_framebuffer=*/false);
images_in_current_paint_.clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment