Commit 8deb674e authored by jamesr's avatar jamesr Committed by Commit bot

Fix up gles2 thunk targets a bit

This puts the gles2 thunks target in a more reasonable location, stops abusing
static_library to hide dependency issues, and stop the view manager client side
library from pretending to know which sort of gles2 to link against. It uses
the gles2 headers but depending on whether the lib is being linked into an
application or linked into a target that links in the shell lib (as is done in
unit tests) it needs a different implementation. This also deletes the unused
//mojo/public/gles2/gles2_interface.h file - if we want this we can pull it
back but since nobody is using it now it's kind of a waste of space. If we do
want it, it should go in //mojo/public/cpp/gles2 since it's a C++ wrapper.

R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/604223002

Cr-Commit-Position: refs/heads/master@{#297040}
parent 362af2a5
...@@ -16,6 +16,7 @@ shared_library("png_viewer") { ...@@ -16,6 +16,7 @@ shared_library("png_viewer") {
"//mojo/public/c/system:for_shared_library", "//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//mojo/public/cpp/utility", "//mojo/public/cpp/utility",
"//mojo/public/gles2:for_shared_library",
"//mojo/services/public/cpp/view_manager", "//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/content_handler", "//mojo/services/public/interfaces/content_handler",
"//mojo/services/public/interfaces/network", "//mojo/services/public/interfaces/network",
......
...@@ -15,49 +15,21 @@ ...@@ -15,49 +15,21 @@
# //mojo/public/gles2:for_shared_library to your deps # //mojo/public/gles2:for_shared_library to your deps
group("for_shared_library") { group("for_shared_library") {
public_configs = [ "//third_party/khronos:khronos_headers" ]
public_deps = [ "//mojo/public/c/gles2" ]
if (is_component_build) { if (is_component_build) {
deps = [ "//mojo/gles2" ] deps = [ "//mojo/gles2" ]
} else { } else {
deps = [ ":gles2" ] deps = [ "//mojo/public/platform/native:gles2_thunks" ]
} }
} }
group("for_component") { group("for_component") {
if (is_component_build) {
deps = [ "//mojo/gles2" ]
}
}
# GYP version: mojo/mojo_public.gypi:mojo_gles2
static_library("gles2") {
visibility = [ ":for_shared_library" ]
sources = [
"../platform/native/gles2_thunks.cc",
"../platform/native/gles2_thunks.h",
"../platform/native/gles2_impl_thunks.cc",
"../platform/native/gles2_impl_thunks.h",
"../platform/native/gles2_impl_chromium_texture_mailbox_thunks.cc",
"../platform/native/gles2_impl_chromium_texture_mailbox_thunks.h",
"../platform/native/gles2_impl_chromium_sync_point_thunks.cc",
"../platform/native/gles2_impl_chromium_sync_point_thunks.h",
"gles2_interface.h",
]
public_configs = [ "//third_party/khronos:khronos_headers" ] public_configs = [ "//third_party/khronos:khronos_headers" ]
public_deps = [ "//mojo/public/c/gles2" ] public_deps = [ "//mojo/public/c/gles2" ]
defines = [ if (is_component_build) {
"MOJO_GLES2_IMPLEMENTATION", deps = [ "//mojo/gles2" ]
]
deps = [
"//mojo/public/c/environment",
"//mojo/public/c/system",
]
if (is_mac) {
# TODO(GYP): Make it a run-path dependent library.
# 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
} }
} }
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_PUBLIC_GLES2_GLES2_INTERFACE_H_
#define MOJO_PUBLIC_GLES2_GLES2_INTERFACE_H_
#include <GLES2/gl2.h>
namespace mojo {
class GLES2Interface {
public:
virtual ~GLES2Interface() {}
#define VISIT_GL_CALL(Function, ReturnType, PARAMETERS, ARGUMENTS) \
virtual ReturnType Function PARAMETERS = 0;
#include "mojo/public/c/gles2/gles2_call_visitor_autogen.h"
#undef VISIT_GL_CALL
};
} // namespace mojo
#endif // MOJO_PUBLIC_GLES2_GLES2_INTERFACE_H_
...@@ -24,3 +24,36 @@ source_set("system_thunks") { ...@@ -24,3 +24,36 @@ source_set("system_thunks") {
# that all dependent targets remove that link flag. Since GN uses a # that all dependent targets remove that link flag. Since GN uses a
# source_set here, this flag change is not needed. # source_set here, this flag change is not needed.
} }
# GYP version: mojo/mojo_public.gypi:mojo_gles2
source_set("gles2_thunks") {
visibility = [ "//mojo/public/gles2:for_shared_library" ]
sources = [
"gles2_thunks.cc",
"gles2_thunks.h",
"gles2_impl_thunks.cc",
"gles2_impl_thunks.h",
"gles2_impl_chromium_texture_mailbox_thunks.cc",
"gles2_impl_chromium_texture_mailbox_thunks.h",
"gles2_impl_chromium_sync_point_thunks.cc",
"gles2_impl_chromium_sync_point_thunks.h",
]
defines = [
"MOJO_GLES2_IMPLEMENTATION",
]
configs += [ "//third_party/khronos:khronos_headers" ]
deps = [
"//mojo/public/c/gles2",
"//mojo/public/c/environment",
"//mojo/public/c/system",
]
if (is_mac) {
# TODO(GYP): Make it a run-path dependent library.
# 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
}
}
...@@ -33,8 +33,8 @@ source_set("view_manager") { ...@@ -33,8 +33,8 @@ source_set("view_manager") {
"//cc/surfaces", "//cc/surfaces",
"//gpu", "//gpu",
"//mojo/application", "//mojo/application",
"//mojo/public/c/gles2",
"//mojo/public/cpp/bindings:bindings", "//mojo/public/cpp/bindings:bindings",
"//mojo/public/gles2:for_shared_library",
"//mojo/public/interfaces/application", "//mojo/public/interfaces/application",
"//mojo/services/public/cpp/geometry", "//mojo/services/public/cpp/geometry",
"//mojo/services/public/cpp/surfaces", "//mojo/services/public/cpp/surfaces",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment