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

Unified Diff: cc/blink/web_layer_impl.cc

Issue 584503005: Make scroll offset type of float in cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: link crbug to TODO Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/blink/web_scroll_offset_animation_curve_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_layer_impl.cc
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index c1f67fbed3af08fbe712b402c8c9e47b58a24ddb..ddbad414b3bb34b68e550e7d4be3931f6d88ac53 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -27,6 +27,7 @@
#include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
+#include "ui/gfx/geometry/vector2d_conversions.h"
using cc::Animation;
using cc::Layer;
@@ -268,11 +269,12 @@ void WebLayerImpl::setForceRenderSurface(bool force_render_surface) {
}
void WebLayerImpl::setScrollPosition(blink::WebPoint position) {
- layer_->SetScrollOffset(gfx::Point(position).OffsetFromOrigin());
+ layer_->SetScrollOffset(gfx::ScrollOffset(position.x, position.y));
}
blink::WebPoint WebLayerImpl::scrollPosition() const {
- return gfx::PointAtOffsetFromOrigin(layer_->scroll_offset());
+ return gfx::PointAtOffsetFromOrigin(
+ gfx::ScrollOffsetToFlooredVector2d(layer_->scroll_offset()));
}
void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) {
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/blink/web_scroll_offset_animation_curve_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698