diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn index 55b675af4339..dae0d15be7a5 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn @@ -1,16 +1,39 @@ -# Copyright 2024 The Cobalt Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright 2014 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ozone.gni") +import("//build/config/ui.gni") +import("//testing/libfuzzer/fuzzer_test.gni") +import("//testing/test.gni") + +if (is_ios) { + import("//build/config/ios/bundle_data_from_filelist.gni") +} + +if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") +} + +# Several targets want to include this header file, and some of them are +# child dependencies of "gfx". Therefore, we separate it out here so multiple +# targets can all have a dependency for header checking purposes without +# creating circular dependencies. +source_set("gfx_export") { + sources = [ "gfx_export.h" ] +} + +component("gfx") { + # This is part of the gfx component in the component build. + defines = [ "GFX_IMPLEMENTATION" ] + + public_deps = [ + ":color_space", + "//ui/gfx/geometry", + ] +} component("color_space") { sources = [ @@ -31,9 +54,90 @@ component("color_space") { defines = [ "COLOR_SPACE_IMPLEMENTATION" ] } -component("gfx") { +# Depend on this to use image/resize_image_dimensions.h without pulling in +# all of gfx. +source_set("resize_image_dimensions") { + sources = [ "image/resize_image_dimensions.h" ] +} + +group("selection_bound") { + if (is_component_build) { + public_deps = [ ":gfx" ] + } else { + public_deps = [ ":selection_bound_sources" ] + } +} + +# Depend on this to use selection_bound.h without pulling in all of gfx. +# Cannot be a static_library in component builds due to exported functions +source_set("selection_bound_sources") { + visibility = [ ":*" ] + + sources = [ + "gfx_export.h", + "selection_bound.cc", + "selection_bound.h", + ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] + + defines = [ "GFX_IMPLEMENTATION" ] + public_deps = [ - ":color_space", - "geometry:geometry", + "//base", + "//ui/gfx/geometry", ] } + +# Depend on this to use buffer_types.h without pulling in all of gfx. +source_set("buffer_types") { + sources = [ "buffer_types.h" ] +} + +fuzzer_test("color_analysis_fuzzer") { + sources = [ "color_analysis_fuzzer.cc" ] + + deps = [ ":gfx" ] +} + +fuzzer_test("color_transform_fuzzer") { + sources = [ "color_transform_fuzzer.cc" ] + + dict = "//testing/libfuzzer/fuzzers/dicts/icc.dict" + + deps = [ ":gfx" ] + + libfuzzer_options = [ "max_len=4194304" ] +} + +fuzzer_test("render_text_fuzzer") { + sources = [ "render_text_fuzzer.cc" ] + + deps = [ + ":gfx", + "//base", + "//base/test:test_support", + ] + + dict = "test/data/render_text/unicode_text_fuzzer.dict" +} + +fuzzer_test("render_text_api_fuzzer") { + sources = [ "render_text_api_fuzzer.cc" ] + + deps = [ + ":gfx", + "//base", + "//base/test:test_support", + "//build:chromeos_buildflags", + ] + + dict = "test/data/render_text/unicode_text_fuzzer.dict" +} + +if (is_ios) { + bundle_data_from_filelist("unit_tests_bundle_data") { + testonly = true + filelist_name = "test/data/unit_tests_bundle_data.filelist" + } +} diff --git a/ui/gfx/BUILD.gn.chromium b/ui/gfx/BUILD.gn.chromium deleted file mode 100644 index 34a269ee4d47..000000000000 --- a/ui/gfx/BUILD.gn.chromium +++ /dev/null @@ -1,1002 +0,0 @@ -# Copyright 2014 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/features.gni") -import("//build/config/ozone.gni") -import("//build/config/ui.gni") -import("//device/vr/buildflags/buildflags.gni") -import("//testing/libfuzzer/fuzzer_test.gni") -import("//testing/test.gni") - -if (is_ios) { - import("//build/config/ios/bundle_data_from_filelist.gni") -} - -if (is_android) { - import("//build/config/android/config.gni") - import("//build/config/android/rules.gni") -} - -# Several targets want to include this header file, and some of them are -# child dependencies of "gfx". Therefore, we separate it out here so multiple -# targets can all have a dependency for header checking purposes without -# creating circular dependencies. -source_set("gfx_export") { - sources = [ "gfx_export.h" ] -} - -# Used for color generation at build time without importing all the gfx. -component("color_utils") { - sources = [ - "color_palette.h", - "color_utils.cc", - "color_utils.h", - ] - defines = [ "GFX_IMPLEMENTATION" ] - public_deps = [ - ":gfx_export", - "//base", - "//skia", - "//ui/gfx/geometry", - ] -} - -component("gfx_skia") { - sources = [ - "gfx_skia_export.h", - "skia_util.cc", - "skia_util.h", - ] - configs += [ "//build/config/compiler:wexit_time_destructors" ] - public_deps = [ - "//base", - "//skia", - ] - defines = [ "GFX_SKIA_IMPLEMENTATION" ] -} - -component("gfx") { - sources = [ - "break_list.h", - "color_analysis.cc", - "color_analysis.h", - "color_conversions.cc", - "color_conversions.h", - "decorated_text.cc", - "decorated_text.h", - "delegated_ink_metadata.cc", - "delegated_ink_metadata.h", - "delegated_ink_point.cc", - "delegated_ink_point.h", - "extension_set.cc", - "extension_set.h", - "favicon_size.cc", - "favicon_size.h", - "font.cc", - "font.h", - "font_fallback.h", - "font_list.cc", - "font_list.h", - "font_list_impl.cc", - "font_list_impl.h", - "font_render_params.cc", - "font_render_params.h", - "font_util.cc", - "font_util.h", - "frame_data.h", - "gdi_util.cc", - "gdi_util.h", - "gpu_extra_info.cc", - "gpu_extra_info.h", - "half_float.cc", - "half_float.h", - "icon_util.cc", - "icon_util.h", - "image/buffer_w_stream.cc", - "image/buffer_w_stream.h", - "image/image.cc", - "image/image.h", - "image/image_family.cc", - "image/image_family.h", - "image/image_internal.h", - "image/image_platform.h", - "image/image_png_rep.cc", - "image/image_png_rep.h", - "image/image_skia.cc", - "image/image_skia.h", - "image/image_skia_rep.h", - "image/image_skia_source.cc", - "image/image_skia_source.h", - "image/image_util.cc", - "image/image_util.h", - "interpolated_transform.cc", - "interpolated_transform.h", - "nine_image_painter.cc", - "nine_image_painter.h", - "overlay_plane_data.cc", - "overlay_plane_data.h", - "overlay_transform_utils.cc", - "overlay_transform_utils.h", - "platform_font.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", - "swap_result.cc", - "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", - "ubidi_deleter.h", - "ui_gfx_exports.cc", - "utf16_indexing.cc", - "utf16_indexing.h", - "vector_icon_types.h", - "vector_icon_utils.cc", - "vector_icon_utils.h", - "video_types.h", - "vsync_provider.cc", - "vsync_provider.h", - ] - if (is_android) { - sources += [ - "android/achoreographer_compat.cc", - "android/achoreographer_compat.h", - "android/android_surface_control_compat.cc", - "android/android_surface_control_compat.h", - "android/java_bitmap.cc", - "android/java_bitmap.h", - "android/view_configuration.cc", - "android/view_configuration.h", - ] - } - if (is_linux || is_chromeos) { - sources += [ - "font_fallback_linux.cc", - "font_fallback_linux.h", - "font_render_params_linux.cc", - "font_render_params_linux.h", - "linux/fontconfig_util.cc", - "linux/fontconfig_util.h", - ] - } - if (is_mac) { - sources += [ - "ca_layer_result.h", - "decorated_text_mac.h", - "decorated_text_mac.mm", - "font_fallback_mac.mm", - "font_render_params_mac.cc", - "image/image_mac.mm", - "image/image_skia_util_mac.h", - "image/image_skia_util_mac.mm", - "image/image_util_mac.mm", - "mac/coordinate_conversion.h", - "mac/coordinate_conversion.mm", - "mac/nswindow_frame_controls.h", - "mac/nswindow_frame_controls.mm", - "mac/scoped_cocoa_disable_screen_updates.h", - "mac/scoped_cocoa_disable_screen_updates.mm", - "platform_font_mac.h", - "platform_font_mac.mm", - "scoped_cg_context_save_gstate_mac.h", - "scoped_ns_graphics_context_save_gstate_mac.h", - "scoped_ns_graphics_context_save_gstate_mac.mm", - ] - } - if (is_win) { - sources += [ - "font_fallback_win.cc", - "font_fallback_win.h", - "font_render_params_win.cc", - "path_win.cc", - "path_win.h", - "system_fonts_win.cc", - "system_fonts_win.h", - "win/crash_id_helper.cc", - "win/crash_id_helper.h", - "win/direct_write.cc", - "win/direct_write.h", - "win/hwnd_util.cc", - "win/hwnd_util.h", - "win/msg_util.h", - "win/physical_size.cc", - "win/physical_size.h", - "win/rendering_window_manager.cc", - "win/rendering_window_manager.h", - "win/scoped_set_map_mode.h", - "win/singleton_hwnd.cc", - "win/singleton_hwnd.h", - "win/singleton_hwnd_hot_key_observer.cc", - "win/singleton_hwnd_hot_key_observer.h", - "win/singleton_hwnd_observer.cc", - "win/singleton_hwnd_observer.h", - "win/text_analysis_source.cc", - "win/text_analysis_source.h", - "win/window_impl.cc", - "win/window_impl.h", - ] - } - if (is_ios) { - sources += [ - "image/image_ios.mm", - "image/image_skia_util_ios.h", - "image/image_skia_util_ios.mm", - "image/image_util_ios.mm", - "ios/NSString+CrStringDrawing.h", - "ios/NSString+CrStringDrawing.mm", - "platform_font_ios.h", - "platform_font_ios.mm", - "scoped_ui_graphics_push_context_ios.h", - "scoped_ui_graphics_push_context_ios.mm", - "text_utils_ios.mm", - ] - if (use_blink) { - sources += [ "font_render_params_mac.cc" ] - } else { - sources += [ - "image/image_skia_rep_ios.cc", - "image/image_skia_rep_ios.h", - ] - } - } - if (use_blink) { - sources += [ - "blit.cc", - "blit.h", - "canvas.cc", - "canvas.h", - "canvas_skia.cc", - "image/canvas_image_source.cc", - "image/canvas_image_source.h", - "image/image_generic.cc", - "image/image_skia_operations.cc", - "image/image_skia_operations.h", - "image/image_skia_rep_default.cc", - "image/image_skia_rep_default.h", - "paint_throbber.cc", - "paint_throbber.h", - "scoped_canvas.cc", - "scoped_canvas.h", - "shadow_util.cc", - "shadow_util.h", - "skia_paint_util.cc", - "skia_paint_util.h", - ] - } - - configs += [ - "//build/config:precompiled_headers", - "//build/config/compiler:wexit_time_destructors", - ] - - # This is part of the gfx component in the component build. - defines = [ "GFX_IMPLEMENTATION" ] - - public_deps = [ - ":color_space", - ":color_utils", - ":gfx_skia", - ":gfx_switches", - ":memory_buffer_sources", - ":native_widget_types", - ":resize_image_dimensions", - ":selection_bound_sources", - "//base", - "//skia", - "//skia:skcms", - "//third_party/icu", - "//ui/gfx/animation", - "//ui/gfx/codec", - "//ui/gfx/geometry", - "//ui/gfx/geometry:geometry_skia", - "//ui/gfx/range", - ] - deps = [ - ":gfx_export", - "//base", - "//base:base_static", - "//base:i18n", - "//base/third_party/dynamic_annotations", - "//build:blink_buildflags", - "//build:chromeos_buildflags", - "//device/vr/buildflags", - "//mojo/public/cpp/bindings:struct_traits", - "//skia", - "//third_party/zlib", - ] - - if (!is_apple) { - sources += [ - "platform_font_skia.cc", - "platform_font_skia.h", - ] - } - - # iOS. - if (is_ios) { - sources += [ "scoped_cg_context_save_gstate_mac.h" ] - public_deps += [ "//ui/gfx/ios:uikit_util" ] - } - - if (use_blink) { - public_deps += [ "//cc/paint" ] - deps += [ "//third_party:freetype_harfbuzz" ] - } - - # Android. - if (is_android) { - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } - - deps += [ ":gfx_jni_headers" ] - libs = [ - "android", - "jnigraphics", - ] - } - - if (use_blink) { - if (is_android || is_fuchsia || is_ios) { - sources += [ - "font_fallback_skia.cc", - "font_render_params_skia.cc", - ] - } - - if (is_android || is_fuchsia || is_win || is_apple) { - sources += [ - "font_fallback_skia_impl.cc", - "font_fallback_skia_impl.h", - ] - } - - sources += [ - "bidi_line_iterator.cc", - "bidi_line_iterator.h", - "harfbuzz_font_skia.cc", - "harfbuzz_font_skia.h", - "paint_vector_icon.cc", - "paint_vector_icon.h", - "render_text.cc", - "render_text.h", - "render_text_harfbuzz.cc", - "render_text_harfbuzz.h", - "text_utils_skia.cc", - ] - } - - # Windows. - if (is_win) { - libs = [ - "setupapi.lib", - "dwmapi.lib", - "dwrite.lib", - ] - public_deps += [ "//components/crash/core/common" ] - } else { - sources -= [ - "gdi_util.cc", - "gdi_util.h", - "icon_util.cc", - "icon_util.h", - "sys_color_change_listener.cc", - "sys_color_change_listener.h", - ] - } - - # Linux. - if (is_linux) { - deps += [ "//ui/linux:linux_ui" ] - } - if (is_linux || is_chromeos) { - deps += [ "//third_party/fontconfig" ] - } - - if (is_apple) { - frameworks = [ "IOSurface.framework" ] - deps += [ "//ui/base:features" ] - } - if (is_mac) { - frameworks += [ - "AppKit.framework", - "CoreFoundation.framework", - "CoreGraphics.framework", - "CoreText.framework", - ] - } - - if ((!use_aura && !toolkit_views) || is_ios) { - sources -= [ - "nine_image_painter.cc", - "nine_image_painter.h", - ] - } - - if (use_ozone) { - deps += [ "//ui/ozone:buildflags" ] - } -} - -component("color_space") { - sources = [ - "color_conversion_sk_filter_cache.cc", - "color_conversion_sk_filter_cache.h", - "color_space.cc", - "color_space.h", - "color_space_export.h", - "color_transform.cc", - "color_transform.h", - "display_color_spaces.cc", - "display_color_spaces.h", - "hdr_metadata.cc", - "hdr_metadata.h", - "hdr_static_metadata.cc", - "hdr_static_metadata.h", - "icc_profile.cc", - "icc_profile.h", - "skia_color_space_util.cc", - "skia_color_space_util.h", - ] - if (is_win) { - sources += [ - "color_space_win.cc", - "color_space_win.h", - ] - } - deps = [ - "//build:chromeos_buildflags", - "//skia:skcms", - "//ui/gfx:buffer_types", - "//ui/gfx/geometry:geometry_skia", - ] - public_deps = [ - "//base", - "//skia", - ] - - if (is_apple && use_blink) { - sources += [ - "hdr_metadata_mac.h", - "hdr_metadata_mac.mm", - ] - frameworks = [ - "CoreFoundation.framework", - "CoreGraphics.framework", - ] - if (is_mac) { - sources += [ - "mac/display_icc_profiles.cc", - "mac/display_icc_profiles.h", - ] - } - } - defines = [ "COLOR_SPACE_IMPLEMENTATION" ] -} - -# Depend on this to use image/resize_image_dimensions.h without pulling in -# all of gfx. -source_set("resize_image_dimensions") { - sources = [ "image/resize_image_dimensions.h" ] -} - -# 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 = [ - ":gfx_export", - "//base", - ] - - if (is_mac) { - sources = [ "native_widget_types.mm" ] - - frameworks = [ "AppKit.framework" ] - } - - deps = [ "//build:chromeos_buildflags" ] -} - -group("selection_bound") { - if (is_component_build) { - public_deps = [ ":gfx" ] - } else { - public_deps = [ ":selection_bound_sources" ] - } -} - -# Depend on this to use selection_bound.h without pulling in all of gfx. -# Cannot be a static_library in component builds due to exported functions -source_set("selection_bound_sources") { - visibility = [ ":*" ] - - sources = [ - "gfx_export.h", - "selection_bound.cc", - "selection_bound.h", - ] - - configs += [ "//build/config/compiler:wexit_time_destructors" ] - - defines = [ "GFX_IMPLEMENTATION" ] - - public_deps = [ - "//base", - "//ui/gfx/geometry", - ] -} - -# Depend on this to use buffer_types.h without pulling in all of gfx. -source_set("buffer_types") { - sources = [ "buffer_types.h" ] -} - -# 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" ] - } -} - -# Cannot be a static_library in component builds due to exported functions -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_usage_util.cc", - "buffer_usage_util.h", - "client_native_pixmap.h", - "client_native_pixmap_factory.h", - "generic_shared_memory_id.cc", - "generic_shared_memory_id.h", - "gfx_export.h", - "gpu_fence.cc", - "gpu_fence.h", - "gpu_fence_handle.cc", - "gpu_fence_handle.h", - "native_pixmap.h", - "overlay_priority_hint.h", - "overlay_transform.h", - "surface_origin.h", - ] - - if (use_blink) { - sources += [ - "ca_layer_params.cc", - "ca_layer_params.h", - "gpu_memory_buffer.cc", - "gpu_memory_buffer.h", - ] - } - - configs += [ "//build/config/compiler:wexit_time_destructors" ] - - defines = [ "GFX_IMPLEMENTATION" ] - - public_deps = [ ":buffer_types" ] - - deps = [ - ":gfx_switches", - ":native_widget_types", - "//base", - "//build:chromecast_buildflags", - "//build:chromeos_buildflags", - "//ui/gfx/geometry", - ] - - if (is_linux || is_chromeos) { - sources += [ - "linux/client_native_pixmap_dmabuf.cc", - "linux/client_native_pixmap_dmabuf.h", - "linux/client_native_pixmap_factory_dmabuf.cc", - "linux/client_native_pixmap_factory_dmabuf.h", - "linux/native_pixmap_dmabuf.cc", - "linux/native_pixmap_dmabuf.h", - ] - - deps += [ "//build/config/linux/libdrm" ] - } - - if (is_linux || is_chromeos || is_android) { - deps += [ "//third_party/libsync" ] - } - - if (use_blink && is_apple) { - sources += [ - "mac/io_surface.cc", - "mac/io_surface.h", - ] - - public_deps += [ "//ui/gfx:color_space" ] - } - - if (is_win) { - public_deps += [ "//ipc:message_support" ] - } - - if ((is_linux || is_chromeos || use_ozone) && !is_nacl) { - sources += [ - "native_pixmap_handle.cc", - "native_pixmap_handle.h", - ] - } -} - -# TODO(ccameron): This can be moved into a separate source_set. -component("gfx_switches") { - sources = [ - "switches.cc", - "switches.h", - "switches_export.h", - ] - - defines = [ "GFX_SWITCHES_IMPLEMENTATION" ] - - deps = [ "//base" ] -} - -static_library("test_support") { - testonly = true - sources = [ - "animation/animation_test_api.cc", - "animation/animation_test_api.h", - "animation/keyframe/test/animation_utils.cc", - "animation/keyframe/test/animation_utils.h", - "animation/test_animation_delegate.h", - "geometry/test/geometry_util.cc", - "geometry/test/geometry_util.h", - "image/image_unittest_util.cc", - "image/image_unittest_util.h", - "test/font_fallback_test_data.cc", - "test/font_fallback_test_data.h", - "test/icc_profiles.cc", - "test/icc_profiles.h", - "test/scoped_default_font_description.h", - "test/sk_color_eq.cc", - "test/sk_color_eq.h", - ] - if (is_apple) { - sources += [ "image/image_unittest_util_apple.mm" ] - } - if (use_fuzzing_engine) { - sources += [ - "geometry/test/fuzzer_util.cc", - "geometry/test/fuzzer_util.h", - ] - } - - public_deps = [ ":gfx" ] - - deps = [ - ":gfx_export", - "//base", - "//base/test:test_support", - "//skia", - "//testing/gtest", - "//ui/gfx/animation", - "//ui/gfx/animation/keyframe", - "//ui/gfx/geometry", - ] - - if (use_blink) { - sources += [ "render_text_test_api.h" ] - - deps += [ "//third_party:freetype_harfbuzz" ] - } -} - -test("gfx_unittests") { - sources = [ - "animation/keyframe/keyframe_animation_unittest.cc", - "animation/keyframe/keyframed_animation_curve_unittest.cc", - "font_names_testing.cc", - "font_names_testing.h", - "font_unittest.cc", - "geometry/linear_gradient_unittest.cc", - "geometry/mask_filter_info_unittest.cc", - "geometry/rrect_f_unittest.cc", - "geometry/transform_operations_unittest.cc", - "geometry/transform_unittest.cc", - "image/buffer_w_stream_unittest.cc", - "image/image_family_unittest.cc", - "image/image_skia_unittest.cc", - "image/image_unittest.cc", - "interpolated_transform_unittest.cc", - "test/run_all_unittests.cc", - "text_elider_unittest.cc", - "text_utils_unittest.cc", - ] - if (is_linux) { - sources += [ "font_render_params_linux_unittest.cc" ] - } - if (is_linux || is_chromeos) { - sources += [ "font_fallback_linux_unittest.cc" ] - } - if (is_apple) { - frameworks = [ "IOSurface.framework" ] - } - if (is_mac) { - sources += [ - "font_fallback_mac_unittest.cc", - "image/image_mac_unittest.mm", - "mac/coordinate_conversion_unittest.mm", - "mac/io_surface_unittest.cc", - "platform_font_mac_unittest.mm", - "range/range_mac_unittest.mm", - ] - } - if (is_win) { - sources += [ "font_fallback_win_unittest.cc" ] - } - if (is_ios) { - sources += [ - "image/image_ios_unittest.mm", - "ios/NSString+CrStringDrawing_unittest.mm", - "ios/uikit_util_unittest.mm", - ] - } - if (is_android) { - sources += [ "android/android_surface_control_compat_unittest.cc" ] - } - - include_dirs = [ "//third_party/skia/include/private" ] - - data = [ "test/data/" ] - - if (!is_ios) { - sources += [ - "animation/animation_container_unittest.cc", - "animation/animation_runner_unittest.cc", - "animation/animation_unittest.cc", - "animation/multi_animation_unittest.cc", - "animation/slide_animation_unittest.cc", - "animation/tween_unittest.cc", - "blit_unittest.cc", - "break_list_unittest.cc", - "canvas_unittest.cc", - "codec/jpeg_codec_unittest.cc", - "codec/png_codec_unittest.cc", - "color_analysis_unittest.cc", - "color_conversions_unittest.cc", - "color_space_unittest.cc", - "color_transform_unittest.cc", - "color_utils_unittest.cc", - "delegated_ink_unittest.cc", - "font_fallback_unittest.cc", - "font_list_unittest.cc", - "geometry/axis_transform2d_unittest.cc", - "geometry/box_unittest.cc", - "geometry/cubic_bezier_unittest.cc", - "geometry/insets_f_unittest.cc", - "geometry/insets_unittest.cc", - "geometry/matrix3_unittest.cc", - "geometry/point3_f_unittest.cc", - "geometry/point_f_unittest.cc", - "geometry/point_unittest.cc", - "geometry/quad_f_unittest.cc", - "geometry/quaternion_unittest.cc", - "geometry/rect_conversions_unittest.cc", - "geometry/rect_f_unittest.cc", - "geometry/rect_unittest.cc", - "geometry/resize_utils_unittest.cc", - "geometry/rounded_corners_f_unittest.cc", - "geometry/size_f_unittest.cc", - "geometry/size_unittest.cc", - "geometry/skia_conversions_unittest.cc", - "geometry/transform_util_unittest.cc", - "geometry/triangle_unittest.cc", - "geometry/vector2d_f_unittest.cc", - "geometry/vector2d_unittest.cc", - "geometry/vector3d_f_unittest.cc", - "half_float_unittest.cc", - "icc_profile_unittest.cc", - "image/image_skia_operations_unittest.cc", - "image/image_util_unittest.cc", - "mojom/mojom_traits_unittest.cc", - "nine_image_painter_unittest.cc", - "overlay_transform_utils_unittest.cc", - "paint_vector_icon_unittest.cc", - "range/range_unittest.cc", - "selection_bound_unittest.cc", - "selection_model_unittest.cc", - "sequential_id_generator_unittest.cc", - "shadow_value_unittest.cc", - "skbitmap_operations_unittest.cc", - "skia_util_unittest.cc", - "utf16_indexing_unittest.cc", - ] - } - - if (is_win) { - sources += [ "system_fonts_win_unittest.cc" ] - } - - if (is_linux || is_chromeos || is_android || is_fuchsia || is_win) { - sources += [ "platform_font_skia_unittest.cc" ] - } - - deps = [ - ":gfx", - ":test_support", - "//base", - "//base/test:test_support", - "//build:chromeos_buildflags", - "//skia", - "//skia:skcms", - "//testing/gtest", - "//third_party/icu:icuuc", - "//third_party/libpng", - "//third_party/zlib", - "//ui/base", - "//ui/gfx/animation", - "//ui/gfx/animation/keyframe", - "//ui/gfx/geometry", - "//ui/gfx/range", - ] - - if (use_blink) { - sources += [ "bidi_line_iterator_unittest.cc" ] - if (!is_ios) { - # TODO(crbug.com/1428953): many render text tests fail on iOS, even when - # use_blink is true. - sources += [ "render_text_unittest.cc" ] - } - deps += [ "//third_party:freetype_harfbuzz" ] - } - - data_deps = [ "//ui/resources:ui_test_pak_data" ] - - if (is_apple) { - deps += [ "//ui/resources:ui_test_pak_bundle_data" ] - } - - if (is_android) { - deps += [ "//ui/android:ui_java" ] - } - - if (is_android || is_fuchsia) { - sources += [ "font_fallback_skia_unittest.cc" ] - } - - if (!use_aura && !is_ios) { - sources -= [ "nine_image_painter_unittest.cc" ] - } - - if (is_win) { - sources += [ - "icon_util_unittest.cc", - "icon_util_unittests.rc", - "icon_util_unittests_resource.h", - "path_win_unittest.cc", - "win/crash_id_helper_unittest.cc", - "win/direct_write_unittest.cc", - "win/text_analysis_source_unittest.cc", - ] - - ldflags = [ - "/DELAYLOAD:d2d1.dll", - "/DELAYLOAD:d3d10_1.dll", - ] - - libs = [ - "d2d1.lib", - "d3d10_1.lib", - "dwrite.lib", - "imm32.lib", - "oleacc.lib", - ] - } - - if (use_blink) { - deps += [ - "//cc/paint", - "//mojo/core/embedder", - "//mojo/public/cpp/bindings", - "//mojo/public/cpp/test_support:test_utils", - "//ui/gfx/geometry/mojom:unit_test", - "//ui/gfx/image/mojom:unit_test", - "//ui/gfx/mojom:test_interfaces", - "//ui/gfx/range/mojom:unit_test", - ] - } - - if (is_linux) { - deps += [ "//ui/linux:test_support" ] - } - - if (is_linux || is_chromeos) { - sources += [ - "linux/fontconfig_util_unittest.cc", - "linux/native_pixmap_dmabuf_unittest.cc", - ] - deps += [ "//third_party/fontconfig" ] - } - - if (is_fuchsia) { - deps += [ "//skia:test_fonts" ] - additional_manifest_fragments = - [ "//build/config/fuchsia/test/test_fonts.shard.test-cml" ] - } -} - -if (is_android) { - generate_jni("gfx_jni_headers") { - sources = [ - "../android/java/src/org/chromium/ui/gfx/Animation.java", - "../android/java/src/org/chromium/ui/gfx/BitmapHelper.java", - "../android/java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java", - ] - } -} - -fuzzer_test("color_analysis_fuzzer") { - sources = [ "color_analysis_fuzzer.cc" ] - - deps = [ ":gfx" ] -} - -fuzzer_test("color_transform_fuzzer") { - sources = [ "color_transform_fuzzer.cc" ] - - dict = "//testing/libfuzzer/fuzzers/dicts/icc.dict" - - deps = [ ":gfx" ] - - libfuzzer_options = [ "max_len=4194304" ] -} - -fuzzer_test("render_text_fuzzer") { - sources = [ "render_text_fuzzer.cc" ] - - deps = [ - ":gfx", - "//base", - "//base/test:test_support", - ] - - dict = "test/data/render_text/unicode_text_fuzzer.dict" -} - -fuzzer_test("render_text_api_fuzzer") { - sources = [ "render_text_api_fuzzer.cc" ] - - deps = [ - ":gfx", - "//base", - "//base/test:test_support", - "//build:chromeos_buildflags", - ] - - dict = "test/data/render_text/unicode_text_fuzzer.dict" -} - -if (is_ios) { - bundle_data_from_filelist("unit_tests_bundle_data") { - testonly = true - filelist_name = "test/data/unit_tests_bundle_data.filelist" - } -} diff --git a/ui/gfx/geometry/BUILD.gn b/ui/gfx/geometry/BUILD.gn index 47361fe2930a..62cf2c06334a 100644 --- a/ui/gfx/geometry/BUILD.gn +++ b/ui/gfx/geometry/BUILD.gn @@ -1,16 +1,6 @@ -# Copyright 2024 The Cobalt Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright 2014 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. component("geometry") { sources = [ @@ -19,18 +9,18 @@ component("geometry") { "point.h", "point3_f.cc", "point3_f.h", - "point_f.cc", - "point_f.h", "point_conversions.cc", "point_conversions.h", + "point_f.cc", + "point_f.h", "rect.cc", "rect.h", "size.cc", "size.h", - "size_f.cc", - "size_f.h", "size_conversions.cc", "size_conversions.h", + "size_f.cc", + "size_f.h", "vector2d.cc", "vector2d.h", "vector2d_f.cc", @@ -40,4 +30,9 @@ component("geometry") { defines = [ "GEOMETRY_IMPLEMENTATION" ] deps = [ "//base" ] + + if (!is_debug) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } } diff --git a/ui/gfx/geometry/BUILD.gn.chromium b/ui/gfx/geometry/BUILD.gn.chromium deleted file mode 100644 index 9a17685c91d2..000000000000 --- a/ui/gfx/geometry/BUILD.gn.chromium +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2014 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -component("geometry") { - sources = [ - "../gfx_export.h", - "angle_conversions.h", - "axis_transform2d.cc", - "axis_transform2d.h", - "box_f.cc", - "box_f.h", - "clamp_float_geometry.h", - "cubic_bezier.cc", - "cubic_bezier.h", - "decomposed_transform.cc", - "decomposed_transform.h", - "dip_util.cc", - "dip_util.h", - "double4.h", - "geometry_export.h", - "insets.cc", - "insets.h", - "insets_conversions.cc", - "insets_conversions.h", - "insets_f.cc", - "insets_f.h", - "insets_outsets_base.h", - "insets_outsets_f_base.h", - "matrix3_f.cc", - "matrix3_f.h", - "outsets.h", - "outsets_f.h", - "point.cc", - "point.h", - "point3_f.cc", - "point3_f.h", - "point_conversions.cc", - "point_conversions.h", - "point_f.cc", - "point_f.h", - "quad_f.cc", - "quad_f.h", - "quaternion.cc", - "quaternion.h", - "rect.cc", - "rect.h", - "rect_conversions.cc", - "rect_conversions.h", - "rect_f.cc", - "rect_f.h", - "resize_utils.cc", - "resize_utils.h", - "rounded_corners_f.cc", - "rounded_corners_f.h", - "size.cc", - "size.h", - "size_conversions.cc", - "size_conversions.h", - "size_f.cc", - "size_f.h", - "triangle_f.cc", - "triangle_f.h", - "vector2d.cc", - "vector2d.h", - "vector2d_conversions.cc", - "vector2d_conversions.h", - "vector2d_f.cc", - "vector2d_f.h", - "vector3d_f.cc", - "vector3d_f.h", - ] - - defines = [ "GEOMETRY_IMPLEMENTATION" ] - - deps = [ "//base" ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } -} - -component("geometry_skia") { - sources = [ - "geometry_skia_export.h", - "linear_gradient.cc", - "linear_gradient.h", - "mask_filter_info.cc", - "mask_filter_info.h", - "matrix44.cc", - "matrix44.h", - "rrect_f.cc", - "rrect_f.h", - "rrect_f_builder.cc", - "rrect_f_builder.h", - "skia_conversions.cc", - "skia_conversions.h", - "transform.cc", - "transform.h", - "transform_operation.cc", - "transform_operation.h", - "transform_operations.cc", - "transform_operations.h", - "transform_util.cc", - "transform_util.h", - ] - configs += [ "//build/config/compiler:wexit_time_destructors" ] - public_deps = [ - ":geometry", - "//base", - "//skia", - ] - defines = [ "GEOMETRY_SKIA_IMPLEMENTATION" ] -}