Commit 52a7d96d authored by George Steel's avatar George Steel Committed by Commit Bot

[code-health] remove effect_proxy.cc (dead)


Bug: 915344
Change-Id: Id09fb177297e014201581fd3a6057cf1961d2cc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335911Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Commit-Queue: George Steel <gtsteel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795510}
parent 7757fb5a
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/animationworklet/effect_proxy.h"
namespace blink {
EffectProxy::EffectProxy(base::Optional<base::TimeDelta> local_time)
: local_time_(local_time) {}
void EffectProxy::setLocalTime(double time_ms, bool is_null) {
if (is_null) {
local_time_.reset();
return;
}
DCHECK(!std::isnan(time_ms));
// Convert double to base::TimeDelta because cc/animation expects
// base::TimeDelta.
//
// Note on precision loss: base::TimeDelta has microseconds precision which is
// also the precision recommended by the web animation specification as well
// [1]. If the input time value has a bigger precision then the conversion
// causes precision loss. Doing the conversion here ensures that reading the
// value back provides the actual value we use in further computation which
// is the least surprising path.
// [1] https://drafts.csswg.org/web-animations/#precision-of-time-values
local_time_ = base::TimeDelta::FromMillisecondsD(time_ms);
}
double EffectProxy::localTime(bool& is_null) const {
is_null = !local_time_.has_value();
return local_time_.value_or(base::TimeDelta()).InMillisecondsF();
}
base::Optional<base::TimeDelta> EffectProxy::local_time() const {
return local_time_;
}
} // namespace blink
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