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

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

Issue 1314943008: cc: Remove implicit conversions from Rect to RectF in src/cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rectfconvert-cc: rebase-and-sandwich-strategy Created 5 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/render_surface_impl.cc » ('j') | 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 "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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 517
518 gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization); 518 gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization);
519 bool success = transform_for_tile_priority.GetInverse(&screen_to_view); 519 bool success = transform_for_tile_priority.GetInverse(&screen_to_view);
520 EXPECT_TRUE(success); 520 EXPECT_TRUE(success);
521 521
522 // Note that we don't clip this to the layer bounds, since it is expected that 522 // Note that we don't clip this to the layer bounds, since it is expected that
523 // the rect will sometimes be outside of the layer bounds. If we clip to 523 // the rect will sometimes be outside of the layer bounds. If we clip to
524 // bounds, then tile priorities will end up being incorrect in cases of fully 524 // bounds, then tile priorities will end up being incorrect in cases of fully
525 // offscreen layer. 525 // offscreen layer.
526 viewport_rect_for_tile_priority_in_view_space = 526 viewport_rect_for_tile_priority_in_view_space =
527 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( 527 MathUtil::ProjectEnclosingClippedRect(screen_to_view,
528 screen_to_view, viewport_rect_for_tile_priority)); 528 viewport_rect_for_tile_priority);
529 529
530 EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space, 530 EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space,
531 active_layer_->viewport_rect_for_tile_priority_in_content_space()); 531 active_layer_->viewport_rect_for_tile_priority_in_content_space());
532 tilings = active_layer_->tilings(); 532 tilings = active_layer_->tilings();
533 for (size_t i = 0; i < tilings->num_tilings(); i++) { 533 for (size_t i = 0; i < tilings->num_tilings(); i++) {
534 PictureLayerTiling* tiling = tilings->tiling_at(i); 534 PictureLayerTiling* tiling = tilings->tiling_at(i);
535 EXPECT_EQ( 535 EXPECT_EQ(
536 tiling->GetCurrentVisibleRectForTesting(), 536 tiling->GetCurrentVisibleRectForTesting(),
537 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space, 537 gfx::ScaleToEnclosingRect(viewport_rect_for_tile_priority_in_view_space,
538 tiling->contents_scale())); 538 tiling->contents_scale()));
(...skipping 4624 matching lines...) Expand 10 before | Expand all | Expand 10 after
5163 // New low res tiling. 5163 // New low res tiling.
5164 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 5164 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
5165 5165
5166 // This tiling will be high res now, it won't contain low res content since it 5166 // This tiling will be high res now, it won't contain low res content since it
5167 // was all destroyed. 5167 // was all destroyed.
5168 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 5168 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
5169 } 5169 }
5170 5170
5171 } // namespace 5171 } // namespace
5172 } // namespace cc 5172 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698