diff --git a/cobalt/content/licenses/platform/android/licenses_cobalt.txt b/cobalt/content/licenses/platform/android/licenses_cobalt.txt index 8821b6dcb78b..3119047a719e 100644 --- a/cobalt/content/licenses/platform/android/licenses_cobalt.txt +++ b/cobalt/content/licenses/platform/android/licenses_cobalt.txt @@ -2307,7 +2307,46 @@ https://cobalt.googlesource.com/cobalt. libjpeg-turbo Licenses libjpeg-turbo is covered by three compatible BSD-style open source licenses: - The IJG (Independent JPEG Group) License, which is listed in README.ijg + The IJG (Independent JPEG Group) License, which is listed below + + Origin + + This file is part of the Independent JPEG Group's software. + + The authors make NO WARRANTY or representation, either express or implied, + with respect to this software, its quality, accuracy, merchantability, or + fitness for a particular purpose. This software is provided "AS IS", and + you, its user, assume the entire risk as to its quality and accuracy. + + This software is copyright (C) 1994-1996, Thomas G. Lane. + All Rights Reserved except as specified below. + + Permission is hereby granted to use, copy, modify, and distribute this + software (or portions thereof) for any purpose, without fee, subject to + these conditions: + (1) If any part of the source code for this software is distributed, then + this README file must be included, with this copyright and no-warranty + notice unaltered; and any additions, deletions, or changes to the original + files must be clearly indicated in accompanying documentation. + (2) If only executable code is distributed, then the accompanying + documentation must state that "this software is based in part on the work + of the Independent JPEG Group". + (3) Permission for use of this software is granted only if the user accepts + full responsibility for any undesirable consequences; the authors accept + NO LIABILITY for damages of any kind. + + These conditions apply to any software derived from or based on the IJG + code, not just to the unmodified library. If you use our work, you ought + to acknowledge us. + + Permission is NOT granted for the use of any IJG author's name or company + name in advertising or publicity relating to this software or products + derived from it. This software may be referred to only as "the Independent + JPEG Group's software". + + We specifically permit and encourage the use of this software as the basis + of commercial products, provided that all warranty or liability claims are + assumed by the product vendor. This license applies to the libjpeg API library and associated programs (any code inherited from libjpeg, and any modifications to that code.) diff --git a/cobalt/content/licenses/platform/evergreen/licenses_cobalt.txt b/cobalt/content/licenses/platform/evergreen/licenses_cobalt.txt index e889e544ccb2..1cdb9109cdbb 100644 --- a/cobalt/content/licenses/platform/evergreen/licenses_cobalt.txt +++ b/cobalt/content/licenses/platform/evergreen/licenses_cobalt.txt @@ -2487,7 +2487,46 @@ https://cobalt.googlesource.com/cobalt. libjpeg-turbo Licenses libjpeg-turbo is covered by three compatible BSD-style open source licenses: - The IJG (Independent JPEG Group) License, which is listed in README.ijg + The IJG (Independent JPEG Group) License, which is listed below + + Origin + + This file is part of the Independent JPEG Group's software. + + The authors make NO WARRANTY or representation, either express or implied, + with respect to this software, its quality, accuracy, merchantability, or + fitness for a particular purpose. This software is provided "AS IS", and + you, its user, assume the entire risk as to its quality and accuracy. + + This software is copyright (C) 1994-1996, Thomas G. Lane. + All Rights Reserved except as specified below. + + Permission is hereby granted to use, copy, modify, and distribute this + software (or portions thereof) for any purpose, without fee, subject to + these conditions: + (1) If any part of the source code for this software is distributed, then + this README file must be included, with this copyright and no-warranty + notice unaltered; and any additions, deletions, or changes to the original + files must be clearly indicated in accompanying documentation. + (2) If only executable code is distributed, then the accompanying + documentation must state that "this software is based in part on the work + of the Independent JPEG Group". + (3) Permission for use of this software is granted only if the user accepts + full responsibility for any undesirable consequences; the authors accept + NO LIABILITY for damages of any kind. + + These conditions apply to any software derived from or based on the IJG + code, not just to the unmodified library. If you use our work, you ought + to acknowledge us. + + Permission is NOT granted for the use of any IJG author's name or company + name in advertising or publicity relating to this software or products + derived from it. This software may be referred to only as "the Independent + JPEG Group's software". + + We specifically permit and encourage the use of this software as the basis + of commercial products, provided that all warranty or liability claims are + assumed by the product vendor. This license applies to the libjpeg API library and associated programs (any code inherited from libjpeg, and any modifications to that code.) diff --git a/media/BUILD.gn b/media/BUILD.gn index fd9cf7bec465..c7b1a87d4d9d 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -30,7 +30,7 @@ config("media_config") { ] } - defines = [ "MEDIA_IMPLEMENTATION" ] + defines = [ "IS_MEDIA_IMPL" ] } config("media_config_public") { @@ -82,6 +82,8 @@ component("media") { "base/encryption_pattern.h", "base/encryption_scheme.cc", "base/encryption_scheme.h", + "base/media_client.cc", + "base/media_client.h", "base/media_log.h", "base/media_resource.cc", "base/media_resource.h", diff --git a/media/BUILD.gn.chromium b/media/BUILD.gn.chromium deleted file mode 100644 index ba14ef6f6b07..000000000000 --- a/media/BUILD.gn.chromium +++ /dev/null @@ -1,506 +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/buildflag_header.gni") -import("//build/config/android/config.gni") -import("//build/config/arm.gni") -import("//build/config/chromecast_build.gni") -import("//build/config/features.gni") -import("//build/config/linux/pkg_config.gni") -import("//build/config/ui.gni") -import("//media/media_options.gni") -import("//testing/libfuzzer/fuzzer_test.gni") -import("//testing/test.gni") -import("//third_party/ffmpeg/ffmpeg_options.gni") - -if (enable_library_cdms) { - import("//media/cdm/library_cdm/cdm_paths.gni") -} - -if (is_ios) { - import("//build/config/ios/bundle_data_from_filelist.gni") -} - -buildflag_header("media_buildflags") { - header = "media_buildflags.h" - - enable_passthrough_audio_codecs = - enable_platform_dts_audio && (is_win || is_linux) - - flags = [ - "ALLOW_OOP_VIDEO_DECODER=$allow_oop_video_decoder", - "ALLOW_HOSTING_OOP_VIDEO_DECODER=$allow_hosting_oop_video_decoder", - "ALTERNATE_CDM_STORAGE_ID_KEY=\"$alternate_cdm_storage_id_key\"", - "CHROME_WIDE_ECHO_CANCELLATION=$chrome_wide_echo_cancellation_supported", - "ENABLE_PLATFORM_AC3_EAC3_AUDIO=$enable_platform_ac3_eac3_audio", - "ENABLE_CAST_AUDIO_RENDERER=$enable_cast_audio_renderer", - "ENABLE_DAV1D_DECODER=$enable_dav1d_decoder", - "ENABLE_AV1_DECODER=$enable_av1_decoder", - "ENABLE_PLATFORM_DOLBY_VISION=$enable_platform_dolby_vision", - "ENABLE_PLATFORM_ENCRYPTED_DOLBY_VISION=$enable_platform_encrypted_dolby_vision", - "ENABLE_FFMPEG=$media_use_ffmpeg", - "ENABLE_FFMPEG_VIDEO_DECODERS=$enable_ffmpeg_video_decoders", - "ENABLE_PLATFORM_HEVC=$enable_platform_hevc", - "ENABLE_HEVC_PARSER_AND_HW_DECODER=$enable_hevc_parser_and_hw_decoder", - "ENABLE_HLS_DEMUXER=$enable_hls_demuxer", - "ENABLE_LIBAOM=$enable_libaom", - "ENABLE_LIBRARY_CDMS=$enable_library_cdms", - "ENABLE_LIBVPX=$media_use_libvpx", - "ENABLE_LOGGING_OVERRIDE=$enable_logging_override", - "ENABLE_MEDIA_DRM_STORAGE=$enable_media_drm_storage", - "ENABLE_MEDIA_REMOTING=$enable_media_remoting", - "ENABLE_MEDIA_REMOTING_RPC=$enable_media_remoting_rpc", - "ENABLE_OPENH264=$media_use_openh264", - "ENABLE_PASSTHROUGH_AUDIO_CODECS=$enable_passthrough_audio_codecs", - "ENABLE_PLATFORM_DTS_AUDIO=$enable_platform_dts_audio", - "ENABLE_PLATFORM_MPEG_H_AUDIO=$enable_platform_mpeg_h_audio", - "ENABLE_MSE_MPEG2TS_STREAM_PARSER=$enable_mse_mpeg2ts_stream_parser", - "PLATFORM_HAS_OPTIONAL_HEVC_SUPPORT=$platform_has_optional_hevc_support", - "USE_ARC_PROTECTED_MEDIA=$use_arc_protected_media", - "USE_CHROMEOS_MEDIA_ACCELERATION=$use_vaapi||$use_v4l2_codec", - "USE_CHROMEOS_PROTECTED_AV1=$use_chromeos_protected_av1", - "USE_CHROMEOS_PROTECTED_MEDIA=$use_chromeos_protected_media", - "USE_PROPRIETARY_CODECS=$proprietary_codecs", - ] - - if (enable_library_cdms) { - flags += [ - "CDM_PLATFORM_SPECIFIC_PATH=\"$cdm_platform_specific_path\"", - "ENABLE_CDM_HOST_VERIFICATION=$enable_cdm_host_verification", - "ENABLE_CDM_STORAGE_ID=$enable_cdm_storage_id", - ] - } -} - -if (proprietary_codecs && media_use_ffmpeg) { - assert( - ffmpeg_branding != "Chromium", - "proprietary codecs and ffmpeg_branding set to Chromium are incompatible") -} - -# Common configuration for targets in the media directory; these must not be -# exported since things like USE_NEON and USE_CRAS have different meanings -# elsewhere in the code base. -config("media_config") { - defines = [] - if (current_cpu == "arm64" || (current_cpu == "arm" && arm_use_neon)) { - defines += [ "USE_NEON" ] - } - if (use_pulseaudio) { - defines += [ "USE_PULSEAUDIO" ] - if (!link_pulseaudio) { - defines += [ "DLOPEN_PULSEAUDIO" ] - } - } - if (use_cras) { - defines += [ "USE_CRAS" ] - } -} - -# Internal grouping of the configs necessary to support sub-folders having their -# own BUILD.gn files; only targets which roll up into the "media" target should -# include this config. I.e., not "test_support" or "unit_tests" targets. -# -# Without these configs having individual sub-folders take a //media/base DEP -# (or others) can yield incorrectly imported and exported symbols on Windows: -# -# fatal error LNK1169: one or more multiply defined symbols found. -# -config("subcomponent_config") { - visibility = media_subcomponent_deps - if (is_apple) { - visibility += [ "//media/base/mac" ] - } - defines = [ "IS_MEDIA_IMPL" ] - configs = [ - ":media_config", - "//build/config/compiler:wexit_time_destructors", - ] -} - -component("media") { - libs = [] - - deps = [ - "//base", - "//base:i18n", - "//base/third_party/dynamic_annotations", - "//cc/paint", - "//gpu/command_buffer/client:gles2_interface", - "//gpu/command_buffer/common", - "//third_party/libyuv", - "//ui/events:events_base", - "//ui/gfx", - "//ui/gfx/geometry", - "//ui/gl:gl", - "//url", - ] - - public_configs = [ "//third_party/libwebm:libwebm_config" ] - public_deps = media_subcomponent_deps - public_deps += [ - ":media_buildflags", - ":shared_memory_support", - "//ui/gfx:color_space", - ] - - # This must be included here since it actually depends on //media/base. - if (is_mac || (use_blink && is_ios)) { - public_deps += [ "//media/base/mac" ] - } - - if (use_ozone) { - deps += [ "//ui/ozone" ] - } -} - -# Note: This can't be a static_library since it does not have any sources. -source_set("test_support") { - testonly = true - public_deps = [ - ":media", - "//media/audio:test_support", - "//media/base:test_support", - "//media/base/android:test_support", - "//media/filters:test_support", - "//media/formats:test_support", - "//media/renderers:test_support", - "//media/video:test_support", - ] -} - -if (is_ios) { - bundle_data_from_filelist("unit_tests_bundle_data") { - testonly = true - filelist_name = "unit_tests_bundle_data.filelist" - } -} - -# Contains tests for all targets in the "media" folder. -# TODO(xhwang): Move mojo/capture/remoting tests here where applicable. -test("media_unittests") { - use_xvfb = use_xvfb_in_this_config - - deps = [ - "//media/audio:unit_tests", - "//media/base:unit_tests", - "//media/capabilities:unit_tests", - "//media/cdm:unit_tests", - "//media/device_monitors:unit_tests", - "//media/filters:unit_tests", - "//media/formats:unit_tests", - "//media/gpu:unit_tests", - "//media/learning:unit_tests", - "//media/mojo:unit_tests", - "//media/muxers:unit_tests", - "//media/parsers:unit_tests", - "//media/renderers:unit_tests", - "//media/test:pipeline_integration_tests", - "//media/test:run_all_unittests", - "//media/video:unit_tests", - "//media/webrtc:unit_tests", - ] - - data = [ - "test/data/", - "formats/mp4/h264_annex_b_fuzz_corpus/", - "formats/mp4/h265_annex_b_fuzz_corpus/", - ] - - data_deps = [ "//testing/buildbot/filters:media_unittests_filters" ] - - if (is_android && enable_chrome_android_internal) { - data_deps += [ "//clank/build/bot/filters:media_unittests_filters" ] - } - - if (media_use_ffmpeg) { - deps += [ "//media/ffmpeg:unit_tests" ] - } - - if (is_android) { - deps += [ - # The test needs the java dependencies to add the java classes for their - # native counterparts to the test apk. - "//gpu/command_buffer/service:android_texture_owner_unittests", - "//media/base/android:media_java", - "//media/base/android:unit_tests", - "//media/gpu:android_video_decode_accelerator_unittests", - "//ui/android:ui_java", - ] - } - - if (is_fuchsia) { - deps += [ "//media/fuchsia/video:unittests" ] - - # PaintCanvasVideoRendererWithGLTest.* uses SwiftShader, which generates - # machine code. - test_runner_shard = "//build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml" - - additional_manifest_fragments = [ - "//build/config/fuchsia/test/audio_output.shard.test-cml", - "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml", - "//build/config/fuchsia/test/platform_video_codecs.shard.test-cml", - "//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml", - ] - - if (enable_library_cdms) { - excluded_files = [ "lib.unstripped/libclearkeycdm.so" ] - } - } - - if (enable_media_remoting) { - deps += [ "//media/remoting:media_remoting_tests" ] - } - - # The test needs OPUS_FIXED_POINT conditional define. - configs += [ "//third_party/opus:opus_config" ] - - if (is_ios) { - deps += [ ":unit_tests_bundle_data" ] - } -} - -test("media_perftests") { - configs += [ ":media_config" ] - deps = [ - ":test_support", - "//base/test:test_support", - "//media/base:perftests", - "//media/filters:perftests", - "//media/test:pipeline_integration_perftests", - "//testing/gmock", - "//testing/gtest", - "//testing/perf", - "//third_party/widevine/cdm:headers", - "//ui/gfx:test_support", - ] - if (media_use_ffmpeg) { - # Direct dependency required to inherit config. - deps += [ "//third_party/ffmpeg" ] - } - - # This target should not require the Chrome executable to run. - assert_no_deps = [ "//chrome" ] - - data = [ "test/data/" ] - - data_deps = [ - # Needed for isolate script to execute. - "//testing:run_perf_test", - ] -} - -# The audio subset of media_unittests. This target exists for running only the -# audio tests on the GPU bots (which have audio hardware). -test("audio_unittests") { - deps = [ - ":test_support", - "//base/test:test_support", - "//media/audio:unit_tests", - "//media/test:run_all_unittests", - ] - if (is_android) { - deps += [ - # The test needs the java dependencies to add the java classes for their - # native counterparts to the test apk. - "//media/base/android:media_java", - "//ui/android:ui_java", - ] - } - - if (is_fuchsia) { - additional_manifest_fragments = - [ "//build/config/fuchsia/test/audio_output.shard.test-cml" ] - } -} - -# Note: Most external components should just depend on //media unless they -# specifically need this pared own target (NaCl, PPAPI, etc). Internal targets -# should just depend on //media/base which will propagate this target to them. -component("shared_memory_support") { - sources = [ - "base/audio_bus.cc", - "base/audio_bus.h", - "base/audio_codecs.h", - "base/audio_latency.cc", - "base/audio_latency.h", - "base/audio_parameters.cc", - "base/audio_parameters.h", - "base/audio_point.cc", - "base/audio_point.h", - "base/audio_sample_types.h", - "base/channel_layout.cc", - "base/channel_layout.h", - "base/limits.h", - "base/media_export.h", - "base/media_shmem_export.h", - "base/sample_format.cc", - "base/sample_format.h", - "base/vector_math.cc", - "base/vector_math.h", - "base/vector_math_testing.h", - "base/video_types.cc", - "base/video_types.h", - ] - if (is_mac) { - # These need to be included here because audio_latency.cc depends on them. - sources += [ - "base/mac/audio_latency_mac.cc", - "base/mac/audio_latency_mac.h", - ] - } - - # Do not use "subcomponent_config" here since these files are in their own - # component target and thus can't share the standard export macros. - configs += [ ":media_config" ] - defines = [ "MEDIA_SHMEM_IMPLEMENTATION" ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } - deps = [ - "//base", - "//build:chromeos_buildflags", - "//ui/gfx/geometry", - ] -} - -# TODO(watk): Refactor tests that could be made to run on Android. See -# http://crbug.com/570762 -if (media_use_ffmpeg && !is_android) { - test("ffmpeg_regression_tests") { - configs += [ "//media:media_config" ] - - deps = [ - ":test_support", - "//base/test:test_support", - "//media/ffmpeg:ffmpeg_regression_tests", - "//media/test:pipeline_integration_tests", - "//media/test:run_all_unittests", - "//testing/gmock", - "//testing/gtest", - "//ui/gfx:test_support", - "//ui/gfx/geometry", - ] - } -} - -if (proprietary_codecs) { - fuzzer_test("media_cenc_utils_fuzzer") { - sources = [ "cdm/cenc_utils_fuzzertest.cc" ] - deps = [ ":media" ] - } -} - -fuzzer_test("media_vp9_parser_fuzzer") { - sources = [ "filters/vp9_parser_fuzzertest.cc" ] - deps = [ - ":test_support", - "//base", - ] - libfuzzer_options = [ "max_len = 400000" ] -} - -fuzzer_test("media_vp9_parser_encrypted_fuzzer") { - sources = [ "filters/vp9_parser_encrypted_fuzzertest.cc" ] - deps = [ - ":test_support", - "//base", - "//base/test:test_support", - ] - seed_corpus = "//media/test/data" -} - -fuzzer_test("media_vpx_video_decoder_fuzzer") { - sources = [ "filters/vpx_video_decoder_fuzzertest.cc" ] - deps = [ - ":media", - "//base", - "//base/test:test_support", - ] - libfuzzer_options = [ "max_len = 400000" ] - seed_corpus = "//media/test/data" -} - -fuzzer_test("media_webm_muxer_fuzzer") { - sources = [ "muxers/webm_muxer_fuzzertest.cc" ] - deps = [ - ":media", - "//base", - "//third_party/libwebm", - ] -} - -fuzzer_test("cbcs_decryptor_fuzzer") { - sources = [ "cdm/cbcs_decryptor_fuzzer.cc" ] - deps = [ - ":media", - "//base", - "//crypto", - ] -} - -fuzzer_test("cenc_decryptor_fuzzer") { - sources = [ "cdm/cenc_decryptor_fuzzer.cc" ] - deps = [ - ":media", - "//base", - "//crypto", - ] -} - -fuzzer_test("json_web_key_fuzzer") { - sources = [ "cdm/json_web_key_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] -} - -if (proprietary_codecs) { - fuzzer_test("media_mp4_avcc_parser_fuzzer") { - sources = [ "formats/mp4/mp4_avcc_parser_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] - } - - fuzzer_test("media_mp4_box_reader_fuzzer") { - sources = [ "formats/mp4/mp4_box_reader_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] - libfuzzer_options = [ "max_len=500" ] - dict = "test/mp4.dict" - } -} - -if (enable_mse_mpeg2ts_stream_parser) { - fuzzer_test("media_es_parser_adts_fuzzer") { - sources = [ "formats/mp2t/es_parser_adts_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] - } - - fuzzer_test("media_es_parser_h264_fuzzer") { - sources = [ "formats/mp2t/es_parser_h264_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] - } - - fuzzer_test("media_es_parser_mpeg1audio_fuzzer") { - sources = [ "formats/mp2t/es_parser_mpeg1audio_fuzzer.cc" ] - deps = [ - ":media", - "//base", - ] - } -} diff --git a/media/METADATA b/media/METADATA index 8201d9c53f9e..7cbb56786372 100644 --- a/media/METADATA +++ b/media/METADATA @@ -5,12 +5,12 @@ description: third_party { identifier { type: "ChromiumVersion" - value: "114.0.5735.331" # from https://chromereleases.googleblog.com/2023/08/long-term-support-channel-update-for_23.html + value: "114.0.5735.358" # from https://chromereleases.googleblog.com/2024/03/long-term-support-channel-update-for_26.html } identifier { type: "Git" value: "https://chromium.googlesource.com/chromium/src.git" - version: "fed499399d3f44d3a7957549d493bf30a5d8c867" + version: "1759c6ae9316996b9f150c0ce9d0ca78a3d15c02" } identifier { type: "UpstreamSubdir" diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 71e1b3716260..43265d6c016d 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -452,12 +452,10 @@ enum class kCrosGlobalMediaControlsPinOptions { kHeuristic, }; -#if !defined(STARBOARD) // Feature param used to force default pin/unpin for global media controls in // CrOS. MEDIA_EXPORT extern const base::FeatureParam kCrosGlobalMediaControlsPinParam; -#endif // !defined(STARBOARD) // Return bitmask of audio formats supported by EDID. MEDIA_EXPORT uint32_t GetPassthroughAudioFormats(); diff --git a/media/base/supported_types.cc b/media/base/supported_types.cc index e88128d89d40..19bebe621a91 100644 --- a/media/base/supported_types.cc +++ b/media/base/supported_types.cc @@ -326,18 +326,14 @@ bool IsAACSupported(const AudioType& type) { } // namespace bool IsSupportedAudioType(const AudioType& type) { -#if !defined(STARBOARD) if (auto* media_client = GetMediaClient()) return media_client->IsSupportedAudioType(type); -#endif // !defined(STARBOARD) return IsDefaultSupportedAudioType(type); } bool IsSupportedVideoType(const VideoType& type) { -#if !defined(STARBOARD) if (auto* media_client = GetMediaClient()) return media_client->IsSupportedVideoType(type); -#endif // !defined(STARBOARD) return IsDefaultSupportedVideoType(type); } diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc index 483e621981aa..017c8a9e9906 100644 --- a/media/gpu/chromeos/video_decoder_pipeline.cc +++ b/media/gpu/chromeos/video_decoder_pipeline.cc @@ -327,6 +327,13 @@ VideoDecoderPipeline::GetSupportedConfigs( }); } + if (workarounds.disable_accelerated_h264_decode) { + base::EraseIf(configs.value(), [](const auto& config) { + return config.profile_min >= H264PROFILE_MIN && + config.profile_max <= H264PROFILE_MAX; + }); + } + return configs; } diff --git a/starboard/common/thread.cc b/starboard/common/thread.cc index da6f212a4652..95a15c7a13a6 100644 --- a/starboard/common/thread.cc +++ b/starboard/common/thread.cc @@ -14,10 +14,11 @@ * limitations under the License. */ -#include - #include "starboard/common/thread.h" +#include +#include + #include "starboard/common/atomic.h" #include "starboard/common/log.h" #include "starboard/common/mutex.h" @@ -28,18 +29,12 @@ namespace starboard { struct Thread::Data { std::string name_; - SbThread thread_ = kSbThreadInvalid; + pthread_t thread_ = 0; atomic_bool started_; atomic_bool join_called_; Semaphore join_sema_; - optional options_; }; -Thread::Options::Options() - : stack_size(0), // Signal for default stack size. - priority_(kSbThreadNoPriority), - joinable(true) {} - Thread::Thread(const std::string& name) { d_.reset(new Thread::Data); d_->name_ = name; @@ -49,21 +44,14 @@ Thread::~Thread() { SB_DCHECK(d_->join_called_.load()) << "Join not called on thread."; } -void Thread::Start(const Options& options) { - SbThreadEntryPoint entry_point = ThreadEntryPoint; - +void Thread::Start() { SB_DCHECK(!d_->started_.load()); - SB_DCHECK(!d_->options_.has_engaged()); d_->started_.store(true); - d_->options_ = options; - d_->thread_ = - SbThreadCreate(options.stack_size, options.priority_, - kSbThreadNoAffinity, // default affinity. - options.joinable, d_->name_.c_str(), entry_point, this); + pthread_create(&d_->thread_, NULL, ThreadEntryPoint, this); - // SbThreadCreate() above produced an invalid thread handle. - SB_DCHECK(d_->thread_ != kSbThreadInvalid); + // pthread_create() above produced an invalid thread handle. + SB_DCHECK(d_->thread_ != 0); } void Thread::Sleep(int64_t microseconds) { @@ -92,18 +80,18 @@ starboard::atomic_bool* Thread::joined_bool() { void* Thread::ThreadEntryPoint(void* context) { Thread* this_ptr = static_cast(context); + pthread_setname_np(pthread_self(), this_ptr->d_->name_.c_str()); this_ptr->Run(); return NULL; } void Thread::Join() { SB_DCHECK(d_->join_called_.load() == false); - SB_DCHECK(d_->options_->joinable) << "Detached thread should not be joined."; d_->join_called_.store(true); d_->join_sema_.Put(); - if (!SbThreadJoin(d_->thread_, NULL)) { + if (pthread_join(d_->thread_, NULL) != 0) { SB_DCHECK(false) << "Could not join thread."; } } diff --git a/starboard/common/thread.h b/starboard/common/thread.h index 74c144bc4f64..79728d4e94d9 100644 --- a/starboard/common/thread.h +++ b/starboard/common/thread.h @@ -33,13 +33,6 @@ class atomic_bool; class Thread { public: - struct Options { - Options(); - int64_t stack_size; - SbThreadPriority priority_; - bool joinable = true; - }; - explicit Thread(const std::string& name); template explicit Thread(char const (&name)[N]) : Thread(std::string(name)) { @@ -59,7 +52,7 @@ class Thread { // Called by the main thread, this will cause Run() to be invoked // on another thread. - virtual void Start(const Options& options = Options()); + virtual void Start(); virtual void Join(); bool join_called() const; diff --git a/starboard/nplb/posix_compliance/posix_socket_receive_test.cc b/starboard/nplb/posix_compliance/posix_socket_receive_test.cc index 9ca368c31bb8..f8480612cb87 100644 --- a/starboard/nplb/posix_compliance/posix_socket_receive_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_receive_test.cc @@ -37,8 +37,7 @@ int Transfer(int receive_socket_fd, size - send_total, kSendFlags); if (bytes_sent < 0) { if (errno != EINPROGRESS) { - // TODO: b/321999529, need errno - // return -1; + return -1; } bytes_sent = 0; } @@ -51,8 +50,7 @@ int Transfer(int receive_socket_fd, if (bytes_received < 0) { if (errno != EINPROGRESS) { - // TODO: b/321999529, need errno - // return -1; + return -1; } bytes_received = 0; } diff --git a/starboard/nplb/posix_compliance/posix_socket_recvfrom_test.cc b/starboard/nplb/posix_compliance/posix_socket_recvfrom_test.cc index c14192951e53..eb4f1be4fc5a 100644 --- a/starboard/nplb/posix_compliance/posix_socket_recvfrom_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_recvfrom_test.cc @@ -37,8 +37,7 @@ int Transfer(int receive_socket_fd, size - send_total, kSendFlags, NULL, 0); if (bytes_sent < 0) { if (errno != EINPROGRESS) { - // TODO: b/321999529, need errno - // return -1; + return -1; } bytes_sent = 0; } @@ -51,8 +50,7 @@ int Transfer(int receive_socket_fd, if (bytes_received < 0) { if (errno != EINPROGRESS) { - // TODO: b/321999529, need errno - // return -1; + return -1; } bytes_received = 0; } diff --git a/starboard/nplb/posix_compliance/posix_socket_send_test.cc b/starboard/nplb/posix_compliance/posix_socket_send_test.cc index 668fbd239832..85fc855806eb 100644 --- a/starboard/nplb/posix_compliance/posix_socket_send_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_send_test.cc @@ -76,8 +76,9 @@ TEST(PosixSocketSendTest, RainyDayUnconnectedSocket) { ssize_t bytes_written = send(socket_fd, buf, sizeof(buf), kSendFlags); EXPECT_FALSE(bytes_written >= 0); - // TODO: check errno: EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || - // errno == EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ENOTCONN); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; EXPECT_TRUE(close(socket_fd) == 0); } @@ -109,8 +110,11 @@ TEST(PosixSocketSendTest, RainyDaySendToClosedSocket) { void* thread_result; EXPECT_TRUE(pthread_join(send_thread, &thread_result) == 0); - // TODO: errno: EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno - // == EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ENOTCONN || // errno on Windows + errno == EINPROGRESS // errno on Evergreen + ); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; // Clean up the server socket. EXPECT_TRUE(close(server_socket_fd) == 0); @@ -143,9 +147,9 @@ TEST(PosixSocketSendTest, RainyDaySendToSocketUntilBlocking) { if (result < 0) { // If we didn't get a socket, it should be pending. - // TODO: export errno - // EXPECT_TRUE(errno == EINPROGRESS || errno == EAGAIN || errno == - // EWOULDBLOCK); + EXPECT_TRUE(errno == EINPROGRESS || errno == EAGAIN || + errno == EWOULDBLOCK); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; break; } @@ -195,9 +199,8 @@ TEST(PosixSocketSendTest, RainyDaySendToSocketConnectionReset) { result = send(client_socket_fd, buff, sizeof(buff), kSendFlags); if (result < 0) { - // TODO: errno: - // EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == - // EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ECONNABORTED); SB_DLOG(INFO) << "Failed to send, errno = " << errno; break; } diff --git a/starboard/nplb/posix_compliance/posix_socket_sendto_test.cc b/starboard/nplb/posix_compliance/posix_socket_sendto_test.cc index 5405e5e0e281..1414e78cbbac 100644 --- a/starboard/nplb/posix_compliance/posix_socket_sendto_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_sendto_test.cc @@ -79,8 +79,9 @@ TEST(PosixSocketSendtoTest, RainyDayUnconnectedSocket) { sendto(socket_fd, buf, sizeof(buf), kSendFlags, NULL, 0); EXPECT_FALSE(bytes_written >= 0); - // TODO: check errno: EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || - // errno == EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ENOTCONN); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; EXPECT_TRUE(close(socket_fd) == 0); } @@ -112,8 +113,11 @@ TEST(PosixSocketSendtoTest, RainyDaySendToClosedSocket) { void* thread_result; EXPECT_TRUE(pthread_join(send_thread, &thread_result) == 0); - // TODO: errno: EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno - // == EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ENOTCONN || // errno on Windows + errno == EINPROGRESS // errno on Evergreen + ); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; // Clean up the server socket. EXPECT_TRUE(close(server_socket_fd) == 0); @@ -146,9 +150,9 @@ TEST(PosixSocketSendtoTest, RainyDaySendToSocketUntilBlocking) { if (result < 0) { // If we didn't get a socket, it should be pending. - // TODO: export errno - // EXPECT_TRUE(errno == EINPROGRESS || errno == EAGAIN || errno == - // EWOULDBLOCK); + EXPECT_TRUE(errno == EINPROGRESS || errno == EAGAIN || + errno == EWOULDBLOCK); + SB_DLOG(INFO) << "Failed to send, errno = " << errno; break; } @@ -194,9 +198,8 @@ TEST(PosixSocketSendtoTest, RainyDaySendToSocketConnectionReset) { result = sendto(client_socket_fd, buff, sizeof(buff), kSendFlags, NULL, 0); if (result < 0) { - // TODO: errno: - // EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == - // EPIPE); + EXPECT_TRUE(errno == ECONNRESET || errno == ENETRESET || errno == EPIPE || + errno == ECONNABORTED); SB_DLOG(INFO) << "Failed to send, errno = " << errno; break; } diff --git a/tools/metadata/VERSION.chromium b/tools/metadata/VERSION.chromium new file mode 100644 index 000000000000..b9544f00e7c9 --- /dev/null +++ b/tools/metadata/VERSION.chromium @@ -0,0 +1 @@ +114.0.5735.358 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/METADATA b/ui/gfx/METADATA index 037599826158..2aa207e6d6e8 100644 --- a/ui/gfx/METADATA +++ b/ui/gfx/METADATA @@ -1,12 +1,12 @@ third_party { identifier { type: "ChromiumVersion" - value: "114.0.5735.331" # from https://chromereleases.googleblog.com/2023/08/long-term-support-channel-update-for_23.html + value: "114.0.5735.358" # from https://chromereleases.googleblog.com/2024/03/long-term-support-channel-update-for_26.html } identifier { type: "Git" value: "https://chromium.googlesource.com/chromium/src.git" - version: "fed499399d3f44d3a7957549d493bf30a5d8c867" + version: "1759c6ae9316996b9f150c0ce9d0ca78a3d15c02" } identifier { type: "UpstreamSubdir" 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" ] -}