Commit 321a3dda authored by bsheedy's avatar bsheedy Committed by Commit Bot

[VR] Fix initial repositioning frame opacity

Currently, the frame/border around the VR browsing content window starts
off opaque, and later becomes transparent due to bindings. This makes
it start off transparent.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Iaaec76ef7b7ba4c8c54a55fc5a591327bb98d9f3
Reviewed-on: https://chromium-review.googlesource.com/1000517
Commit-Queue: Ian Vollick <vollick@chromium.org>
Reviewed-by: default avatarIan Vollick <vollick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549275}
parent 33ea909e
......@@ -63,4 +63,8 @@ void Rect::NotifyClientFloatAnimated(float value,
}
}
float Rect::ComputedAndLocalOpacityForTest() const {
return computed_opacity() * local_opacity_;
}
} // namespace vr
......@@ -44,6 +44,8 @@ class Rect : public UiElement {
int target_property_id,
cc::KeyframeModel* keyframe_model) override;
float ComputedAndLocalOpacityForTest() const override;
private:
SkColor center_color_ = SK_ColorWHITE;
SkColor edge_color_ = SK_ColorWHITE;
......
......@@ -434,6 +434,10 @@ float UiElement::computed_opacity() const {
return computed_opacity_;
}
float UiElement::ComputedAndLocalOpacityForTest() const {
return computed_opacity();
}
bool UiElement::LocalHitTest(const gfx::PointF& point) const {
if (point.x() < 0.0f || point.x() > 1.0f || point.y() < 0.0f ||
point.y() > 1.0f) {
......
......@@ -271,6 +271,8 @@ class UiElement : public cc::AnimationTarget {
computed_opacity_ = computed_opacity;
}
virtual float ComputedAndLocalOpacityForTest() const;
LayoutAlignment x_anchoring() const { return x_anchoring_; }
void set_x_anchoring(LayoutAlignment x_anchoring) {
DCHECK(x_anchoring == LEFT || x_anchoring == RIGHT || x_anchoring == NONE);
......
......@@ -214,7 +214,8 @@ void UiTest::CheckRendererOpacityRecursive(UiElement* element) {
// It is expected that some elements doesn't render anything (such as root
// elements). So skipping verify these elements should be fine.
if (renderer.called()) {
EXPECT_FLOAT_EQ(renderer.opacity(), element->computed_opacity())
EXPECT_FLOAT_EQ(renderer.opacity(),
element->ComputedAndLocalOpacityForTest())
<< "element name: " << element->name();
}
......
......@@ -1239,6 +1239,7 @@ void UiSceneCreator::CreateContentQuad() {
kRepositionFrameEdgePadding, kRepositionFrameEdgePadding);
frame->set_corner_radius(kContentCornerRadius);
frame->set_bounds_contain_padding(false);
frame->SetLocalOpacity(0.0f);
frame->SetTransitionedProperties({LOCAL_OPACITY});
frame->SetTransitionDuration(
base::TimeDelta::FromMilliseconds(kRepositionFrameTransitionDurationMs));
......
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