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

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

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 2 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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1477 static ViewportSelectionBound ComputeViewportSelectionBound( 1477 static ViewportSelectionBound ComputeViewportSelectionBound(
1478 const LayerSelectionBound& layer_bound, 1478 const LayerSelectionBound& layer_bound,
1479 LayerImpl* layer, 1479 LayerImpl* layer,
1480 float device_scale_factor) { 1480 float device_scale_factor) {
1481 ViewportSelectionBound viewport_bound; 1481 ViewportSelectionBound viewport_bound;
1482 viewport_bound.type = layer_bound.type; 1482 viewport_bound.type = layer_bound.type;
1483 1483
1484 if (!layer || layer_bound.type == SELECTION_BOUND_EMPTY) 1484 if (!layer || layer_bound.type == SELECTION_BOUND_EMPTY)
1485 return viewport_bound; 1485 return viewport_bound;
1486 1486
1487 gfx::PointF layer_top = layer_bound.edge_top; 1487 auto layer_top = gfx::PointF(layer_bound.edge_top);
1488 gfx::PointF layer_bottom = layer_bound.edge_bottom; 1488 auto layer_bottom = gfx::PointF(layer_bound.edge_bottom);
1489 1489
1490 bool clipped = false; 1490 bool clipped = false;
1491 gfx::PointF screen_top = 1491 gfx::PointF screen_top =
1492 MathUtil::MapPoint(layer->screen_space_transform(), layer_top, &clipped); 1492 MathUtil::MapPoint(layer->screen_space_transform(), layer_top, &clipped);
1493 gfx::PointF screen_bottom = MathUtil::MapPoint( 1493 gfx::PointF screen_bottom = MathUtil::MapPoint(
1494 layer->screen_space_transform(), layer_bottom, &clipped); 1494 layer->screen_space_transform(), layer_bottom, &clipped);
1495 1495
1496 // MapPoint can produce points with NaN components (even when no inputs are 1496 // MapPoint can produce points with NaN components (even when no inputs are
1497 // NaN). Since consumers of ViewportSelectionBounds may round |edge_top| or 1497 // NaN). Since consumers of ViewportSelectionBounds may round |edge_top| or
1498 // |edge_bottom| (and since rounding will crash on NaN), we return an empty 1498 // |edge_bottom| (and since rounding will crash on NaN), we return an empty
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 const gfx::BoxF& box, 1731 const gfx::BoxF& box,
1732 gfx::BoxF* bounds) const { 1732 gfx::BoxF* bounds) const {
1733 *bounds = gfx::BoxF(); 1733 *bounds = gfx::BoxF();
1734 return layer_tree_host_impl_->animation_host() 1734 return layer_tree_host_impl_->animation_host()
1735 ? layer_tree_host_impl_->animation_host() 1735 ? layer_tree_host_impl_->animation_host()
1736 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 1736 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
1737 : true; 1737 : true;
1738 } 1738 }
1739 1739
1740 } // namespace cc 1740 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698