Commit 07a8725b authored by brettw@chromium.org's avatar brettw@chromium.org

Add GN buildfile for gfx

Adds libjpeg and some global flags for Ozone from the GYP build.

Improves error messages for mismatched item types I noticed when writing this patch (changes in builder.cc).

BUG=
R=bradnelson@google.com

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263086 0039d316-1c4b-4281-b951-d872f2087c98
parent 0e83fe8c
......@@ -44,7 +44,7 @@ group("root") {
"//third_party/zlib",
"//tools/gn",
"//ui/events",
"//ui/gfx/geometry",
"//ui/gfx",
"//url",
]
......
......@@ -29,6 +29,10 @@ config("executable_ldconfig") {
]
}
pkg_config("dridrm") {
packages = [ "libdrm" ]
}
config("fontconfig") {
libs = [ "fontconfig" ]
}
......
......@@ -60,3 +60,4 @@ use_glib = is_linux
use_clipboard_aurax11 = is_linux && use_aura && use_x11
ozone_platform_dri = use_ozone
......@@ -380,6 +380,8 @@
'src/core/SkPicturePlayback.h',
'src/core/SkPictureRecord.cpp',
'src/core/SkPictureRecord.h',
'src/core/SkPictureShader.cpp',
'src/core/SkPictureShader.h',
'src/core/SkPictureStateTree.cpp',
'src/core/SkPictureStateTree.h',
'src/core/SkPixelRef.cpp',
......
# 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.
source_set("libjpeg") {
sources = [
"jcapimin.c",
"jcapistd.c",
"jccoefct.c",
"jccolor.c",
"jcdctmgr.c",
"jchuff.c",
"jchuff.h",
"jcinit.c",
"jcmainct.c",
"jcmarker.c",
"jcmaster.c",
"jcomapi.c",
"jconfig.h",
"jcparam.c",
"jcphuff.c",
"jcprepct.c",
"jcsample.c",
"jdapimin.c",
"jdapistd.c",
"jdatadst.c",
"jdatasrc.c",
"jdcoefct.c",
"jdcolor.c",
"jdct.h",
"jddctmgr.c",
"jdhuff.c",
"jdhuff.h",
"jdinput.c",
"jdmainct.c",
"jdmarker.c",
"jdmaster.c",
"jdmerge.c",
"jdphuff.c",
"jdpostct.c",
"jdsample.c",
"jerror.c",
"jerror.h",
"jfdctflt.c",
"jfdctfst.c",
"jfdctint.c",
"jidctflt.c",
"jidctfst.c",
"jidctint.c",
"jinclude.h",
"jmemmgr.c",
"jmemnobs.c",
"jmemsys.h",
"jmorecfg.h",
"jpegint.h",
"jpeglib.h",
"jquant1.c",
"jquant2.c",
"jutils.c",
"jversion.h",
]
defines = [ "NO_GETENV" ] # getenv() is not thread-safe.
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
......@@ -251,6 +251,7 @@ BuilderRecord* Builder::GetOrCreateRecordOfType(const Label& label,
if (!record) {
// Not seen this record yet, create a new one.
record = new BuilderRecord(type, label);
record->set_originally_referenced_from(request_from);
records_[label] = record;
return record;
}
......@@ -259,12 +260,14 @@ BuilderRecord* Builder::GetOrCreateRecordOfType(const Label& label,
if (record->type() != type) {
*err = Err(request_from, "Item type does not match.",
"The item \"" + label.GetUserVisibleName(false) +
"\" was expected\nto be a " +
"\"\nwas expected to be a " +
BuilderRecord::GetNameForType(type) +
" but was previously\n referenced as a " +
" but was previously referenced as a " +
BuilderRecord::GetNameForType(record->type()));
err->AppendSubErr(Err(record->originally_referenced_from(),
"The previous reference was here."));
if (record->originally_referenced_from()) {
err->AppendSubErr(Err(record->originally_referenced_from(),
"The previous reference was here."));
}
return NULL;
}
......
# 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.
import("//build/config/ui.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
component("gfx") {
sources = [
"android/device_display_info.cc",
"android/device_display_info.h",
"android/gfx_jni_registrar.cc",
"android/gfx_jni_registrar.h",
"android/java_bitmap.cc",
"android/java_bitmap.h",
"android/scroller.cc",
"android/scroller.h",
"android/shared_device_display_info.cc",
"android/shared_device_display_info.h",
"android/view_configuration.cc",
"android/view_configuration.h",
"animation/animation.cc",
"animation/animation.h",
"animation/animation_container.cc",
"animation/animation_container.h",
"animation/animation_container_element.h",
"animation/animation_container_observer.h",
"animation/animation_delegate.h",
"animation/linear_animation.cc",
"animation/linear_animation.h",
"animation/multi_animation.cc",
"animation/multi_animation.h",
"animation/slide_animation.cc",
"animation/slide_animation.h",
"animation/throb_animation.cc",
"animation/throb_animation.h",
"animation/tween.cc",
"animation/tween.h",
"blit.cc",
"blit.h",
"break_list.h",
"canvas.cc",
"canvas.h",
"canvas_android.cc",
"canvas_paint_mac.h",
"canvas_paint_mac.mm",
"canvas_paint_win.cc",
"canvas_paint_win.h",
"canvas_skia.cc",
"canvas_skia_paint.h",
"codec/jpeg_codec.cc",
"codec/jpeg_codec.h",
"codec/png_codec.cc",
"codec/png_codec.h",
"color_analysis.cc",
"color_analysis.h",
"color_profile.cc",
"color_profile.h",
"color_profile_mac.cc",
"color_profile_win.cc",
"color_utils.cc",
"color_utils.h",
"display.cc",
"display.h",
"display_observer.cc",
"display_observer.h",
"favicon_size.cc",
"favicon_size.h",
"font.cc",
"font.h",
"font_fallback_win.cc",
"font_fallback_win.h",
"font_list.cc",
"font_list.h",
"font_list_impl.cc",
"font_list_impl.h",
"font_render_params_android.cc",
"font_render_params_linux.cc",
"font_render_params_linux.h",
"font_smoothing_win.cc",
"font_smoothing_win.h",
"frame_time.h",
"gdi_util.cc",
"gdi_util.h",
"gfx_export.h",
"gfx_paths.cc",
"gfx_paths.h",
"gpu_memory_buffer.cc",
"gpu_memory_buffer.h",
"icon_util.cc",
"icon_util.h",
"image/canvas_image_source.cc",
"image/canvas_image_source.h",
"image/image.cc",
"image/image.h",
"image/image_family.cc",
"image/image_family.h",
"image/image_ios.mm",
"image/image_mac.mm",
"image/image_png_rep.cc",
"image/image_png_rep.h",
"image/image_skia.cc",
"image/image_skia.h",
"image/image_skia_operations.cc",
"image/image_skia_operations.h",
"image/image_skia_rep.cc",
"image/image_skia_rep.h",
"image/image_skia_source.h",
"image/image_skia_util_ios.h",
"image/image_skia_util_ios.mm",
"image/image_skia_util_mac.h",
"image/image_skia_util_mac.mm",
"image/image_util.cc",
"image/image_util.h",
"image/image_util_ios.mm",
"interpolated_transform.cc",
"interpolated_transform.h",
"linux_font_delegate.cc",
"linux_font_delegate.h",
"mac/scoped_ns_disable_screen_updates.h",
"native_widget_types.h",
"nine_image_painter.cc",
"nine_image_painter.h",
"ozone/dri/dri_skbitmap.cc",
"ozone/dri/dri_skbitmap.h",
"ozone/dri/dri_surface.cc",
"ozone/dri/dri_surface.h",
"ozone/dri/dri_surface_factory.cc",
"ozone/dri/dri_surface_factory.h",
"ozone/dri/dri_vsync_provider.cc",
"ozone/dri/dri_vsync_provider.h",
"ozone/dri/dri_wrapper.cc",
"ozone/dri/dri_wrapper.h",
"ozone/dri/hardware_display_controller.cc",
"ozone/dri/hardware_display_controller.h",
"ozone/impl/file_surface_factory.cc",
"ozone/impl/file_surface_factory.h",
"ozone/surface_factory_ozone.cc",
"ozone/surface_factory_ozone.h",
"ozone/surface_ozone_base.cc",
"ozone/surface_ozone_base.h",
"ozone/surface_ozone.h",
"ozone/overlay_candidates_ozone.cc",
"ozone/overlay_candidates_ozone.h",
"pango_util.cc",
"pango_util.h",
"path.cc",
"path.h",
"path_aura.cc",
"path_win.cc",
"path_win.h",
"path_x11.cc",
"path_x11.h",
"platform_font.h",
"platform_font_android.cc",
"platform_font_ios.h",
"platform_font_ios.mm",
"platform_font_mac.h",
"platform_font_mac.mm",
"platform_font_ozone.cc",
"platform_font_pango.cc",
"platform_font_pango.h",
"platform_font_win.cc",
"platform_font_win.h",
"range/range.cc",
"range/range.h",
"range/range_mac.mm",
"range/range_win.cc",
"render_text.cc",
"render_text.h",
"render_text_mac.cc",
"render_text_mac.h",
"render_text_ozone.cc",
"render_text_pango.cc",
"render_text_pango.h",
"render_text_win.cc",
"render_text_win.h",
"scoped_canvas.h",
"scoped_cg_context_save_gstate_mac.h",
"scoped_ns_graphics_context_save_gstate_mac.h",
"scoped_ns_graphics_context_save_gstate_mac.mm",
"scoped_ui_graphics_push_context_ios.h",
"scoped_ui_graphics_push_context_ios.mm",
"screen.cc",
"screen.h",
"screen_android.cc",
"screen_aura.cc",
"screen_ios.mm",
"screen_mac.mm",
"screen_win.cc",
"screen_win.h",
"scrollbar_size.cc",
"scrollbar_size.h",
"selection_model.cc",
"selection_model.h",
"sequential_id_generator.cc",
"sequential_id_generator.h",
"shadow_value.cc",
"shadow_value.h",
"skbitmap_operations.cc",
"skbitmap_operations.h",
"skia_util.cc",
"skia_util.h",
"switches.cc",
"switches.h",
"sys_color_change_listener.cc",
"sys_color_change_listener.h",
"text_constants.h",
"text_elider.cc",
"text_elider.h",
"text_utils.cc",
"text_utils.h",
"text_utils_android.cc",
"text_utils_ios.mm",
"text_utils_skia.cc",
"transform.cc",
"transform.h",
"transform_util.cc",
"transform_util.h",
"ui_gfx_exports.cc",
"utf16_indexing.cc",
"utf16_indexing.h",
"vsync_provider.h",
"win/dpi.cc",
"win/dpi.h",
"win/hwnd_util.cc",
"win/hwnd_util.h",
"win/scoped_set_map_mode.h",
"win/singleton_hwnd.cc",
"win/singleton_hwnd.h",
"win/window_impl.cc",
"win/window_impl.h",
"x/x11_atom_cache.cc",
"x/x11_atom_cache.h",
"x/x11_error_tracker.cc",
"x/x11_error_tracker.h",
"x/x11_types.cc",
"x/x11_types.h",
]
defines = [ "GFX_IMPLEMENTATION" ]
deps = [
"//base",
"//base:i18n",
"//base:base_static",
"//base/third_party/dynamic_annotations",
"//skia",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/libpng",
"//third_party/zlib",
"//ui/gfx/geometry",
]
# iOS.
if (is_ios) {
sources -= [
"codec/jpeg_codec.cc",
"codec/jpeg_codec.h",
]
} else {
deps += [ "//third_party/libjpeg" ]
}
# Android.
if (is_android) {
sources -= [
"animation/throb_animation.cc",
"canvas_skia.cc"
"display_observer.cc",
"selection_model.cc",
]
if (use_aura) {
sources -= [ "screen_android.cc" ]
} else {
sources -= [ "path.cc" ]
}
if (!is_android_webview_build) {
deps += [ "//base:base_java" ]
}
deps += [ ":jni_headers" ]
libs = [
"android",
"jnigraphics",
]
}
if (is_android || is_ios) {
sources -= [
"render_text.cc",
"render_text.h",
"text_utils_skia.cc",
]
}
# Windows.
if (is_win) {
cflags = [
"/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
"/wd4324", # Structure was padded due to __declspec(align()), which is
# uninteresting.
]
} else {
sources -= [
"gdi_util.cc",
"gdi_util.h",
"icon_util.cc",
"icon_util.h",
]
}
# Linux.
if (is_linux) {
configs += [ "//build/config/linux:fontconfig" ]
}
# Ozone stuff.
if (!use_ozone) {
sources -= [
"ozone/impl/file_surface_factory.cc",
"ozone/impl/file_surface_factory.h",
"ozone/surface_factory_ozone.cc",
"ozone/surface_factory_ozone.h",
"ozone/surface_ozone_base.cc",
"ozone/surface_ozone_base.h",
"ozone/surface_ozone.h",
"ozone/overlay_candidates_ozone.cc",
"ozone/overlay_candidates_ozone.h",
]
}
if (ozone_platform_dri) {
configs += [ "//build/config/linux:dridrm" ]
} else {
sources -= [
"ozone/dri/dri_skbitmap.cc",
"ozone/dri/dri_skbitmap.h",
"ozone/dri/dri_surface.cc",
"ozone/dri/dri_surface.h",
"ozone/dri/dri_surface_factory.cc",
"ozone/dri/dri_surface_factory.h",
"ozone/dri/dri_vsync_provider.cc",
"ozone/dri/dri_vsync_provider.h",
"ozone/dri/dri_wrapper.cc",
"ozone/dri/dri_wrapper.h",
"ozone/dri/hardware_display_controller.cc",
"ozone/dri/hardware_display_controller.h",
]
}
if (!use_aura) {
sources -= [
"nine_image_painter.cc",
"nine_image_painter.h",
]
}
if (use_x11) {
configs += [ "//build/config/linux:x11" ]
}
if (use_pango) {
sources -= [
"platform_font_ozone.cc",
"render_text_ozone.cc",
]
configs += [ "//build/config/linux:pangocairo" ]
}
}
source_set("gfx_test_support") {
sources = [
"test/gfx_util.cc",
"test/gfx_util.h",
"test/ui_cocoa_test_helper.h",
"test/ui_cocoa_test_helper.mm",
]
deps = [
"//base",
"//skia",
"//testing/gtest",
]
if (is_ios) {
# The cocoa files don't apply to iOS.
sources -= [
"test/ui_cocoa_test_helper.h",
"test/ui_cocoa_test_helper.mm",
]
}
}
test("gfx_unittests") {
sources = [
"geometry/box_unittest.cc",
"geometry/cubic_bezier_unittest.cc",
"geometry/insets_unittest.cc",
"geometry/matrix3_unittest.cc",
"geometry/point_unittest.cc",
"geometry/point3_unittest.cc",
"geometry/quad_unittest.cc",
"geometry/rect_unittest.cc",
"geometry/safe_integer_conversions_unittest.cc",
"geometry/size_unittest.cc",
"geometry/vector2d_unittest.cc",
"geometry/vector3d_unittest.cc",
"range/range_unittest.cc",
]
deps = [
":gfx",
"//base",
"//base/test:run_all_unittests",
"//base/test:run_all_unittests",
"//testing/gtest",
"//ui/gfx/geometry",
]
}
if (is_android) {
# TODO(brettw) gfx_jni_headers
}
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