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

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

Issue 1999783003: cc : Initialize solid color scrollbar layer on main thread to 0. (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 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2671 host_impl_->InitializeRenderer(output_surface_.get()); 2671 host_impl_->InitializeRenderer(output_surface_.get());
2672 2672
2673 SetupScrollAndContentsLayers(content_size); 2673 SetupScrollAndContentsLayers(content_size);
2674 host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 4.f); 2674 host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 4.f);
2675 host_impl_->SetViewportSize( 2675 host_impl_->SetViewportSize(
2676 gfx::Size(content_size.width() / 2, content_size.height() / 2)); 2676 gfx::Size(content_size.width() / 2, content_size.height() / 2));
2677 2677
2678 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar = 2678 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar =
2679 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), 400, 2679 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), 400,
2680 VERTICAL, 10, 0, false, true); 2680 VERTICAL, 10, 0, false, true);
2681 scrollbar->SetOpacity(0.f);
2681 EXPECT_FLOAT_EQ(0.f, scrollbar->opacity()); 2682 EXPECT_FLOAT_EQ(0.f, scrollbar->opacity());
2682 2683
2683 LayerImpl* scroll = host_impl_->active_tree()->OuterViewportScrollLayer(); 2684 LayerImpl* scroll = host_impl_->active_tree()->OuterViewportScrollLayer();
2684 LayerImpl* root = host_impl_->active_tree()->InnerViewportContainerLayer(); 2685 LayerImpl* root = host_impl_->active_tree()->InnerViewportContainerLayer();
2685 scrollbar->SetScrollLayerId(scroll->id()); 2686 scrollbar->SetScrollLayerId(scroll->id());
2686 root->AddChild(std::move(scrollbar)); 2687 root->AddChild(std::move(scrollbar));
2687 2688
2688 host_impl_->active_tree()->DidBecomeActive(); 2689 host_impl_->active_tree()->DidBecomeActive();
2689 SetNeedsRebuildPropertyTrees(); 2690 SetNeedsRebuildPropertyTrees();
2690 DrawFrame(); 2691 DrawFrame();
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 settings.scrollbar_fade_delay_ms = 20; 2856 settings.scrollbar_fade_delay_ms = 20;
2856 settings.scrollbar_fade_duration_ms = 20; 2857 settings.scrollbar_fade_duration_ms = 20;
2857 gfx::Size content_size(100, 100); 2858 gfx::Size content_size(100, 100);
2858 2859
2859 CreateHostImpl(settings, CreateOutputSurface()); 2860 CreateHostImpl(settings, CreateOutputSurface());
2860 host_impl_->CreatePendingTree(); 2861 host_impl_->CreatePendingTree();
2861 CreateScrollAndContentsLayers(host_impl_->pending_tree(), content_size); 2862 CreateScrollAndContentsLayers(host_impl_->pending_tree(), content_size);
2862 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar = 2863 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar =
2863 SolidColorScrollbarLayerImpl::Create(host_impl_->pending_tree(), 400, 2864 SolidColorScrollbarLayerImpl::Create(host_impl_->pending_tree(), 400,
2864 VERTICAL, 10, 0, false, true); 2865 VERTICAL, 10, 0, false, true);
2866 scrollbar->SetOpacity(0.f);
2865 LayerImpl* scroll = host_impl_->pending_tree()->OuterViewportScrollLayer(); 2867 LayerImpl* scroll = host_impl_->pending_tree()->OuterViewportScrollLayer();
2866 LayerImpl* root = host_impl_->pending_tree()->InnerViewportContainerLayer(); 2868 LayerImpl* root = host_impl_->pending_tree()->InnerViewportContainerLayer();
2867 scrollbar->SetScrollLayerId(scroll->id()); 2869 scrollbar->SetScrollLayerId(scroll->id());
2868 root->AddChild(std::move(scrollbar)); 2870 root->AddChild(std::move(scrollbar));
2869 host_impl_->pending_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f); 2871 host_impl_->pending_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f);
2870 host_impl_->pending_tree()->BuildPropertyTreesForTesting(); 2872 host_impl_->pending_tree()->BuildPropertyTreesForTesting();
2871 host_impl_->ActivateSyncTree(); 2873 host_impl_->ActivateSyncTree();
2872 2874
2873 LayerImpl* scrollbar_layer = host_impl_->active_tree()->LayerById(400); 2875 LayerImpl* scrollbar_layer = host_impl_->active_tree()->LayerById(400);
2874 2876
(...skipping 7875 matching lines...) Expand 10 before | Expand all | Expand 10 after
10750 10752
10751 // Re-initialize with a software output surface. 10753 // Re-initialize with a software output surface.
10752 output_surface_ = FakeOutputSurface::CreateSoftware( 10754 output_surface_ = FakeOutputSurface::CreateSoftware(
10753 base::WrapUnique(new SoftwareOutputDevice)); 10755 base::WrapUnique(new SoftwareOutputDevice));
10754 host_impl_->InitializeRenderer(output_surface_.get()); 10756 host_impl_->InitializeRenderer(output_surface_.get());
10755 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 10757 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
10756 } 10758 }
10757 10759
10758 } // namespace 10760 } // namespace
10759 } // namespace cc 10761 } // namespace cc
OLDNEW
« cc/layers/solid_color_scrollbar_layer.cc ('K') | « cc/layers/solid_color_scrollbar_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698