Skip to content

Commit

Permalink
Update to mojo d259eb58aa59e14a13d5e0dc3984b855b475ba09
Browse files Browse the repository at this point in the history
This updates to mojo commit d259eb58aa59 and limits the roll script to
only pull in the parts of //mojo that are currently being used. More
stuff will be dropped in the future.
  • Loading branch information
jamesr committed Aug 25, 2015
1 parent fd3e989 commit c8eff5e
Show file tree
Hide file tree
Showing 302 changed files with 2,267 additions and 16,170 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Thumbs.db
/examples/**/pubspec.lock
/mojo/common/dart/packages
/mojo/dart/apptest/packages
/mojo/dart/http_load_test/bin/packages
/mojo/dart/http_load_test/packages/
/mojo/dart/mojo_services/packages
/mojo/dart/mojo_services/pubspec.lock
/mojo/dart/mojom/bin/packages
Expand Down
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': '9a5f81a3d2a6d027677366edb5de3ae85f6dbf16',
'mojo_sdk_revision': '76ff57433b48527dc491dac4c52c9d71a7c3a0e3',
'skia_revision': '29ccdf86ab0a1649fd775c9431891bacb1391e99',
'dart_revision': '95c951ad190f156eb61b99203c2e4948211c44a7',
'dart_observatory_packages_revision': 'cdc4b3d4c15b9c0c8e7702dff127b440afbb7485',
Expand Down
64 changes: 35 additions & 29 deletions gpu/command_buffer/build_gles2_cmd_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
"""

_MOJO_EXPOSED_EXTENSIONS = ["CHROMIUM_bind_uniform_location",
"CHROMIUM_map_sub",
"CHROMIUM_miscellaneous",
"CHROMIUM_resize",
"CHROMIUM_sync_point",
"CHROMIUM_texture_mailbox",
"EXT_debug_marker",
"OES_vertex_array_object",
"occlusion_query_EXT"]


# This string is copied directly out of the gl2.h file from GLES2.0
#
# Edits:
Expand Down Expand Up @@ -2803,14 +2814,14 @@
},
'MapBufferSubDataCHROMIUM': {
'gen_cmd': False,
'extension': True,
'extension': "CHROMIUM_map_sub",
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
},
'MapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': "CHROMIUM_sub_image",
'extension': "CHROMIUM_map_sub",
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
Expand Down Expand Up @@ -3205,7 +3216,7 @@
},
'UnmapBufferSubDataCHROMIUM': {
'gen_cmd': False,
'extension': True,
'extension': "CHROMIUM_map_sub",
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
Expand All @@ -3216,7 +3227,7 @@
},
'UnmapTexSubImage2DCHROMIUM': {
'gen_cmd': False,
'extension': "CHROMIUM_sub_image",
'extension': "CHROMIUM_map_sub",
'chromium': True,
'client_test': False,
'pepper_interface': 'ChromiumMapSub',
Expand Down Expand Up @@ -3454,7 +3465,7 @@
},
'BindUniformLocationCHROMIUM': {
'type': 'GLchar',
'extension': True,
'extension': "CHROMIUM_bind_uniform_location",
'data_transfer_methods': ['bucket'],
'needs_size': True,
'gl_test_func': 'DoBindUniformLocationCHROMIUM',
Expand Down Expand Up @@ -4350,25 +4361,15 @@ def WriteMojoGLES2Impl(self, func, file):
file.Write("%s MojoGLES2Impl::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
# TODO(alhaad): Add Mojo C thunk for each of the following methods and
# remove this.
func_list = ["GenQueriesEXT", "BeginQueryEXT", "MapTexSubImage2DCHROMIUM",
"UnmapTexSubImage2DCHROMIUM", "DeleteQueriesEXT",
"EndQueryEXT", "GetQueryObjectuivEXT", "ShallowFlushCHROMIUM"]
if func.original_name in func_list:
file.Write("return static_cast<gpu::gles2::GLES2Interface*>"
"(MojoGLES2GetGLES2Interface(context_))->" +
func.original_name + "(" + func.MakeOriginalArgString("") +
");")
file.Write("}")
return

extensions = ["CHROMIUM_sync_point", "CHROMIUM_texture_mailbox"]
if func.IsCoreGLFunction() or func.GetInfo("extension") in extensions:
is_mojo_extension = func.GetInfo("extension") in _MOJO_EXPOSED_EXTENSIONS
if func.IsCoreGLFunction() or is_mojo_extension:
file.Write("MojoGLES2MakeCurrent(context_);");
func_return = "gl" + func.original_name + "(" + \
func.MakeOriginalArgString("") + ");"
if func.return_type == "void":
if func.original_name == "ResizeCHROMIUM":
file.Write("MGLResizeSurface(width, height);");
elif func.return_type == "void":
file.Write(func_return);
else:
file.Write("return " + func_return);
Expand Down Expand Up @@ -10186,9 +10187,16 @@ 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"
namespace mojo {
Expand Down Expand Up @@ -10585,10 +10593,6 @@ def main(argv):
"gpu/command_buffer/common/gles2_cmd_format_test_autogen.h")
gen.WriteGLES2InterfaceHeader(
"gpu/command_buffer/client/gles2_interface_autogen.h")
gen.WriteMojoGLES2ImplHeader(
"mojo/gpu/mojo_gles2_impl_autogen.h")
gen.WriteMojoGLES2Impl(
"mojo/gpu/mojo_gles2_impl_autogen.cc")
gen.WriteGLES2InterfaceStub(
"gpu/command_buffer/client/gles2_interface_stub_autogen.h")
gen.WriteGLES2InterfaceStubImpl(
Expand Down Expand Up @@ -10632,16 +10636,18 @@ def main(argv):
gen.WriteCommonUtilsImpl(
"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_extensions = ["CHROMIUM_texture_mailbox", "CHROMIUM_sync_point",
"CHROMIUM_sub_image", "CHROMIUM_miscellaneous",
"CHROMIUM_resize", "EXT_debug_marker",
"OES_vertex_array_object", "occlusion_query_EXT"]
for extension in mojo_extensions:
for extension in _MOJO_EXPOSED_EXTENSIONS:
gen.WriteMojoGLCallVisitorForExtension(
mojo_gles2_prefix + "_" + extension.lower() + "_autogen.h", extension)

gen.WriteMojoGLES2ImplHeader(
"mojo/gpu/mojo_gles2_impl_autogen.h")
gen.WriteMojoGLES2Impl(
"mojo/gpu/mojo_gles2_impl_autogen.cc")

Format(gen.generated_cpp_filenames)

if gen.errors > 0:
Expand Down
7 changes: 4 additions & 3 deletions gpu/command_buffer/service/gl_surface_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
#define GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_

#include "ui/gl/gl_surface.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/gfx/swap_result.h"
#include "ui/gl/gl_surface.h"

namespace gpu {

Expand All @@ -18,8 +19,8 @@ class GLSurfaceMock : public gfx::GLSurface {
MOCK_METHOD0(Destroy, void());
MOCK_METHOD1(Resize, bool(const gfx::Size& size));
MOCK_METHOD0(IsOffscreen, bool());
MOCK_METHOD0(SwapBuffers, bool());
MOCK_METHOD4(PostSubBuffer, bool(int x, int y, int width, int height));
MOCK_METHOD0(SwapBuffers, gfx::SwapResult());
MOCK_METHOD4(PostSubBuffer, gfx::SwapResult(int x, int y, int width, int height));
MOCK_METHOD0(SupportsPostSubBuffer, bool());
MOCK_METHOD0(GetSize, gfx::Size());
MOCK_METHOD0(GetHandle, void*());
Expand Down
5 changes: 3 additions & 2 deletions gpu/command_buffer/service/gles2_cmd_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8222,7 +8222,8 @@ error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM(
gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer(
is_offscreen ? offscreen_size_ : surface_->GetSize());
}
if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) {
if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height) !=
gfx::SwapResult::SWAP_FAILED) {
return error::kNoError;
} else {
LOG(ERROR) << "Context lost because PostSubBuffer failed.";
Expand Down Expand Up @@ -10347,7 +10348,7 @@ void GLES2DecoderImpl::DoSwapBuffers() {
glFlush();
}
} else {
if (!surface_->SwapBuffers()) {
if (surface_->SwapBuffers() == gfx::SwapResult::SWAP_FAILED) {
LOG(ERROR) << "Context lost because SwapBuffers failed.";
if (!CheckResetStatus()) {
MarkContextLost(error::kUnknown);
Expand Down
111 changes: 0 additions & 111 deletions mojo/BUILD.gn

This file was deleted.

11 changes: 0 additions & 11 deletions mojo/OWNERS

This file was deleted.

Loading

0 comments on commit c8eff5e

Please sign in to comment.