Commit 09039c14 authored by brettw's avatar brettw Committed by Commit bot

Enable GN check for gpu and rlz

Rlz already passed on Windows.

GPU had a bunch of errors which are fixed here by adding the necessary dependencies and in a few cases removing unnecessary headers.

gpu_memory_buffer_manager.h included stuff from ui/gfx but adding a dependency on //ui/gfx pulls Skia into the NaCl IRT (and mesa into Android) and everything goes badly. The GPU memory buffer stuff turns out to be separable from gfx so I created a new target for this.

The same is true for ui/gfx/native_widget_types.h (this is just some enums in a .h file) so I made a separate target for this as well.

In support of the Skia-in-NaCl problem, I added an assert_no_deps annotation on the NaCl IRT so people will get an error if they accidentally add this Skia dependency (this has come up before, it's easy to add a //ui/gfx dependency in the wrong place). It also fixes the Skia build in NaCl by updating the condition for extra warning to match build config. Without this update, the assert_no_deps won't be reached before an error running the skia build file, which won't make any sense in the context of addnig a random dependency.

Minor cleanup of the use_libpci conditionals that was exposed by this (the define that controlled the header didn't exactly match the corresponding dependencies).

CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel
TBR=jschuh (gpu/ipc build changes)

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

Cr-Commit-Position: refs/heads/master@{#381881}
parent ff43dcf4
...@@ -49,9 +49,7 @@ check_targets = [ ...@@ -49,9 +49,7 @@ check_targets = [
"//gin/*", "//gin/*",
"//google_apis/*", "//google_apis/*",
"//google_update/*", "//google_update/*",
"//gpu/*",
#"//gpu/*", # Lots of errors.
"//gpu:*",
#"//ios/*", #"//ios/*",
"//ipc/*", "//ipc/*",
...@@ -71,7 +69,8 @@ check_targets = [ ...@@ -71,7 +69,8 @@ check_targets = [
"//printing/*", "//printing/*",
#"//remoting/*", # Medium-hard. #"//remoting/*", # Medium-hard.
#"//rlz/*", # Needs checking on Windows. "//rlz/*",
#"//sandbox/*", # Medium-hard. #"//sandbox/*", # Medium-hard.
"//sdch/*", "//sdch/*",
"//skia/*", "//skia/*",
......
...@@ -59,7 +59,11 @@ source_set("client_sources") { ...@@ -59,7 +59,11 @@ source_set("client_sources") {
all_dependent_configs = [ "//third_party/khronos:khronos_headers" ] all_dependent_configs = [ "//third_party/khronos:khronos_headers" ]
deps = [ deps = [
"//base",
"//gpu/command_buffer/common:common_sources", "//gpu/command_buffer/common:common_sources",
"//gpu/command_buffer/common:gles2_utils",
"//ui/gfx:memory_buffer",
"//ui/gfx/geometry",
] ]
} }
...@@ -79,6 +83,8 @@ source_set("gles2_cmd_helper_sources") { ...@@ -79,6 +83,8 @@ source_set("gles2_cmd_helper_sources") {
deps = [ deps = [
":client_sources", ":client_sources",
"//base",
"//gpu/command_buffer/common:common_sources",
] ]
} }
...@@ -145,6 +151,8 @@ component("gles2_implementation") { ...@@ -145,6 +151,8 @@ component("gles2_implementation") {
":gles2_cmd_helper", ":gles2_cmd_helper",
":gles2_interface", ":gles2_interface",
"//base", "//base",
"//gpu/command_buffer/client",
"//gpu/command_buffer/common",
"//gpu/command_buffer/common:gles2_utils", "//gpu/command_buffer/common:gles2_utils",
"//ui/gfx/geometry", "//ui/gfx/geometry",
] ]
...@@ -163,8 +171,11 @@ component("gles2_implementation_no_check") { ...@@ -163,8 +171,11 @@ component("gles2_implementation_no_check") {
] ]
deps = [ deps = [
":client",
":gles2_cmd_helper", ":gles2_cmd_helper",
":gles2_interface",
"//base", "//base",
"//gpu/command_buffer/common",
"//gpu/command_buffer/common:gles2_utils", "//gpu/command_buffer/common:gles2_utils",
"//ui/gfx", "//ui/gfx",
"//ui/gfx/geometry", "//ui/gfx/geometry",
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <GLES3/gl3.h> #include <GLES3/gl3.h>
#include "base/numerics/safe_math.h" #include "base/numerics/safe_math.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h"
namespace gpu { namespace gpu {
......
...@@ -145,6 +145,8 @@ source_set("service_sources") { ...@@ -145,6 +145,8 @@ source_set("service_sources") {
"//base", "//base",
"//base/third_party/dynamic_annotations", "//base/third_party/dynamic_annotations",
"//crypto", "//crypto",
"//gpu/command_buffer/client:client_sources",
"//gpu/command_buffer/common:gles2_utils",
"//gpu/config:config_sources", "//gpu/config:config_sources",
"//third_party/angle:commit_id", "//third_party/angle:commit_id",
"//third_party/angle:translator", "//third_party/angle:translator",
......
...@@ -7,7 +7,7 @@ import("//build/config/ui.gni") ...@@ -7,7 +7,7 @@ import("//build/config/ui.gni")
declare_args() { declare_args() {
# Use the PCI lib to collect GPU information on Linux. # Use the PCI lib to collect GPU information on Linux.
use_libpci = !is_chromecast use_libpci = is_linux && !is_chromecast && (use_x11 || use_ozone)
} }
group("config") { group("config") {
...@@ -95,8 +95,6 @@ source_set("config_sources") { ...@@ -95,8 +95,6 @@ source_set("config_sources") {
} }
if (use_libpci) { if (use_libpci) {
defines = [ "USE_LIBPCI=1" ] defines = [ "USE_LIBPCI=1" ]
}
if (is_linux && use_libpci && (use_x11 || use_ozone)) {
deps += [ "//build/linux:libpci" ] deps += [ "//build/linux:libpci" ]
} }
if (is_linux && use_x11) { if (is_linux && use_x11) {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "ui/gl/gl_switches.h" #include "ui/gl/gl_switches.h"
#if defined(USE_LIBPCI) #if defined(USE_LIBPCI)
#include "library_loaders/libpci.h" #include "library_loaders/libpci.h" // nogncheck
#endif #endif
namespace gpu { namespace gpu {
......
...@@ -25,6 +25,8 @@ source_set("egl") { ...@@ -25,6 +25,8 @@ source_set("egl") {
deps = [ deps = [
"//base", "//base",
"//gpu", "//gpu",
"//gpu:command_buffer_gles2",
"//gpu/command_buffer/client:gles2_c_lib_nocheck",
"//gpu/command_buffer/client:gles2_implementation_no_check", "//gpu/command_buffer/client:gles2_implementation_no_check",
"//gpu/command_buffer/service", "//gpu/command_buffer/service",
"//ui/base", "//ui/base",
......
...@@ -25,15 +25,6 @@ source_set("ipc_common_sources") { ...@@ -25,15 +25,6 @@ source_set("ipc_common_sources") {
"memory_stats.h", "memory_stats.h",
] ]
if (is_android) {
sources += [
"android/surface_texture_manager.cc",
"android/surface_texture_manager.h",
"android/surface_texture_peer.cc",
"android/surface_texture_peer.h",
]
}
configs += [ configs += [
"//gpu:gpu_implementation", "//gpu:gpu_implementation",
"//third_party/khronos:khronos_headers", "//third_party/khronos:khronos_headers",
...@@ -43,5 +34,17 @@ source_set("ipc_common_sources") { ...@@ -43,5 +34,17 @@ source_set("ipc_common_sources") {
"//base", "//base",
"//gpu/command_buffer/common:common_sources", "//gpu/command_buffer/common:common_sources",
"//ipc", "//ipc",
"//ui/gfx:native_widget_types",
] ]
if (is_android) {
sources += [
"android/surface_texture_manager.cc",
"android/surface_texture_manager.h",
"android/surface_texture_peer.cc",
"android/surface_texture_peer.h",
]
deps += [ "//ui/gl" ]
}
} }
...@@ -8,6 +8,7 @@ source_set("skia_bindings") { ...@@ -8,6 +8,7 @@ source_set("skia_bindings") {
"gl_bindings_skia_cmd_buffer.h", "gl_bindings_skia_cmd_buffer.h",
] ]
deps = [ deps = [
"//base",
"//gpu/command_buffer/client:gles2_c_lib", "//gpu/command_buffer/client:gles2_c_lib",
"//skia", "//skia",
] ]
......
...@@ -32,6 +32,13 @@ if (is_nacl) { ...@@ -32,6 +32,13 @@ if (is_nacl) {
"//ppapi/proxy:ipc", "//ppapi/proxy:ipc",
"//ppapi/shared_impl", "//ppapi/shared_impl",
] ]
assert_no_deps = [
# Skia is one of the easiest dependencies to accidentally add since a
# bunch of graphics and GPU code uses it.
"//skia/*",
"//third_party/WebKit/*",
]
} }
# TODO(phosek): We can remove this ugliness if we change the # TODO(phosek): We can remove this ugliness if we change the
......
...@@ -444,7 +444,7 @@ component("skia") { ...@@ -444,7 +444,7 @@ component("skia") {
sources += [ "ext/bitmap_platform_device_skia.cc" ] sources += [ "ext/bitmap_platform_device_skia.cc" ]
} }
if (is_clang) { if (is_clang && !is_nacl) {
# Skia won't compile with some of the more strict clang warnings. # Skia won't compile with some of the more strict clang warnings.
# e.g. it does: # e.g. it does:
# SkASSERT(!"sk_out_of_memory"); # SkASSERT(!"sk_out_of_memory");
......
...@@ -47,6 +47,7 @@ group("blink_for_unittests") { ...@@ -47,6 +47,7 @@ group("blink_for_unittests") {
# GYP version: WebKit/public/blink.gyp:blink_minimal # GYP version: WebKit/public/blink.gyp:blink_minimal
group("blink_minimal") { group("blink_minimal") {
public_deps = [ public_deps = [
":blink_headers",
"//third_party/WebKit/Source/platform:blink_common", "//third_party/WebKit/Source/platform:blink_common",
] ]
} }
......
...@@ -55,8 +55,6 @@ component("gfx") { ...@@ -55,8 +55,6 @@ component("gfx") {
"animation/tween.cc", "animation/tween.cc",
"animation/tween.h", "animation/tween.h",
"break_list.h", "break_list.h",
"buffer_format_util.cc",
"buffer_format_util.h",
"codec/jpeg_codec.cc", "codec/jpeg_codec.cc",
"codec/jpeg_codec.h", "codec/jpeg_codec.h",
"codec/png_codec.cc", "codec/png_codec.cc",
...@@ -99,8 +97,6 @@ component("gfx") { ...@@ -99,8 +97,6 @@ component("gfx") {
"font_render_params_win.cc", "font_render_params_win.cc",
"gdi_util.cc", "gdi_util.cc",
"gdi_util.h", "gdi_util.h",
"generic_shared_memory_id.cc",
"generic_shared_memory_id.h",
"gfx_paths.cc", "gfx_paths.cc",
"gfx_paths.h", "gfx_paths.h",
"icon_util.cc", "icon_util.cc",
...@@ -135,12 +131,9 @@ component("gfx") { ...@@ -135,12 +131,9 @@ component("gfx") {
"linux_font_delegate.h", "linux_font_delegate.h",
"mac/coordinate_conversion.h", "mac/coordinate_conversion.h",
"mac/coordinate_conversion.mm", "mac/coordinate_conversion.mm",
"mac/io_surface.cc",
"mac/io_surface.h",
"mac/nswindow_frame_controls.h", "mac/nswindow_frame_controls.h",
"mac/nswindow_frame_controls.mm", "mac/nswindow_frame_controls.mm",
"mac/scoped_cocoa_disable_screen_updates.h", "mac/scoped_cocoa_disable_screen_updates.h",
"native_widget_types.h",
"nine_image_painter.cc", "nine_image_painter.cc",
"nine_image_painter.h", "nine_image_painter.h",
"path.cc", "path.cc",
...@@ -247,8 +240,6 @@ component("gfx") { ...@@ -247,8 +240,6 @@ component("gfx") {
"canvas_paint_mac.mm", "canvas_paint_mac.mm",
"canvas_skia.cc", "canvas_skia.cc",
"canvas_skia_paint.h", "canvas_skia_paint.h",
"gpu_memory_buffer.cc",
"gpu_memory_buffer.h",
"image/canvas_image_source.cc", "image/canvas_image_source.cc",
"image/canvas_image_source.h", "image/canvas_image_source.h",
"image/image_skia_operations.cc", "image/image_skia_operations.cc",
...@@ -265,6 +256,7 @@ component("gfx") { ...@@ -265,6 +256,7 @@ component("gfx") {
"//build/config/compiler:no_size_t_to_int_warning", "//build/config/compiler:no_size_t_to_int_warning",
] ]
# This is part of the gfx component in the component build.
defines = [ "GFX_IMPLEMENTATION" ] defines = [ "GFX_IMPLEMENTATION" ]
deps = [ deps = [
...@@ -280,6 +272,8 @@ component("gfx") { ...@@ -280,6 +272,8 @@ component("gfx") {
"//ui/gfx/geometry", "//ui/gfx/geometry",
] ]
public_deps = [ public_deps = [
":memory_buffer_sources",
":native_widget_types",
"//base", "//base",
"//skia", "//skia",
"//third_party/icu", "//third_party/icu",
...@@ -428,10 +422,6 @@ component("gfx") { ...@@ -428,10 +422,6 @@ component("gfx") {
sources -= [ "path_x11.cc" ] sources -= [ "path_x11.cc" ]
} }
if (use_ozone) {
sources += [ "native_pixmap_handle_ozone.h" ]
}
if (use_cairo) { if (use_cairo) {
configs += [ "//build/config/linux:pangocairo" ] configs += [ "//build/config/linux:pangocairo" ]
} }
...@@ -594,6 +584,69 @@ action("aggregate_vector_icons") { ...@@ -594,6 +584,69 @@ action("aggregate_vector_icons") {
# Looking for gfx_geometry? It's //ui/gfx/geometry:geometry # Looking for gfx_geometry? It's //ui/gfx/geometry:geometry
# Depend on this to use native_widget_types.h without pulling in all of gfx.
source_set("native_widget_types") {
public = [
"native_widget_types.h",
]
public_deps = [
"//base",
]
}
# The GPU memory buffer stuff is separate from "gfx" to allow GPU-related
# things to use these files without pulling in all of gfx, which includes large
# things like Skia.
#
# The structure here allows the memory buffer to be part of the gfx component
# in the component build, but be a separate source set in a static build.
group("memory_buffer") {
if (is_component_build) {
public_deps = [
":gfx",
]
} else {
public_deps = [
":memory_buffer_sources",
]
}
}
source_set("memory_buffer_sources") {
visibility = [ ":*" ] # Depend on through ":memory_buffer".
# TODO(brettw) refactor this so these sources are in a coherent directory
# structure rather than random samplings of ui/gfx and ui/gfx/mac.
sources = [
"buffer_format_util.cc",
"buffer_format_util.h",
"buffer_types.h",
"generic_shared_memory_id.cc",
"generic_shared_memory_id.h",
"gfx_export.h",
"mac/io_surface.cc",
"mac/io_surface.h",
]
if (!is_ios) {
sources += [
"gpu_memory_buffer.cc",
"gpu_memory_buffer.h",
]
}
if (use_ozone) {
sources += [ "native_pixmap_handle_ozone.h" ]
}
defines = [ "GFX_IMPLEMENTATION" ]
deps = [
"//base",
"//ui/gfx/geometry",
]
}
source_set("test_support") { source_set("test_support") {
testonly = true testonly = true
sources = [ sources = [
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/logging.h" #include "base/logging.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "ui/gfx/gfx_export.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include <jni.h> #include <jni.h>
......
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