Commit 8e865006 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Make PostTask destination explicit in /ui/gl/gl_image_memory.cc

Task APIs v3 will all have an explicit destination. In the past
"default traits" meant ThreadPool. These CLs are thus a no-op
except for the few callers that clearly wanted to post a QuitClosure()
on the current thread (posting a QuitClosure() to a parallel task will
merely bounce it back to the current thread anyways). Those few callers
were migrated to ThreadTaskRunnerHandle::Get().

These changes are thus required to phase out task APIs v2 (post_task.h)
Design doc: https://docs.google.com/document/d/1tssusPykvx3g0gvbvU4HxGyn3MjJlIylnsH13-Tv6s4/edit

This specific change is a subset of
https://chromium-review.googlesource.com/c/chromium/src/+/2216733

This CL was uploaded by git cl split.

R=dcastagna@chromium.org

Bug: 1026641
Change-Id: Ib464bb9af983f16e6561e54e9a40b3352ab33a0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217209
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772262}
parent 11acff88
......@@ -12,7 +12,7 @@
#include "base/numerics/safe_conversions.h"
#include "base/synchronization/waitable_event.h"
#include "base/system/sys_info.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "ui/gfx/buffer_format_util.h"
......@@ -370,8 +370,9 @@ bool GLImageMemory::CopyTexImage(unsigned target) {
memcpy_tasks_, base::BindOnce(&base::WaitableEvent::Signal,
base::Unretained(&event)));
for (int i = 1; i < memcpy_tasks_; ++i) {
base::PostTask(FROM_HERE, base::BindOnce(&MemcpyTask, src, dst, size, i,
memcpy_tasks_, &barrier));
base::ThreadPool::PostTask(
FROM_HERE, base::BindOnce(&MemcpyTask, src, dst, size, i,
memcpy_tasks_, &barrier));
}
MemcpyTask(src, dst, size, 0, memcpy_tasks_, &barrier);
event.Wait();
......
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