Skip to content

Commit

Permalink
Update to mojo 0a98599b44b070b72c4284498bab781d343cc282
Browse files Browse the repository at this point in the history
Updates the //mojo snapshotted code and the mojo SDK to
0a98559b4, which includes several cleanups in the GL headers.

Also adds /sky/packages/sky_services/lib to .gitignore
  • Loading branch information
jamesr committed Aug 26, 2015
1 parent 6631c24 commit 952beb8
Show file tree
Hide file tree
Showing 21 changed files with 2,203 additions and 3,704 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ Thumbs.db
/mojo/dart/mojom/packages
/mojo/dart/mojom/test/packages
/sky/packages/**/packages
/sky/packages/sky_services/lib/
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

vars = {
'chromium_git': 'https://chromium.googlesource.com',
'mojo_sdk_revision': '76ff57433b48527dc491dac4c52c9d71a7c3a0e3',
'mojo_sdk_revision': 'eb7dac2f90187db12c0d29792a0bd999bc96cbe5',
'mojo_devtools_revision': '2feda37728d3e551ef543b8f6c4f4b20eaa2d81f',
'skia_revision': '29ccdf86ab0a1649fd775c9431891bacb1391e99',
'dart_revision': 'cab003366785773ace16b5305ac1f33c228cac54',
Expand Down
138 changes: 113 additions & 25 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2165,7 +2165,7 @@
},
'BlendBarrierKHR': {
'gl_test_func': 'glBlendBarrierKHR',
'extension': True,
'extension': "KHR_blend_equation_advanced",
'extension_flag': 'blend_equation_advanced',
'client_test': False,
},
Expand Down Expand Up @@ -3362,7 +3362,7 @@
},
'TexStorage2DEXT': {
'unit_test': False,
'extension': True,
'extension': "EXT_texture_storage",
'decoder_func': 'DoTexStorage2DEXT',
},
'DrawArraysInstancedANGLE': {
Expand Down Expand Up @@ -3622,6 +3622,7 @@
'decoder_func': 'DoDiscardFramebufferEXT',
'unit_test': False,
'client_test': False,
'extension': 'EXT_discard_framebuffer',
'extension_flag': 'ext_discard_framebuffer',
},
'LoseContextCHROMIUM': {
Expand Down Expand Up @@ -10187,17 +10188,14 @@ def WriteMojoGLES2Impl(self, filename):
#include "mojo/gpu/mojo_gles2_impl_autogen.h"
#include "base/logging.h"
#include "mojo/public/c/gles2/chromium_bind_uniform_location.h"
#include "mojo/public/c/gles2/chromium_map_sub.h"
#include "mojo/public/c/gles2/chromium_miscellaneous.h"
#include "mojo/public/c/gles2/chromium_sync_point.h"
#include "mojo/public/c/gles2/chromium_texture_mailbox.h"
#include "mojo/public/c/gles2/ext_debug_marker.h"
#include "mojo/public/c/gles2/gles2.h"
#include "mojo/public/c/gles2/occlusion_query_ext.h"
#include "mojo/public/c/gles2/oes_vertex_array_object.h"
#include "mojo/public/c/gpu/MGL/mgl_onscreen.h"
#define GL_GLEXT_PROTOTYPES
#include "mojo/public/c/gpu/GLES2/gl2.h"
#include "mojo/public/c/gpu/GLES2/gl2ext.h"
#include "mojo/public/c/gpu/GLES2/gl2extmojo.h"
namespace mojo {
"""
Expand Down Expand Up @@ -10512,14 +10510,14 @@ def WritePepperGLES2Interface(self, filename, dev):

file.Close()

def WriteMojoGLCallVisitor(self, filename):
"""Provides the GL implementation for mojo"""
def WriteMojoGLCallVisitorForExtension(self, filename, extension):
"""Provides the GL implementation for mojo for a particular extension"""
file = CWriter(filename)
file.Write(_LICENSE)
file.Write(_DO_NOT_EDIT_WARNING)

for func in self.original_functions:
if not func.IsCoreGLFunction():
if func.GetInfo("extension") != extension:
continue
file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
(func.name, func.return_type,
Expand All @@ -10529,20 +10527,104 @@ def WriteMojoGLCallVisitor(self, filename):
file.Close()
self.generated_cpp_filenames.append(file.filename)

def WriteMojoGLCallVisitorForExtension(self, filename, extension):
"""Provides the GL implementation for mojo for a particular extension"""
def WriteMojoGLThunksHeader(self, filename, extension):
"""Provides the thunks header for a particular extension"""
file = CHeaderWriter(filename)
camel_case_extension = ToCamelCase(extension)
thunks_type = "MojoGLES2Impl%sThunks" % camel_case_extension
fields = {"extension": extension,
"extension_lower": extension.lower(),
"camel_case_extension": camel_case_extension,
"thunks_type": thunks_type}
body = """
#include <stddef.h>
#define GL_GLEXT_PROTOTYPES
#include "mojo/public/c/gpu/GLES2/gl2extmojo.h"
// Specifies the frozen API for the %(extension)s extension.
#pragma pack(push, 8)
struct %(thunks_type)s {
size_t size; // Should be set to sizeof(*this).
#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
ReturnType(GL_APIENTRY* Function) PARAMETERS;
#include "mojo/public/platform/native/gles2/call_visitor_%(extension_lower)s_autogen.h"
#undef VISIT_GL_CALL
};
#pragma pack(pop)
#ifdef __cplusplus
// Intended to be called from the embedder to get the embedder's implementation
// of %(extension_lower)s.
inline %(thunks_type)s
MojoMakeGLES2Impl%(camel_case_extension)sThunks() {
%(thunks_type)s gles2_impl_%(extension_lower)s_thunks = {
sizeof(%(thunks_type)s),
#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) gl##Function,
#include "mojo/public/platform/native/gles2/call_visitor_%(extension_lower)s_autogen.h"
#undef VISIT_GL_CALL
};
return gles2_impl_%(extension_lower)s_thunks;
}
#endif // __cplusplus
// Use this type for the function found by dynamically discovering it in
// a DSO linked with mojo_system.
// The contents of |gles2_impl_%(extension_lower)s_thunks| are copied.
typedef size_t (*MojoSetGLES2Impl%(camel_case_extension)sThunksFn)(
const MojoGLES2Impl%(camel_case_extension)sThunks* thunks);
""" % fields
file.Write(body)
file.Close()
self.generated_cpp_filenames.append(file.filename)

def WriteMojoGLThunksImpl(self, filename, extension):
"""Provides the thunks implementation for a particular extension"""
file = CWriter(filename)
file.Write(_LICENSE)
file.Write(_DO_NOT_EDIT_WARNING)
camel_case_extension = ToCamelCase(extension)
g_impl_name = "g_impl_%s_thunks" % extension.lower()
thunks_type = "MojoGLES2Impl%sThunks" % camel_case_extension
fields = {"extension_lower": extension.lower(),
"camel_case_extension": camel_case_extension,
"thunks_type": thunks_type,
"thunks_param_name": "gles2_impl_%s_thunks" % extension.lower(),
"g_impl_name": g_impl_name}

for func in self.original_functions:
if func.GetInfo("extension") != extension:
continue
file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" %
(func.name, func.return_type,
func.MakeTypedOriginalArgString(""),
func.MakeOriginalArgString("")))
body = """
#include "mojo/public/platform/native/gles2_impl_%(extension_lower)s_thunks.h"
#include <assert.h>
#include "mojo/public/platform/native/thunk_export.h"
extern "C" {
static %(thunks_type)s %(g_impl_name)s = {0};
#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
ReturnType GL_APIENTRY gl##Function PARAMETERS { \
assert(%(g_impl_name)s.Function); \
return %(g_impl_name)s.Function ARGUMENTS; \
}
#include "mojo/public/platform/native/gles2/call_visitor_%(extension_lower)s_autogen.h"
#undef VISIT_GL_CALL
extern "C" THUNK_EXPORT size_t
MojoSetGLES2Impl%(camel_case_extension)sThunks(
const %(thunks_type)s* %(thunks_param_name)s) {
if (%(thunks_param_name)s->size >= sizeof(%(g_impl_name)s))
%(g_impl_name)s = *%(thunks_param_name)s;
return sizeof(%(g_impl_name)s);
}
} // extern "C"
""" % fields
file.Write(body)
file.Close()
self.generated_cpp_filenames.append(file.filename)

Expand Down Expand Up @@ -10637,11 +10719,17 @@ def main(argv):
"gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h")
gen.WriteGLES2Header("gpu/GLES2/gl2chromium_autogen.h")

mojo_gles2_prefix = ("mojo/public/c/gles2/gles2_call_visitor")
gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h")
mojo_gles2_call_visitor_prefix = ("mojo/public/platform/native/gles2/call_visitor")
for extension in _MOJO_EXPOSED_EXTENSIONS:
gen.WriteMojoGLCallVisitorForExtension(
mojo_gles2_prefix + "_" + extension.lower() + "_autogen.h", extension)
mojo_gles2_call_visitor_prefix + "_" + extension.lower() + "_autogen.h", extension)

mojo_gles2_thunks_prefix = ("mojo/public/platform/native/gles2_impl_")
for extension in _MOJO_EXPOSED_EXTENSIONS:
gen.WriteMojoGLThunksHeader(
mojo_gles2_thunks_prefix + extension.lower() + "_thunks.h", extension)
gen.WriteMojoGLThunksImpl(
mojo_gles2_thunks_prefix + extension.lower() + "_thunks.cc", extension)

gen.WriteMojoGLES2ImplHeader(
"mojo/gpu/mojo_gles2_impl_autogen.h")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ ClientContextState::EnableFlags::EnableFlags()
scissor_test(false),
stencil_test(false),
rasterizer_discard(false),
primitive_restart_fixed_index(false) {
}
primitive_restart_fixed_index(false) {}

bool ClientContextState::SetCapabilityState(GLenum cap,
bool enabled,
Expand Down
Loading

0 comments on commit 952beb8

Please sign in to comment.