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

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

Issue 12967018: cc: Avoid pointless gfx::Point/Size contructors when making Rects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RectFs as well Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/io_surface_layer_impl.cc ('k') | cc/layers/layer_iterator_unittest.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_events.h" 9 #include "cc/animation/animation_events.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void Layer::SetNeedsFullTreeSync() { 119 void Layer::SetNeedsFullTreeSync() {
120 if (layer_tree_host_) 120 if (layer_tree_host_)
121 layer_tree_host_->SetNeedsFullTreeSync(); 121 layer_tree_host_->SetNeedsFullTreeSync();
122 } 122 }
123 123
124 gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const { 124 gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
125 gfx::RectF content_rect = 125 gfx::RectF content_rect =
126 gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y()); 126 gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y());
127 // Intersect with content rect to avoid the extra pixel because for some 127 // Intersect with content rect to avoid the extra pixel because for some
128 // values x and y, ceil((x / y) * y) may be x + 1. 128 // values x and y, ceil((x / y) * y) may be x + 1.
129 content_rect.Intersect(gfx::Rect(gfx::Point(), content_bounds())); 129 content_rect.Intersect(gfx::Rect(content_bounds()));
130 return gfx::ToEnclosingRect(content_rect); 130 return gfx::ToEnclosingRect(content_rect);
131 } 131 }
132 132
133 bool Layer::BlocksPendingCommit() const { 133 bool Layer::BlocksPendingCommit() const {
134 return false; 134 return false;
135 } 135 }
136 136
137 bool Layer::CanClipSelf() const { 137 bool Layer::CanClipSelf() const {
138 return false; 138 return false;
139 } 139 }
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 if (contents_opaque()) 811 if (contents_opaque())
812 return visible_content_rect(); 812 return visible_content_rect();
813 return Region(); 813 return Region();
814 } 814 }
815 815
816 ScrollbarLayer* Layer::ToScrollbarLayer() { 816 ScrollbarLayer* Layer::ToScrollbarLayer() {
817 return NULL; 817 return NULL;
818 } 818 }
819 819
820 } // namespace cc 820 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/io_surface_layer_impl.cc ('k') | cc/layers/layer_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698