Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Issue 2275113002: Provide task runner to GLES2Impl / CommandBuffer at creation (Closed)

Created:
4 years, 4 months ago by ericrk
Modified:
4 years, 3 months ago
Reviewers:
danakj, no sievers, piman
CC:
chromium-reviews, rjkroege, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, kalyank, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@fix-cleanup4
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Provide task runner to GLES2Impl / CommandBuffer at creation Currently, GLES2Impl doesn't have a task runner and various CommandBuffers are inconsistent in how they create/receive one. In a future change, GLES2Impl will need its own task runner. Ideally, GLES2Impl and the various CommandBuffers would share this task runner. This change prepares for this shared usage by always creating a shared task runner externally and passing it to GLES2Impl and any relevant CommandBuffer. In some cases (Android Webview, EGL conform, ppapi), the CommandBuffer does not currently use a task runner. In these cases we just pass null to GLES2Impl as well, indicating that it should run any tasks inline on the current thread. BUG= CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : fixes #

Patch Set 4 : cleanup #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -49 lines) Patch
M content/common/gpu/client/context_provider_command_buffer.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/gl_in_process_context.cc View 1 2 3 4 chunks +18 lines, -15 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 chunk +2 lines, -1 line 1 comment Download
M gpu/command_buffer/client/gles2_implementation_unittest.cc View 1 1 chunk +4 lines, -7 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 1 chunk +7 lines, -2 lines 0 comments Download
M gpu/gles2_conform_support/egl/context.cc View 1 chunk +1 line, -1 line 0 comments Download
M gpu/ipc/client/command_buffer_proxy_impl.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M ppapi/shared_impl/ppb_graphics_3d_shared.cc View 1 chunk +4 lines, -7 lines 0 comments Download
M services/ui/public/cpp/gles2_context.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M services/ui/surfaces/surfaces_context_provider.h View 1 chunk +1 line, -0 lines 0 comments Download
M services/ui/surfaces/surfaces_context_provider.cc View 3 chunks +5 lines, -5 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 7 (4 generated)
ericrk
4 years, 3 months ago (2016-08-25 20:49:44 UTC) #4
danakj
LGTM, you'll want piman for the ppapi user passing nullptr.
4 years, 3 months ago (2016-08-25 21:03:20 UTC) #5
piman
4 years, 3 months ago (2016-08-25 22:51:02 UTC) #7
https://codereview.chromium.org/2275113002/diff/60001/gpu/command_buffer/clie...
File gpu/command_buffer/client/gles2_implementation.cc (right):

https://codereview.chromium.org/2275113002/diff/60001/gpu/command_buffer/clie...
gpu/command_buffer/client/gles2_implementation.cc:137:
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
In what way is this task runner meant to be used? I see 2 problems:
1- GLES2Implementation is used in contexts where there is no task runner on the
client thread. For example on the worker thread, as well as in the EGL
implementation for conformance tests and for skia tests.
2- we use the GLES2Implementation on multiple threads, with a lock. This
requires that any task that will use the GLES2Implementation holds the lock
while doing so. So, the client is required to hold that lock when making calls,
and the CommandBufferProxyImpl also takes the lock when executing posted tasks
which would call into the GLES2Implementation - see
CommandBufferProxyImpl::SetLock and uses of that lock. If the
GLES2Implementation is going to post tasks, it will need to take that lock in
those posted tasks, so it will need to be made aware of it.

Powered by Google App Engine
This is Rietveld 408576698