Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1991523002: cc : Track ids for which active opacity always wins on property trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
2880 host_impl_->ScrollbarAnimationControllerForId(scroll->id()) 2880 host_impl_->ScrollbarAnimationControllerForId(scroll->id())
2881 ->DidMouseMoveNear(0); 2881 ->DidMouseMoveNear(0);
2882 host_impl_->ScrollBegin(BeginState(gfx::Point()).get(), 2882 host_impl_->ScrollBegin(BeginState(gfx::Point()).get(),
2883 InputHandler::WHEEL); 2883 InputHandler::WHEEL);
2884 host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2dF(0, 5)).get()); 2884 host_impl_->ScrollBy(UpdateState(gfx::Point(), gfx::Vector2dF(0, 5)).get());
2885 host_impl_->ScrollEnd(EndState().get()); 2885 host_impl_->ScrollEnd(EndState().get());
2886 host_impl_->CreatePendingTree(); 2886 host_impl_->CreatePendingTree();
2887 EffectNode* pending_tree_node = 2887 EffectNode* pending_tree_node =
2888 host_impl_->pending_tree()->property_trees()->effect_tree.Node( 2888 host_impl_->pending_tree()->property_trees()->effect_tree.Node(
2889 scrollbar_layer->effect_tree_index()); 2889 scrollbar_layer->effect_tree_index());
2890 LayerImpl* pending_scrollbar_layer =
2891 host_impl_->pending_tree()->LayerById(400);
2892 host_impl_->pending_tree()
2893 ->property_trees()
2894 ->always_use_active_tree_opacity_effect_ids.push_back(400);
2890 EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity); 2895 EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity);
2891 EXPECT_FLOAT_EQ(1.f, scrollbar_layer->opacity()); 2896 EXPECT_FLOAT_EQ(1.f, scrollbar_layer->opacity());
2892 EXPECT_FLOAT_EQ(0.f, pending_tree_node->data.opacity); 2897 EXPECT_FLOAT_EQ(0.f, pending_tree_node->data.opacity);
2898 pending_scrollbar_layer->SetNeedsPushProperties();
ajuma 2016/05/18 13:53:48 Is this line needed?
jaydasika 2016/05/19 00:27:09 I added this when I realized ScrollbarlayerImplBas
2893 host_impl_->ActivateSyncTree(); 2899 host_impl_->ActivateSyncTree();
2894 active_tree_node = 2900 active_tree_node =
2895 host_impl_->active_tree()->property_trees()->effect_tree.Node( 2901 host_impl_->active_tree()->property_trees()->effect_tree.Node(
2896 scrollbar_layer->effect_tree_index()); 2902 scrollbar_layer->effect_tree_index());
2897 EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity); 2903 EXPECT_FLOAT_EQ(1.f, active_tree_node->data.opacity);
2898 EXPECT_FLOAT_EQ(1.f, scrollbar_layer->opacity()); 2904 EXPECT_FLOAT_EQ(1.f, scrollbar_layer->opacity());
2899 } 2905 }
2900 }; 2906 };
2901 2907
2902 TEST_F(LayerTreeHostImplTestScrollbarOpacity, LinearFade) { 2908 TEST_F(LayerTreeHostImplTestScrollbarOpacity, LinearFade) {
(...skipping 7844 matching lines...) Expand 10 before | Expand all | Expand 10 after
10747 10753
10748 // Re-initialize with a software output surface. 10754 // Re-initialize with a software output surface.
10749 output_surface_ = FakeOutputSurface::CreateSoftware( 10755 output_surface_ = FakeOutputSurface::CreateSoftware(
10750 base::WrapUnique(new SoftwareOutputDevice)); 10756 base::WrapUnique(new SoftwareOutputDevice));
10751 host_impl_->InitializeRenderer(output_surface_.get()); 10757 host_impl_->InitializeRenderer(output_surface_.get());
10752 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 10758 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
10753 } 10759 }
10754 10760
10755 } // namespace 10761 } // namespace
10756 } // namespace cc 10762 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698