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

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

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement ContextProviderInProcess::DetachFromThread(). Created 5 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after
2590 // not having this update will cause a crash. 2590 // not having this update will cause a crash.
2591 TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) { 2591 TEST_F(DeferredInitPictureLayerImplTest, PreventUpdateTilesDuringLostContext) {
2592 host_impl_.pending_tree()->UpdateDrawProperties(); 2592 host_impl_.pending_tree()->UpdateDrawProperties();
2593 host_impl_.active_tree()->UpdateDrawProperties(); 2593 host_impl_.active_tree()->UpdateDrawProperties();
2594 EXPECT_FALSE(host_impl_.pending_tree()->needs_update_draw_properties()); 2594 EXPECT_FALSE(host_impl_.pending_tree()->needs_update_draw_properties());
2595 EXPECT_FALSE(host_impl_.active_tree()->needs_update_draw_properties()); 2595 EXPECT_FALSE(host_impl_.active_tree()->needs_update_draw_properties());
2596 2596
2597 FakeOutputSurface* fake_output_surface = 2597 FakeOutputSurface* fake_output_surface =
2598 static_cast<FakeOutputSurface*>(host_impl_.output_surface()); 2598 static_cast<FakeOutputSurface*>(host_impl_.output_surface());
2599 ASSERT_TRUE(fake_output_surface->InitializeAndSetContext3d( 2599 ASSERT_TRUE(fake_output_surface->InitializeAndSetContext3d(
2600 TestContextProvider::Create())); 2600 TestContextProvider::Create(), TestContextProvider::Create()));
2601 2601
2602 // These will crash PictureLayerImpl if this is not true. 2602 // These will crash PictureLayerImpl if this is not true.
2603 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); 2603 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties());
2604 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); 2604 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties());
2605 host_impl_.active_tree()->UpdateDrawProperties(); 2605 host_impl_.active_tree()->UpdateDrawProperties();
2606 } 2606 }
2607 2607
2608 TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) { 2608 TEST_F(PictureLayerImplTest, HighResTilingDuringAnimationForCpuRasterization) {
2609 gfx::Size viewport_size(1000, 1000); 2609 gfx::Size viewport_size(1000, 1000);
2610 host_impl_.SetViewportSize(viewport_size); 2610 host_impl_.SetViewportSize(viewport_size);
(...skipping 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
4933 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4933 result = layer->CalculateTileSize(gfx::Size(447, 400));
4934 EXPECT_EQ(result.width(), 448); 4934 EXPECT_EQ(result.width(), 448);
4935 EXPECT_EQ(result.height(), 448); 4935 EXPECT_EQ(result.height(), 448);
4936 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4936 result = layer->CalculateTileSize(gfx::Size(500, 499));
4937 EXPECT_EQ(result.width(), 512); 4937 EXPECT_EQ(result.width(), 512);
4938 EXPECT_EQ(result.height(), 500 + 2); 4938 EXPECT_EQ(result.height(), 500 + 2);
4939 } 4939 }
4940 4940
4941 } // namespace 4941 } // namespace
4942 } // namespace cc 4942 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698