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

Issue 2970353002: Add GpuMemoryBuffer support for DXGI handles.

Created:
3 years, 5 months ago by jbauman
Modified:
3 years, 4 months ago
Reviewers:
reveman, yzshen1, dcheng
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), piman+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add GpuMemoryBuffer support for DXGI handles. These can only be presented using overlays for now - GL isn't supported. Also, there's no code to create them. They can only be passed in from other components (e.g. the CDM). BUG=527890, 729238 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;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 : add image texture target #

Total comments: 12

Patch Set 3 : update build config #

Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -2 lines) Patch
M gpu/ipc/host/gpu_memory_buffer_support.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M gpu/ipc/service/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/ipc/service/gpu_memory_buffer_factory.cc View 2 chunks +8 lines, -0 lines 0 comments Download
A gpu/ipc/service/gpu_memory_buffer_factory_win.h View 1 chunk +53 lines, -0 lines 0 comments Download
A gpu/ipc/service/gpu_memory_buffer_factory_win.cc View 1 chunk +71 lines, -0 lines 0 comments Download
M ui/gfx/gpu_memory_buffer.h View 2 chunks +4 lines, -1 line 0 comments Download
M ui/gfx/gpu_memory_buffer.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M ui/gfx/mojo/buffer_types.mojom View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M ui/gfx/mojo/buffer_types_struct_traits.h View 1 2 5 chunks +15 lines, -0 lines 0 comments Download
M ui/gfx/mojo/buffer_types_struct_traits.cc View 1 2 2 chunks +44 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (20 generated)
jbauman
3 years, 5 months ago (2017-07-12 00:27:20 UTC) #16
dcheng
+yzshen for the shared memory question https://codereview.chromium.org/2970353002/diff/20001/gpu/ipc/service/gpu_memory_buffer_factory_win.cc File gpu/ipc/service/gpu_memory_buffer_factory_win.cc (right): https://codereview.chromium.org/2970353002/diff/20001/gpu/ipc/service/gpu_memory_buffer_factory_win.cc#newcode48 gpu/ipc/service/gpu_memory_buffer_factory_win.cc:48: scoped_refptr<gl::GLImageDXGIHandle> image(new gl::GLImageDXGIHandle( ...
3 years, 5 months ago (2017-07-12 08:46:20 UTC) #18
reveman
lg, mostly nits https://codereview.chromium.org/2970353002/diff/20001/gpu/ipc/service/gpu_memory_buffer_factory_win.cc File gpu/ipc/service/gpu_memory_buffer_factory_win.cc (right): https://codereview.chromium.org/2970353002/diff/20001/gpu/ipc/service/gpu_memory_buffer_factory_win.cc#newcode45 gpu/ipc/service/gpu_memory_buffer_factory_win.cc:45: if (handle.type != gfx::DXGI_HANDLE) DCHECK_EQ(handle.type, gfx::DXGI_HANDLE)? ...
3 years, 5 months ago (2017-07-12 15:04:14 UTC) #19
dcheng
https://codereview.chromium.org/2970353002/diff/20001/ui/gfx/mojo/buffer_types_struct_traits.cc File ui/gfx/mojo/buffer_types_struct_traits.cc (right): https://codereview.chromium.org/2970353002/diff/20001/ui/gfx/mojo/buffer_types_struct_traits.cc#newcode91 ui/gfx/mojo/buffer_types_struct_traits.cc:91: return mojo::MakeScopedHandle(mojo_handle); On 2017/07/12 08:46:19, dcheng wrote: > Maybe ...
3 years, 5 months ago (2017-07-12 21:58:46 UTC) #20
yzshen1
3 years, 5 months ago (2017-07-12 23:38:49 UTC) #21
https://codereview.chromium.org/2970353002/diff/20001/ui/gfx/mojo/buffer_type...
File ui/gfx/mojo/buffer_types_struct_traits.cc (right):

https://codereview.chromium.org/2970353002/diff/20001/ui/gfx/mojo/buffer_type...
ui/gfx/mojo/buffer_types_struct_traits.cc:91: return
mojo::MakeScopedHandle(mojo_handle);
On 2017/07/12 21:58:46, dcheng wrote:
> On 2017/07/12 08:46:19, dcheng wrote:
> > Maybe this can just use WrapSharedMemoryHandle?
> > 
> > One thing I'm not sure about though... it's not clear to me if this is safe.
> The
> > documentation for ScopedHandle says it takes ownership, and it certainly
> /looks/
> > like ownership is transferred here. However, Mojo currently calls each
> > serializer 2x (this is https://crbug.com/681080) and it's not clear to me
what
> > happens if we transfer ownership twice...
> > 
> > That being said, the input parameter is const T& which would imply that
> > ownership is not actually transferred... so I'm wondering how this actually
> > works.
> > 
> > (there is some other code that seems to have this issue: for example,
> >
>
https://cs.chromium.org/chromium/src/media/gpu/mojo/jpeg_decoder_typemap_trai...)
> 
> OK I asked rockot@ and it turns out that Mojo special-cases handle serializers
> to only be invoked once.
> 
> Meh.

Sorry I didn't see this comment earlier.
Yes, getters of object types (struct/union/map/string/array) are called twice
because their size needs to be calculated. Primitive types / handles are only
called once.

Btw, Ken and I chatted about the calculate-before-allocate v.s.
grow-if-necessary issue again. We both think it is good to try out the
grow-if-necessary approach. (All credits go to Ken because he plans to do the
work). If that finally happens, we could make sure each getter is called once,
and a lot of custom context usage could be removed.

Powered by Google App Engine
This is Rietveld 408576698