Commit 8473cfb2 authored by DongJun Kim's avatar DongJun Kim Committed by Commit Bot

Rename CompositorTargetProperty namepsace to compositor_target_property

https://google.github.io/styleguide/cppguide.html#Namespace_Names
> Namespace names are all lower-case.

This CL has no behavior changes.

Bug: 889726
Change-Id: I1322d8651a6a91cbb3e9e2d9fe9285fd793e813a
Reviewed-on: https://chromium-review.googlesource.com/c/1348884Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: DongJun Kim <djmix.kim@samsung.com>
Cr-Commit-Position: refs/heads/master@{#610794}
parent 472a594f
......@@ -654,12 +654,12 @@ void CompositorAnimations::GetAnimationOnCompositor(
const PropertySpecificKeyframeVector& values =
effect.GetPropertySpecificKeyframes(property);
CompositorTargetProperty::Type target_property;
compositor_target_property::Type target_property;
std::unique_ptr<CompositorAnimationCurve> curve;
DCHECK(timing.timing_function);
switch (property.GetCSSProperty().PropertyID()) {
case CSSPropertyOpacity: {
target_property = CompositorTargetProperty::OPACITY;
target_property = compositor_target_property::OPACITY;
std::unique_ptr<CompositorFloatAnimationCurve> float_curve =
CompositorFloatAnimationCurve::Create();
AddKeyframesToCurve(*float_curve, values);
......@@ -670,7 +670,7 @@ void CompositorAnimations::GetAnimationOnCompositor(
}
case CSSPropertyFilter:
case CSSPropertyBackdropFilter: {
target_property = CompositorTargetProperty::FILTER;
target_property = compositor_target_property::FILTER;
std::unique_ptr<CompositorFilterAnimationCurve> filter_curve =
CompositorFilterAnimationCurve::Create();
AddKeyframesToCurve(*filter_curve, values);
......@@ -683,7 +683,7 @@ void CompositorAnimations::GetAnimationOnCompositor(
case CSSPropertyScale:
case CSSPropertyTranslate:
case CSSPropertyTransform: {
target_property = CompositorTargetProperty::TRANSFORM;
target_property = compositor_target_property::TRANSFORM;
std::unique_ptr<CompositorTransformAnimationCurve> transform_curve =
CompositorTransformAnimationCurve::Create();
AddKeyframesToCurve(*transform_curve, values);
......@@ -694,7 +694,7 @@ void CompositorAnimations::GetAnimationOnCompositor(
}
case CSSPropertyVariable: {
DCHECK(RuntimeEnabledFeatures::OffMainThreadCSSPaintEnabled());
target_property = CompositorTargetProperty::CSS_CUSTOM_PROPERTY;
target_property = compositor_target_property::CSS_CUSTOM_PROPERTY;
// TODO(kevers): Extend support to non-float types.
std::unique_ptr<CompositorFloatAnimationCurve> float_curve =
CompositorFloatAnimationCurve::Create();
......
......@@ -1271,7 +1271,7 @@ TEST_F(AnimationCompositorAnimationsTest, CreateSimpleOpacityAnimation) {
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(1.0, keyframe_model->Iterations());
EXPECT_EQ(0, keyframe_model->TimeOffset());
......@@ -1333,7 +1333,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect, 2.0);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(5.0, keyframe_model->Iterations());
EXPECT_EQ(0, keyframe_model->TimeOffset());
......@@ -1385,7 +1385,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(5.0, keyframe_model->Iterations());
EXPECT_EQ(-kStartDelay, keyframe_model->TimeOffset());
......@@ -1422,7 +1422,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(10.0, keyframe_model->Iterations());
EXPECT_EQ(0, keyframe_model->TimeOffset());
......@@ -1483,7 +1483,7 @@ TEST_F(AnimationCompositorAnimationsTest, CreateReversedOpacityAnimation) {
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(10.0, keyframe_model->Iterations());
EXPECT_EQ(0, keyframe_model->TimeOffset());
......@@ -1538,7 +1538,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(5.0, keyframe_model->Iterations());
EXPECT_EQ(-kNegativeStartDelay, keyframe_model->TimeOffset());
......@@ -1580,7 +1580,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::OPACITY,
EXPECT_EQ(compositor_target_property::OPACITY,
keyframe_model->TargetProperty());
EXPECT_EQ(1.0, keyframe_model->Iterations());
EXPECT_EQ(0, keyframe_model->TimeOffset());
......@@ -1647,7 +1647,7 @@ TEST_F(AnimationCompositorAnimationsTest,
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
ConvertToCompositorAnimation(*effect);
EXPECT_EQ(CompositorTargetProperty::CSS_CUSTOM_PROPERTY,
EXPECT_EQ(compositor_target_property::CSS_CUSTOM_PROPERTY,
keyframe_model->TargetProperty());
std::unique_ptr<CompositorFloatAnimationCurve> keyframed_float_curve =
......
......@@ -317,8 +317,8 @@ void LinkHighlightImpl::StartHighlightAnimationIfNeeded() {
timing_function));
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
CompositorKeyframeModel::Create(*curve, CompositorTargetProperty::OPACITY,
0, 0);
CompositorKeyframeModel::Create(
*curve, compositor_target_property::OPACITY, 0, 0);
content_layer_->SetIsDrawable(true);
compositor_animation_->AddKeyframeModel(std::move(keyframe_model));
......
......@@ -134,7 +134,8 @@ void ProgrammaticScrollAnimator::UpdateCompositorAnimations() {
!is_sequenced_scroll_) {
std::unique_ptr<CompositorKeyframeModel> animation =
CompositorKeyframeModel::Create(
*animation_curve_, CompositorTargetProperty::SCROLL_OFFSET, 0, 0);
*animation_curve_, compositor_target_property::SCROLL_OFFSET, 0,
0);
int animation_id = animation->Id();
int animation_group_id = animation->Group();
......
......@@ -258,7 +258,7 @@ bool ScrollAnimator::SendAnimationToCompositor() {
std::unique_ptr<CompositorKeyframeModel> animation =
CompositorKeyframeModel::Create(
*animation_curve_, CompositorTargetProperty::SCROLL_OFFSET, 0, 0);
*animation_curve_, compositor_target_property::SCROLL_OFFSET, 0, 0);
// Being here means that either there is an animation that needs
// to be sent to the compositor, or an animation that needs to
// be updated (a new scroll event before the previous animation
......
......@@ -69,8 +69,8 @@ TEST_P(AnimatedLayersTest, updateLayerShouldFlattenTransformWithAnimations) {
*CubicBezierTimingFunction::Preset(
CubicBezierTimingFunction::EaseType::EASE)));
std::unique_ptr<CompositorKeyframeModel> float_keyframe_model(
CompositorKeyframeModel::Create(*curve, CompositorTargetProperty::OPACITY,
0, 0));
CompositorKeyframeModel::Create(
*curve, compositor_target_property::OPACITY, 0, 0));
int keyframe_model_id = float_keyframe_model->Id();
std::unique_ptr<CompositorAnimationTimeline> compositor_timeline =
......
......@@ -64,21 +64,21 @@ TEST_F(CompositorAnimationTest, NullDelegate) {
CompositorFloatAnimationCurve::Create();
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
CompositorKeyframeModel::Create(
*curve, CompositorTargetProperty::TRANSFORM, 1, 0);
*curve, compositor_target_property::TRANSFORM, 1, 0);
animation->AddKeyframeModel(std::move(keyframe_model));
animation->SetAnimationDelegate(delegate.get());
EXPECT_FALSE(delegate->finished_);
cc_animation->NotifyKeyframeModelFinishedForTesting(
CompositorTargetProperty::TRANSFORM, 1);
compositor_target_property::TRANSFORM, 1);
EXPECT_TRUE(delegate->finished_);
delegate->ResetFlags();
animation->SetAnimationDelegate(nullptr);
cc_animation->NotifyKeyframeModelFinishedForTesting(
CompositorTargetProperty::TRANSFORM, 1);
compositor_target_property::TRANSFORM, 1);
EXPECT_FALSE(delegate->finished_);
}
......@@ -94,15 +94,15 @@ TEST_F(CompositorAnimationTest, NotifyFromCCAfterCompositorAnimationDeletion) {
std::unique_ptr<CompositorAnimationCurve> curve =
CompositorFloatAnimationCurve::Create();
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
CompositorKeyframeModel::Create(*curve, CompositorTargetProperty::OPACITY,
1, 0);
CompositorKeyframeModel::Create(
*curve, compositor_target_property::OPACITY, 1, 0);
animation->AddKeyframeModel(std::move(keyframe_model));
animation->SetAnimationDelegate(delegate.get());
EXPECT_FALSE(delegate->finished_);
cc_animation->NotifyKeyframeModelFinishedForTesting(
CompositorTargetProperty::OPACITY, 1);
compositor_target_property::OPACITY, 1);
EXPECT_TRUE(delegate->finished_);
delegate->finished_ = false;
......@@ -111,7 +111,7 @@ TEST_F(CompositorAnimationTest, NotifyFromCCAfterCompositorAnimationDeletion) {
// No notifications. Doesn't crash.
cc_animation->NotifyKeyframeModelFinishedForTesting(
CompositorTargetProperty::OPACITY, 1);
compositor_target_property::OPACITY, 1);
EXPECT_FALSE(delegate->finished_);
}
......
......@@ -25,7 +25,7 @@ namespace blink {
CompositorKeyframeModel::CompositorKeyframeModel(
const CompositorAnimationCurve& curve,
CompositorTargetProperty::Type target_property,
compositor_target_property::Type target_property,
int keyframe_model_id,
int group_id) {
if (!keyframe_model_id)
......@@ -48,8 +48,9 @@ int CompositorKeyframeModel::Group() const {
return keyframe_model_->group();
}
CompositorTargetProperty::Type CompositorKeyframeModel::TargetProperty() const {
return static_cast<CompositorTargetProperty::Type>(
compositor_target_property::Type CompositorKeyframeModel::TargetProperty()
const {
return static_cast<compositor_target_property::Type>(
keyframe_model_->target_property_id());
}
......
......@@ -33,7 +33,7 @@ class PLATFORM_EXPORT CompositorKeyframeModel {
static std::unique_ptr<CompositorKeyframeModel> Create(
const blink::CompositorAnimationCurve& curve,
CompositorTargetProperty::Type target,
compositor_target_property::Type target,
int group_id,
int keyframe_model_id) {
return base::WrapUnique(new CompositorKeyframeModel(
......@@ -46,7 +46,7 @@ class PLATFORM_EXPORT CompositorKeyframeModel {
int Id() const;
int Group() const;
CompositorTargetProperty::Type TargetProperty() const;
compositor_target_property::Type TargetProperty() const;
void SetElementId(CompositorElementId element_id);
......@@ -80,7 +80,7 @@ class PLATFORM_EXPORT CompositorKeyframeModel {
private:
CompositorKeyframeModel(const CompositorAnimationCurve&,
CompositorTargetProperty::Type,
compositor_target_property::Type,
int keyframe_model_id,
int group_id);
......
......@@ -13,8 +13,8 @@ TEST(WebCompositorAnimationTest, DefaultSettings) {
std::unique_ptr<CompositorAnimationCurve> curve =
CompositorFloatAnimationCurve::Create();
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
CompositorKeyframeModel::Create(*curve, CompositorTargetProperty::OPACITY,
1, 0);
CompositorKeyframeModel::Create(
*curve, compositor_target_property::OPACITY, 1, 0);
// Ensure that the defaults are correct.
EXPECT_EQ(1, keyframe_model->Iterations());
......@@ -28,8 +28,8 @@ TEST(WebCompositorAnimationTest, ModifiedSettings) {
std::unique_ptr<CompositorFloatAnimationCurve> curve =
CompositorFloatAnimationCurve::Create();
std::unique_ptr<CompositorKeyframeModel> keyframe_model =
CompositorKeyframeModel::Create(*curve, CompositorTargetProperty::OPACITY,
1, 0);
CompositorKeyframeModel::Create(
*curve, compositor_target_property::OPACITY, 1, 0);
keyframe_model->SetIterations(2);
keyframe_model->SetStartTime(2);
keyframe_model->SetTimeOffset(2);
......
......@@ -9,7 +9,7 @@
namespace blink {
namespace CompositorTargetProperty = cc::TargetProperty;
namespace compositor_target_property = cc::TargetProperty;
} // namespace blink
......
......@@ -226,6 +226,7 @@ _CONFIG = [
# Nested namespaces under the blink namespace
'background_scheduler::.+',
'canvas_heuristic_parameters::.+',
'compositor_target_property::.+',
'cors::.+',
'css_parsing_utils::.+',
'cssvalue::.+',
......
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