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

Issue 940293003: Add a Display and ContextProvider concept to mojom, use to recreate (Closed)

Created:
5 years, 10 months ago by jamesr
Modified:
5 years, 9 months ago
Reviewers:
qsr, abarth-chromium
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Add a Display and ContextProvider concept to mojom, use to recreate This introduces two new concepts to make initializing and reinitializing the objects needed to draw onscreen easier. This makes it easier to draw things and will make recovering from lost contexts simpler. The first is ContextProvider which is an interface for creating contexts (in the GPU command buffer sense) associated with a piece of state (such as drawing to a particular native viewport). This allows code to request command buffer contexts associated with a particular native viewport multiple times without requiring passing identifiers around since the identity of the native viewport in question is contained in the identity of the message pipe that the interface is bound to. This also makes it possible for the gpu mojoms to produce viewport-bound contexts without needing to be aware of the native viewport interfaces explicitly or through opaque ID side channels. The second is Display which is an interface used to submit frames that should be drawn onscreen. A Display is somewhat like a Surface with a few differences that make interacting with one simpler than interacting with a Surface in general. Display is only drawn to and never embedded in another frame so it does not need to have an explicit size or global ID as those are only used when embedding one Surface's frame into another. The only operations a Display has to support is receiving frames, ACKing them and returning resources when unused. A Display needs to know how to draw to a particular context so it can be constructed from a ContextProvider if that ContextProvider is associated with the desired native viewport. This means that in turn the native viewport service doesn't have to know anything about surfaces, it only needs to provide appropriate ContextProvider implementations to whomever asks. R=qsr@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/187e1faf437be935fe55ae769f0ecc19ce4c3db4

Patch Set 1 #

Total comments: 6

Patch Set 2 : fully functional #

Patch Set 3 : #

Total comments: 1

Patch Set 4 : android fixes #

Total comments: 12

Patch Set 5 : #

