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

Issue 1288583002: Add MGL entry points and port spinning_cube to use them (Closed)

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

Description

Add MGL entry points and port spinning_cube to use them This adds MGL entry points for controlling contexts and MGL onscreen entry points specifically for onscreen contexts and makes the spinning_cube (and thus surfaces_app) examples use them. The MGL thunks are plumbed through and implemented in the shell on top of the old MojoGLES2* entry points. The thunks and headers for OpenGL ES / KHR are put in place in the SDK in this patch, but the old targets and thunk targets are still in place and used by most other things. Plan from here is to: *) Land this so the new entry points are available to downstream SDK consumers *) Port callers over to the new entry points, both in the Mojo repo and downstream (these patches can be parallelized) *) When callers of the MojoGLES2 entry points are gone, remove from SDK and migrate thunk implementations to "proper" places *) Remove the third_party/khronos headers from everywhere The MGL entry points are just like the MojoGLES2 ones except: *) MGLCreateContext allows specifying a version and share group, although the only accepted values right now are OpenGL ES 2.0 and no share group (same as before) *) MGL exposes an MGLGetCurrentContext() *) SwapBuffers() and Resize() are in a separate header and separate thunk table as they only make sense for the minority of apps that talk directly to an 'onscreen' context, that is the system compositor and some demos and tests. In theory the shell could selectively inject thunks for this table to apps with the correct signatures or whatnot *) MGL thunks are implemented in .c files to make them easier to compile with strange toolchain/language combinations *) MGL does not expose the C++ downcast GLES2Interface getter. As part of converting things to MGL I'll remove the rest of the users of this. The full set of OpenGL ES 2 headers including extension headers are put into the public SDK in this patch, but they aren't being used universally yet. Since they're the same as the ones in other places in the mojo repo this "works" but it's a bit sketchy. I'll remove the other header locations soon but changing that at the same time as adding the new headers results in an unreviewably large patch so it's separate. This patch also bypasses the formatting check for the headers from khronos since I don't think we want to clang-format them. I'm not sure how to teach the presubmit to do this - ideas welcome. R=viettrungluu@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/1e96a133324e4f041807dce1b0c6db314091cccd

Patch Set 1 #

Patch Set 2 : fix gn check, still has issue on android #

Patch Set 3 : fix android build #

Total comments: 20

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+526 lines, -58 lines) Patch
M examples/spinning_cube/BUILD.gn View 2 chunks +3 lines, -1 line 0 comments Download
M examples/spinning_cube/gles2_client_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M examples/spinning_cube/gles2_client_impl.cc View 5 chunks +11 lines, -11 lines 0 comments Download
M mojo/gles2/BUILD.gn View 1 2 2 chunks +17 lines, -1 line 0 comments Download
A mojo/gles2/mgl_impl.cc View 1 2 3 1 chunk +72 lines, -0 lines 0 comments Download
A mojo/public/c/gpu/BUILD.gn View 1 2 3 1 chunk +69 lines, -0 lines 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2.h View 1 chunk +1 line, -1 line 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2ext.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2extmojo.h View 2 chunks +4 lines, -4 lines 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2mojo.h View 2 chunks +5 lines, -6 lines 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2mojo_autogen.h View 2 chunks +4 lines, -4 lines 0 comments Download
A + mojo/public/c/gpu/GLES2/gl2platform.h View 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/c/gpu/KHR/khrplatform.h View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/c/gpu/MGL/mgl.h View 1 2 3 4 1 chunk +62 lines, -0 lines 0 comments Download
A mojo/public/c/gpu/MGL/mgl_onscreen.h View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
A mojo/public/c/gpu/MGL/mgl_types.h View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download
M mojo/public/platform/native/BUILD.gn View 1 chunk +22 lines, -0 lines 0 comments Download
A mojo/public/platform/native/mgl_onscreen_thunks.h View 1 chunk +46 lines, -0 lines 0 comments Download
A mojo/public/platform/native/mgl_onscreen_thunks.c View 1 chunk +28 lines, -0 lines 0 comments Download
A mojo/public/platform/native/mgl_thunks.h View 1 2 3 4 1 chunk +56 lines, -0 lines 0 comments Download
A mojo/public/platform/native/mgl_thunks.c View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download
M shell/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M shell/native_application_support.cc View 1 2 3 4 2 chunks +30 lines, -31 lines 0 comments Download

Messages

Total messages: 6 (1 generated)
jamesr
Actually I don't need the gpu/{GLES2,KHR} headers in this patch, but it's useful to see ...
5 years, 4 months ago (2015-08-12 01:16:46 UTC) #2
viettrungluu
https://codereview.chromium.org/1288583002/diff/30001/mojo/gles2/mgl_impl.cc File mojo/gles2/mgl_impl.cc (right): https://codereview.chromium.org/1288583002/diff/30001/mojo/gles2/mgl_impl.cc#newcode10 mojo/gles2/mgl_impl.cc:10: // This file implements the MGL and MGL onscreen ...
5 years, 4 months ago (2015-08-12 02:48:10 UTC) #3
jamesr
https://codereview.chromium.org/1288583002/diff/30001/mojo/public/c/gpu/BUILD.gn File mojo/public/c/gpu/BUILD.gn (right): https://codereview.chromium.org/1288583002/diff/30001/mojo/public/c/gpu/BUILD.gn#newcode41 mojo/public/c/gpu/BUILD.gn:41: ":GLES2", On 2015/08/12 at 02:48:10, viettrungluu wrote: > I ...
5 years, 4 months ago (2015-08-13 19:42:28 UTC) #4
viettrungluu
lgtm
5 years, 4 months ago (2015-08-13 19:47:57 UTC) #5
jamesr
5 years, 4 months ago (2015-08-13 20:08:22 UTC) #6
Message was sent while issue was closed.
Committed patchset #5 (id:70001) manually as
1e96a133324e4f041807dce1b0c6db314091cccd (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698