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

Side by Side Diff: cc/layers/layer_impl_unittest.cc

Issue 465853004: Moving RenderSurface creation outside of CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated unit tests 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/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "cc/layers/painted_scrollbar_layer_impl.h" 7 #include "cc/layers/painted_scrollbar_layer_impl.h"
8 #include "cc/output/filter_operation.h" 8 #include "cc/output/filter_operation.h"
9 #include "cc/output/filter_operations.h" 9 #include "cc/output/filter_operations.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { 246 TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) {
247 FakeImplProxy proxy; 247 FakeImplProxy proxy;
248 TestSharedBitmapManager shared_bitmap_manager; 248 TestSharedBitmapManager shared_bitmap_manager;
249 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); 249 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
250 EXPECT_TRUE(host_impl.InitializeRenderer( 250 EXPECT_TRUE(host_impl.InitializeRenderer(
251 FakeOutputSurface::Create3d().PassAs<OutputSurface>())); 251 FakeOutputSurface::Create3d().PassAs<OutputSurface>()));
252 host_impl.active_tree()->SetRootLayer( 252 host_impl.active_tree()->SetRootLayer(
253 LayerImpl::Create(host_impl.active_tree(), 1)); 253 LayerImpl::Create(host_impl.active_tree(), 1));
254 LayerImpl* root = host_impl.active_tree()->root_layer(); 254 LayerImpl* root = host_impl.active_tree()->root_layer();
255 root->CreateRenderSurface();
255 scoped_ptr<LayerImpl> layer_ptr = 256 scoped_ptr<LayerImpl> layer_ptr =
256 LayerImpl::Create(host_impl.active_tree(), 2); 257 LayerImpl::Create(host_impl.active_tree(), 2);
257 LayerImpl* layer = layer_ptr.get(); 258 LayerImpl* layer = layer_ptr.get();
258 root->AddChild(layer_ptr.Pass()); 259 root->AddChild(layer_ptr.Pass());
259 layer->SetScrollClipLayer(root->id()); 260 layer->SetScrollClipLayer(root->id());
260 DCHECK(host_impl.CanDraw()); 261 DCHECK(host_impl.CanDraw());
261 262
262 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); 263 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f);
263 float arbitrary_number = 0.352f; 264 float arbitrary_number = 0.352f;
264 gfx::Size arbitrary_size = gfx::Size(111, 222); 265 gfx::Size arbitrary_size = gfx::Size(111, 222);
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 layer()->id(), tree()->root_layer()->id()); 685 layer()->id(), tree()->root_layer()->id());
685 686
686 int expected_horizontal_maximum = 687 int expected_horizontal_maximum =
687 layer()->bounds().width() - tree()->root_layer()->bounds().width(); 688 layer()->bounds().width() - tree()->root_layer()->bounds().width();
688 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); 689 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum());
689 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); 690 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos());
690 } 691 }
691 692
692 } // namespace 693 } // namespace
693 } // namespace cc 694 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698