Commit c2241812 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Make TranslateTransformOperation::X/Y return const Length&

Also eliminate a few copies in TranslateTransformOperation::Blend.

Change-Id: Icb390e3da70e2c3b651c34758f8e0fefa7bb4484
Reviewed-on: https://chromium-review.googlesource.com/970821Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544377}
parent 80153571
......@@ -40,10 +40,9 @@ scoped_refptr<TransformOperation> TranslateTransformOperation::Blend(
blink::Blend(z_, 0., progress), type_);
}
const TranslateTransformOperation* from_op =
static_cast<const TranslateTransformOperation*>(from);
Length from_x = from_op ? from_op->x_ : zero_length;
Length from_y = from_op ? from_op->y_ : zero_length;
const auto* from_op = ToTranslateTransformOperation(from);
const Length& from_x = from_op ? from_op->x_ : zero_length;
const Length& from_y = from_op ? from_op->y_ : zero_length;
double from_z = from_op ? from_op->z_ : 0;
return TranslateTransformOperation::Create(
x_.Blend(from_x, progress, kValueRangeAll),
......
......@@ -63,8 +63,8 @@ class PLATFORM_EXPORT TranslateTransformOperation final
return FloatValueForLength(y_, border_box_size.Height());
}
Length X() const { return x_; }
Length Y() const { return y_; }
const Length& X() const { return x_; }
const Length& Y() const { return y_; }
double Z() const { return z_; }
void Apply(TransformationMatrix& transform,
......
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