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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 33236cf52e44f569ab81c5b5716bffa9c57b2bd5..c126bb4293741ee29d8d593aab396b0cba298bc3 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -64,9 +64,9 @@ static gfx::Vector2dF GetEffectiveTotalScrollOffset(LayerType* layer) {
}
inline gfx::Rect CalculateVisibleRectWithCachedLayerRect(
- gfx::Rect target_surface_rect,
- gfx::Rect layer_bound_rect,
- gfx::Rect layer_rect_in_target_space,
+ const gfx::Rect& target_surface_rect,
+ const gfx::Rect& layer_bound_rect,
+ const gfx::Rect& layer_rect_in_target_space,
const gfx::Transform& transform) {
if (layer_rect_in_target_space.IsEmpty())
return gfx::Rect();
@@ -104,8 +104,8 @@ inline gfx::Rect CalculateVisibleRectWithCachedLayerRect(
}
gfx::Rect LayerTreeHostCommon::CalculateVisibleRect(
- gfx::Rect target_surface_rect,
- gfx::Rect layer_bound_rect,
+ const gfx::Rect& target_surface_rect,
+ const gfx::Rect& layer_bound_rect,
const gfx::Transform& transform) {
gfx::Rect layer_in_surface_space =
MathUtil::MapClippedRect(transform, layer_bound_rect);
@@ -154,7 +154,7 @@ enum TranslateRectDirection {
template <typename LayerType>
static gfx::Rect TranslateRectToTargetSpace(const LayerType& ancestor_layer,
const LayerType& descendant_layer,
- gfx::Rect rect,
+ const gfx::Rect& rect,
TranslateRectDirection direction) {
gfx::Vector2dF translation = ComputeChangeOfBasisTranslation<LayerType>(
ancestor_layer, descendant_layer);
@@ -240,7 +240,7 @@ struct AccumulatedSurfaceState {
template <typename LayerType>
void UpdateAccumulatedSurfaceState(
LayerType* layer,
- gfx::Rect drawable_content_rect,
+ const gfx::Rect& drawable_content_rect,
std::vector<AccumulatedSurfaceState<LayerType> >*
accumulated_surface_state) {
if (IsRootLayer(layer))
@@ -383,8 +383,8 @@ static inline bool LayerClipsSubtree(LayerType* layer) {
template <typename LayerType>
static gfx::Rect CalculateVisibleContentRect(
LayerType* layer,
- gfx::Rect clip_rect_of_target_surface_in_target_space,
- gfx::Rect layer_rect_in_target_space) {
+ const gfx::Rect& clip_rect_of_target_surface_in_target_space,
+ const gfx::Rect& layer_rect_in_target_space) {
DCHECK(layer->render_target());
// Nothing is visible if the layer bounds are empty.
@@ -2247,7 +2247,7 @@ void LayerTreeHostCommon::CalculateDrawProperties(
static bool PointHitsRect(
gfx::PointF screen_space_point,
const gfx::Transform& local_space_to_screen_space_transform,
- gfx::RectF local_space_rect) {
+ const gfx::RectF& local_space_rect) {
// If the transform is not invertible, then assume that this point doesn't hit
// this rect.
gfx::Transform inverse_local_space_to_screen_space(
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698