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

Side by Side Diff: cc/tiles/tile_manager_unittest.cc

Issue 1202843008: cc: Fix BytesPerPixel issue and refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments. Created 5 years, 5 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
« cc/resources/resource_util.cc ('K') | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/thread_task_runner_handle.h" 5 #include "base/thread_task_runner_handle.h"
6 #include "cc/resources/resource_pool.h" 6 #include "cc/resources/resource_pool.h"
7 #include "cc/test/begin_frame_args_test.h" 7 #include "cc/test/begin_frame_args_test.h"
8 #include "cc/test/fake_impl_proxy.h" 8 #include "cc/test/fake_impl_proxy.h"
9 #include "cc/test/fake_layer_tree_host_impl.h" 9 #include "cc/test/fake_layer_tree_host_impl.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 // Verify that the queue has a required for draw tile at Top. 1382 // Verify that the queue has a required for draw tile at Top.
1383 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( 1383 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue(
1384 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL)); 1384 SAME_PRIORITY_FOR_BOTH_TREES, RasterTilePriorityQueue::Type::ALL));
1385 EXPECT_FALSE(queue->IsEmpty()); 1385 EXPECT_FALSE(queue->IsEmpty());
1386 EXPECT_TRUE(queue->Top().tile()->required_for_draw()); 1386 EXPECT_TRUE(queue->Top().tile()->required_for_draw());
1387 EXPECT_EQ(gfx::Size(256, 256), queue->Top().tile()->desired_texture_size()); 1387 EXPECT_EQ(gfx::Size(256, 256), queue->Top().tile()->desired_texture_size());
1388 EXPECT_EQ(RGBA_8888, host_impl_.resource_provider()->best_texture_format()); 1388 EXPECT_EQ(RGBA_8888, host_impl_.resource_provider()->best_texture_format());
1389 1389
1390 ManagedMemoryPolicy policy = host_impl_.ActualManagedMemoryPolicy(); 1390 ManagedMemoryPolicy policy = host_impl_.ActualManagedMemoryPolicy();
1391 policy.bytes_limit_when_visible = 1391 policy.bytes_limit_when_visible =
1392 Resource::UncheckedMemorySizeBytes(gfx::Size(256, 256), RGBA_8888); 1392 ResourceUtil::UncheckedSizeInBytes(gfx::Size(256, 256), RGBA_8888);
1393 host_impl_.SetMemoryPolicy(policy); 1393 host_impl_.SetMemoryPolicy(policy);
1394 1394
1395 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); 1395 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw());
1396 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state()); 1396 host_impl_.tile_manager()->PrepareTiles(host_impl_.global_tile_state());
1397 EXPECT_TRUE(host_impl_.is_likely_to_require_a_draw()); 1397 EXPECT_TRUE(host_impl_.is_likely_to_require_a_draw());
1398 1398
1399 scoped_ptr<ScopedResource> resource = 1399 scoped_ptr<ScopedResource> resource =
1400 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256), 1400 host_impl_.resource_pool()->AcquireResource(gfx::Size(256, 256),
1401 RGBA_8888); 1401 RGBA_8888);
1402 1402
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 non_intersecting_rect, // Soon rect. 1459 non_intersecting_rect, // Soon rect.
1460 intersecting_rect); // Eventually rect. 1460 intersecting_rect); // Eventually rect.
1461 scoped_ptr<TilingSetRasterQueueAll> queue( 1461 scoped_ptr<TilingSetRasterQueueAll> queue(
1462 new TilingSetRasterQueueAll(tiling_set.get(), false)); 1462 new TilingSetRasterQueueAll(tiling_set.get(), false));
1463 EXPECT_FALSE(queue->IsEmpty()); 1463 EXPECT_FALSE(queue->IsEmpty());
1464 } 1464 }
1465 } 1465 }
1466 1466
1467 } // namespace 1467 } // namespace
1468 } // namespace cc 1468 } // namespace cc
OLDNEW
« cc/resources/resource_util.cc ('K') | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698