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

Unified Diff: cc/layers/layer.cc

Issue 647253002: cc: Stop converting update rect from int to float to int. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displayrectint: ccperftests Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 1d702259118a149ced30fd5519611ce1d2a1d365..dd7130711cb87feca4265190c9dd01e0738f38ab 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -202,13 +202,13 @@ bool Layer::IsPropertyChangeAllowed() const {
return !layer_tree_host_->in_paint_layer_contents();
}
-gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
- gfx::RectF content_rect =
- gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y());
+gfx::Rect Layer::LayerRectToContentRect(const gfx::Rect& layer_rect) const {
+ gfx::Rect content_rect = gfx::ScaleToEnclosingRect(
+ layer_rect, contents_scale_x(), contents_scale_y());
// Intersect with content rect to avoid the extra pixel because for some
// values x and y, ceil((x / y) * y) may be x + 1.
content_rect.Intersect(gfx::Rect(content_bounds()));
- return gfx::ToEnclosingRect(content_rect);
+ return content_rect;
}
skia::RefPtr<SkPicture> Layer::GetPicture() const {
@@ -795,7 +795,7 @@ void Layer::SetHideLayerAndSubtree(bool hide) {
SetNeedsCommit();
}
-void Layer::SetNeedsDisplayRect(const gfx::RectF& dirty_rect) {
+void Layer::SetNeedsDisplayRect(const gfx::Rect& dirty_rect) {
if (dirty_rect.IsEmpty())
return;
@@ -1003,7 +1003,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
// Reset any state that should be cleared for the next update.
stacking_order_changed_ = false;
- update_rect_ = gfx::RectF();
+ update_rect_ = gfx::Rect();
needs_push_properties_ = false;
num_dependents_need_push_properties_ = 0;
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698