Commit 3b2acf61 authored by Sergio Villar Senin's avatar Sergio Villar Senin Committed by Commit Bot

Fix build with BLINK_ANIMATION_USE_TIME_DELTA enabled

This is basically an update of the work done in
https://crrev.com/c/1515682. The errors are not exactly the same but
the link phase was failing due to undefined symbols.

The problem of the original patch was that it was not adding the
required dependencies to animation/ in several parts of the tree, and
thus the buildflags.h include file was not generated on time.

This change allows us to build again with
build_animation_use_time_delta enabled again.

Bug: 737867
Change-Id: Id659b825f5177b137ab9de6a043b168836e3c570
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1741670Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#686737}
parent 20016d66
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
# #
# const char kSpamServerUrl[] = BUILDFLAG(SPAM_SERVER_URL); # const char kSpamServerUrl[] = BUILDFLAG(SPAM_SERVER_URL);
# #
# There will no #define called ENABLE_FOO so if you accidentally test for that # There will be no #define called ENABLE_FOO so if you accidentally test for
# in an ifdef it will always be negative. # that in an ifdef it will always be negative.
# #
# #
# Template parameters # Template parameters
......
...@@ -29,9 +29,6 @@ rel_blink_core_gen_dir = rebase_path(blink_core_output_dir, root_build_dir) ...@@ -29,9 +29,6 @@ rel_blink_core_gen_dir = rebase_path(blink_core_output_dir, root_build_dir)
# Config for code that builds as part of core. # Config for code that builds as part of core.
config("config") { config("config") {
defines = [ "BLINK_CORE_IMPLEMENTATION=1" ] defines = [ "BLINK_CORE_IMPLEMENTATION=1" ]
if (blink_animation_use_time_delta) {
defines += [ "BLINK_ANIMATION_USE_TIME_DELTA" ]
}
if (is_android && notouch_build) { if (is_android && notouch_build) {
defines += [ "ENABLE_TOUCHLESS_UASTYLE_THEME" ] defines += [ "ENABLE_TOUCHLESS_UASTYLE_THEME" ]
} }
...@@ -105,6 +102,7 @@ source_set("prerequisites") { ...@@ -105,6 +102,7 @@ source_set("prerequisites") {
"//skia", "//skia",
"//third_party/angle:translator", "//third_party/angle:translator",
"//third_party/blink/public/mojom:mojom_broadcastchannel_bindings_blink", "//third_party/blink/public/mojom:mojom_broadcastchannel_bindings_blink",
"//third_party/blink/renderer/core/animation:buildflags",
"//third_party/blink/renderer/core/inspector:generated", "//third_party/blink/renderer/core/inspector:generated",
"//third_party/blink/renderer/core/probe:generated", "//third_party/blink/renderer/core/probe:generated",
"//third_party/blink/renderer/platform", "//third_party/blink/renderer/platform",
...@@ -1615,10 +1613,6 @@ jumbo_source_set("unit_tests") { ...@@ -1615,10 +1613,6 @@ jumbo_source_set("unit_tests") {
if (use_aura) { if (use_aura) {
sources += [ "scroll/scrollbar_theme_aura_test.cc" ] sources += [ "scroll/scrollbar_theme_aura_test.cc" ]
} }
if (blink_animation_use_time_delta) {
defines = [ "BLINK_ANIMATION_USE_TIME_DELTA" ]
}
} }
jumbo_source_set("perf_tests") { jumbo_source_set("perf_tests") {
......
...@@ -2,11 +2,24 @@ ...@@ -2,11 +2,24 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//third_party/blink/renderer/core/core.gni") import("//third_party/blink/renderer/core/core.gni")
declare_args() {
# Use base::TimeDelta to represent time in renderer/core/animations. See
# http://crbug.com/737867
blink_animation_use_time_delta = false
}
buildflag_header("buildflags") {
header = "buildflags.h"
header_dir = "third_party/blink/renderer/core/animation"
flags = [ "BLINK_ANIMATION_USE_TIME_DELTA=$blink_animation_use_time_delta" ]
}
blink_core_sources("animation") { blink_core_sources("animation") {
split_count = 5 split_count = 5
sources = [ sources = [
"animatable.cc", "animatable.cc",
"animatable.h", "animatable.h",
...@@ -248,6 +261,10 @@ blink_core_sources("animation") { ...@@ -248,6 +261,10 @@ blink_core_sources("animation") {
"worklet_animation_controller.cc", "worklet_animation_controller.cc",
"worklet_animation_controller.h", "worklet_animation_controller.h",
] ]
deps = [
":buildflags",
]
} }
blink_core_tests("unit_tests") { blink_core_tests("unit_tests") {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace blink { namespace blink {
#if !defined(BLINK_ANIMATION_USE_TIME_DELTA) #if !BUILDFLAG(BLINK_ANIMATION_USE_TIME_DELTA)
// Comparison operators on AnimationTimeDelta. // Comparison operators on AnimationTimeDelta.
bool CORE_EXPORT operator==(const AnimationTimeDelta& lhs, bool CORE_EXPORT operator==(const AnimationTimeDelta& lhs,
const AnimationTimeDelta& rhs) { const AnimationTimeDelta& rhs) {
......
...@@ -5,16 +5,13 @@ ...@@ -5,16 +5,13 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_TIME_DELTA_H_ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_TIME_DELTA_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_TIME_DELTA_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_ANIMATION_TIME_DELTA_H_
#include "third_party/blink/renderer/core/animation/buildflags.h"
#include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include <limits> #include <limits>
#include <ostream> #include <ostream>
#if defined(BLINK_ANIMATION_USE_TIME_DELTA)
#endif
namespace blink { namespace blink {
// AnimationTimeDelta exists to ease the transition of Blink animations from // AnimationTimeDelta exists to ease the transition of Blink animations from
...@@ -27,7 +24,7 @@ namespace blink { ...@@ -27,7 +24,7 @@ namespace blink {
// double-precision. The second mode uses base::TimeDelta to represent time // double-precision. The second mode uses base::TimeDelta to represent time
// instead. // instead.
#if !defined(BLINK_ANIMATION_USE_TIME_DELTA) #if !BUILDFLAG(BLINK_ANIMATION_USE_TIME_DELTA)
// The double-based version of AnimationTimeDelta. Internally, time is stored as // The double-based version of AnimationTimeDelta. Internally, time is stored as
// double-precision seconds. // double-precision seconds.
...@@ -105,7 +102,7 @@ bool CORE_EXPORT operator<=(const AnimationTimeDelta& lhs, ...@@ -105,7 +102,7 @@ bool CORE_EXPORT operator<=(const AnimationTimeDelta& lhs,
CORE_EXPORT std::ostream& operator<<(std::ostream& os, CORE_EXPORT std::ostream& operator<<(std::ostream& os,
const AnimationTimeDelta& time); const AnimationTimeDelta& time);
#else // !defined(BLINK_ANIMATION_USE_TIME_DELTA) #else // !BUILDFLAG(BLINK_ANIMATION_USE_TIME_DELTA)
// When compiling in TimeDelta-based mode, AnimationTimeDelta is equivalent to // When compiling in TimeDelta-based mode, AnimationTimeDelta is equivalent to
// base::TimeDelta. // base::TimeDelta.
......
...@@ -151,9 +151,3 @@ set_defaults("blink_core_tests") { ...@@ -151,9 +151,3 @@ set_defaults("blink_core_tests") {
"//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:inside_blink",
] ]
} }
declare_args() {
# Use base::TimeDelta to represent time in renderer/core/animations. See
# http://crbug.com/737867
blink_animation_use_time_delta = false
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment