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

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

Issue 511253003: Made Blink aware of top controls offset (Chromium-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash + mojo example build break Created 6 years, 3 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 layer_tree_host()->root_layer()->AddChild(scroll_layer_); 856 layer_tree_host()->root_layer()->AddChild(scroll_layer_);
857 // This test requires the page_scale and inner viewport layers to be 857 // This test requires the page_scale and inner viewport layers to be
858 // identified. 858 // identified.
859 layer_tree_host()->RegisterViewportLayers( 859 layer_tree_host()->RegisterViewportLayers(
860 root_layer, scroll_layer_.get(), NULL); 860 root_layer, scroll_layer_.get(), NULL);
861 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); 861 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
862 } 862 }
863 863
864 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } 864 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
865 865
866 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, 866 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
867 float scale) OVERRIDE { 867 float scale,
868 float) OVERRIDE {
868 gfx::Vector2d offset = scroll_layer_->scroll_offset(); 869 gfx::Vector2d offset = scroll_layer_->scroll_offset();
869 scroll_layer_->SetScrollOffset(offset + scroll_delta); 870 scroll_layer_->SetScrollOffset(offset + scroll_delta);
870 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); 871 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
871 } 872 }
872 873
873 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { 874 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
874 // We get one commit before the first draw, and the animation doesn't happen 875 // We get one commit before the first draw, and the animation doesn't happen
875 // until the second draw. 876 // until the second draw.
876 switch (impl->active_tree()->source_frame_number()) { 877 switch (impl->active_tree()->source_frame_number()) {
877 case 0: 878 case 0:
(...skipping 4155 matching lines...) Expand 10 before | Expand all | Expand 10 after
5033 const gfx::Size bounds_; 5034 const gfx::Size bounds_;
5034 FakeContentLayerClient client_; 5035 FakeContentLayerClient client_;
5035 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; 5036 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_;
5036 scoped_refptr<FakePictureLayer> picture_layer_; 5037 scoped_refptr<FakePictureLayer> picture_layer_;
5037 Layer* child_layer_; 5038 Layer* child_layer_;
5038 }; 5039 };
5039 5040
5040 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); 5041 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting);
5041 5042
5042 } // namespace cc 5043 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_unittest_no_message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698