Total comments: 11

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+876 lines, -695 lines) Patch
M examples/spinning_cube/gles2_client_impl.h View 1 2 3 4 3 chunks +3 lines, -1 line 0 comments Download
M examples/spinning_cube/gles2_client_impl.cc View 1 2 3 4 3 chunks +31 lines, -21 lines 0 comments Download
M examples/spinning_cube/spinning_cube.h View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M examples/spinning_cube/spinning_cube.cc View 1 2 3 4 2 chunks +1 line, -6 lines 0 comments Download
M examples/spinning_cube/spinning_cube_app.cc View 1 2 3 4 2 chunks +10 lines, -23 lines 0 comments Download
M examples/surfaces_app/child_gl_impl.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M examples/surfaces_app/child_gl_impl.cc View 1 chunk +2 lines, -1 line 0 comments Download
M examples/surfaces_app/embedder.h View 2 chunks +6 lines, -11 lines 0 comments Download
M examples/surfaces_app/embedder.cc View 1 2 3 4 5 3 chunks +7 lines, -3 lines 0 comments Download
M examples/surfaces_app/surfaces_app.cc View 1 4 chunks +29 lines, -28 lines 0 comments Download
M mojo/services/gpu/public/interfaces/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
A mojo/services/gpu/public/interfaces/context_provider.mojom View 1 2 3 4 5 1 chunk +28 lines, -0 lines 0 comments Download
M mojo/services/gpu/public/interfaces/gpu.mojom View 1 1 chunk +1 line, -6 lines 0 comments Download
M mojo/services/native_viewport/public/interfaces/native_viewport.mojom View 1 2 chunks +6 lines, -4 lines 0 comments Download
M mojo/services/surfaces/public/interfaces/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A mojo/services/surfaces/public/interfaces/display.mojom View 1 2 1 chunk +33 lines, -0 lines 0 comments Download
M mojo/services/surfaces/public/interfaces/surfaces.mojom View 2 chunks +0 lines, -7 lines 0 comments Download
M services/fake_surfaces/fake_surfaces_service_application.h View 1 3 chunks +6 lines, -0 lines 0 comments Download
M services/fake_surfaces/fake_surfaces_service_application.cc View 1 3 chunks +80 lines, -30 lines 0 comments Download
M services/gles2/BUILD.gn View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M services/gles2/command_buffer_driver.h View 2 chunks +0 lines, -2 lines 0 comments Download
M services/gles2/command_buffer_driver.cc View 4 chunks +4 lines, -6 lines 0 comments Download
M services/gles2/gpu_impl.h View 2 chunks +4 lines, -42 lines 0 comments Download
M services/gles2/gpu_impl.cc View 1 chunk +1 line, -27 lines 0 comments Download
A services/gles2/gpu_state.h View 1 chunk +52 lines, -0 lines 0 comments Download
A services/gles2/gpu_state.cc View 1 chunk +21 lines, -0 lines 0 comments Download
M services/native_viewport/BUILD.gn View 1 3 chunks +2 lines, -8 lines 0 comments Download
M services/native_viewport/main.cc View 1 2 chunks +9 lines, -10 lines 0 comments Download
M services/native_viewport/native_viewport_impl.h View 1 2 3 4 3 chunks +12 lines, -22 lines 0 comments Download
M services/native_viewport/native_viewport_impl.cc View 1 2 3 4 6 chunks +14 lines, -36 lines 0 comments Download
A services/native_viewport/onscreen_context_provider.h View 1 1 chunk +46 lines, -0 lines 0 comments Download
A services/native_viewport/onscreen_context_provider.cc View 1 chunk +58 lines, -0 lines 0 comments Download
D services/native_viewport/viewport_surface.h View 1 1 chunk +0 lines, -48 lines 0 comments Download
M services/native_viewport/viewport_surface.cc View 1 1 chunk +0 lines, -106 lines 0 comments Download
M services/surfaces/BUILD.gn View 1 2 chunks +5 lines, -0 lines 0 comments Download
A services/surfaces/display_factory_impl.h View 1 1 chunk +44 lines, -0 lines 0 comments Download
A services/surfaces/display_factory_impl.cc View 1 1 chunk +36 lines, -0 lines 0 comments Download
A services/surfaces/display_impl.h View 1 1 chunk +80 lines, -0 lines 0 comments Download
A services/surfaces/display_impl.cc View 1 2 3 4 1 chunk +124 lines, -0 lines 0 comments Download
M services/surfaces/surfaces_impl.h View 1 2 chunks +4 lines, -45 lines 0 comments Download
M services/surfaces/surfaces_impl.cc View 1 4 chunks +8 lines, -80 lines 0 comments Download
M services/surfaces/surfaces_scheduler.h View 1 2 3 4 3 chunks +11 lines, -10 lines 0 comments Download
M services/surfaces/surfaces_scheduler.cc View 1 2 3 4 3 chunks +17 lines, -5 lines 0 comments Download
M services/surfaces/surfaces_service_application.h View 1 2 chunks +9 lines, -17 lines 0 comments Download
M services/surfaces/surfaces_service_application.cc View 1 2 chunks +14 lines, -28 lines 0 comments Download
M services/view_manager/display_manager.h View 1 3 chunks +5 lines, -9 lines 0 comments Download
M services/view_manager/display_manager.cc View 1 9 chunks +28 lines, -49 lines 0 comments Download
M shell/android/native_viewport_application_loader.h View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M shell/android/native_viewport_application_loader.cc View 1 2 3 4 5 3 chunks +5 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
jamesr
qsr - this needs more work but I should be able to finish it up ...
5 years, 10 months ago (2015-02-20 02:20:20 UTC) #1
qsr
https://codereview.chromium.org/940293003/diff/1/examples/sample_app/gles2_client_impl.cc File examples/sample_app/gles2_client_impl.cc (right): https://codereview.chromium.org/940293003/diff/1/examples/sample_app/gles2_client_impl.cc#newcode131 examples/sample_app/gles2_client_impl.cc:131: MojoTimeTicks(16667)); You can lose the context between this post ...
5 years, 10 months ago (2015-02-20 11:25:47 UTC) #3
jamesr
Thanks for taking a look, Ben. I believe I've fixed everything in the latest patch. ...
5 years, 10 months ago (2015-02-20 22:01:05 UTC) #5
jamesr
https://codereview.chromium.org/940293003/diff/40001/services/surfaces/display_impl.cc File services/surfaces/display_impl.cc (right): https://codereview.chromium.org/940293003/diff/40001/services/surfaces/display_impl.cc#newcode51 services/surfaces/display_impl.cc:51: new mojo::ContextProviderMojo(gles2_client.PassMessagePipe())))); in particular, here we should listen to ...
5 years, 10 months ago (2015-02-20 22:01:55 UTC) #6
qsr
https://codereview.chromium.org/940293003/diff/60001/examples/sample_app/sample_app.cc File examples/sample_app/sample_app.cc (right): https://codereview.chromium.org/940293003/diff/60001/examples/sample_app/sample_app.cc#newcode51 examples/sample_app/sample_app.cc:51: gles2_client_->SetSize(*size); I don't know if it matters that much, ...
5 years, 10 months ago (2015-02-23 12:32:53 UTC) #8
qsr
James, any idea when you will go back to this?
5 years, 10 months ago (2015-02-26 12:41:03 UTC) #9
jamesr
PTAL https://codereview.chromium.org/940293003/diff/60001/examples/sample_app/sample_app.cc File examples/sample_app/sample_app.cc (right): https://codereview.chromium.org/940293003/diff/60001/examples/sample_app/sample_app.cc#newcode51 examples/sample_app/sample_app.cc:51: gles2_client_->SetSize(*size); On 2015/02/23 12:32:52, qsr wrote: > I ...
5 years, 9 months ago (2015-03-04 00:19:51 UTC) #10
qsr
https://codereview.chromium.org/940293003/diff/80001/examples/surfaces_app/embedder.cc File examples/surfaces_app/embedder.cc (right): https://codereview.chromium.org/940293003/diff/80001/examples/surfaces_app/embedder.cc#newcode7 examples/surfaces_app/embedder.cc:7: #include "base/bind.h" Doesn't seem useful. https://codereview.chromium.org/940293003/diff/80001/mojo/services/gpu/public/interfaces/context_provider.mojom File mojo/services/gpu/public/interfaces/context_provider.mojom (right): ...
5 years, 9 months ago (2015-03-04 10:33:18 UTC) #11
jamesr
PTAL https://codereview.chromium.org/940293003/diff/80001/examples/surfaces_app/embedder.cc File examples/surfaces_app/embedder.cc (right): https://codereview.chromium.org/940293003/diff/80001/examples/surfaces_app/embedder.cc#newcode7 examples/surfaces_app/embedder.cc:7: #include "base/bind.h" On 2015/03/04 10:33:18, qsr wrote: > ...
5 years, 9 months ago (2015-03-04 23:00:27 UTC) #12
qsr
LGTM https://codereview.chromium.org/940293003/diff/80001/services/native_viewport/native_viewport_impl.cc File services/native_viewport/native_viewport_impl.cc (right): https://codereview.chromium.org/940293003/diff/80001/services/native_viewport/native_viewport_impl.cc#newcode112 services/native_viewport/native_viewport_impl.cc:112: void NativeViewportImpl::OnAcceleratedWidgetAvailable( > What do mean by "need ...
5 years, 9 months ago (2015-03-04 23:22:29 UTC) #13
jamesr
On 2015/03/04 23:22:29, qsr wrote: > LGTM > > https://codereview.chromium.org/940293003/diff/80001/services/native_viewport/native_viewport_impl.cc > File services/native_viewport/native_viewport_impl.cc (right): > ...
5 years, 9 months ago (2015-03-04 23:23:43 UTC) #14
jamesr
5 years, 9 months ago (2015-03-04 23:49:58 UTC) #15
Message was sent while issue was closed.
Committed patchset #6 (id:100001) manually as
187e1faf437be935fe55ae769f0ecc19ce4c3db4 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698