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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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.h ('k') | cc/trees/layer_tree_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 0f48cb205dda2d31116c2cc9ea61a9832e7302e9..fa4dd5dc544dcc7a491947148d9c99a40a74927d 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -43,6 +43,7 @@
#include "cc/trees/thread_proxy.h"
#include "cc/trees/tree_synchronizer.h"
#include "ui/gfx/geometry/size_conversions.h"
+#include "ui/gfx/geometry/vector2d_conversions.h"
namespace {
static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
@@ -222,6 +223,12 @@ void LayerTreeHost::DeleteContentsTexturesOnImplThread(
contents_texture_manager_->ClearAllMemory(resource_provider);
}
+void LayerTreeHost::WillBeginMainFrame() {
+ devtools_instrumentation::WillBeginMainThreadFrame(id(),
+ source_frame_number());
+ client_->WillBeginMainFrame();
+}
+
void LayerTreeHost::DidBeginMainFrame() {
client_->DidBeginMainFrame();
}
@@ -1087,8 +1094,8 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
QueueSwapPromise(swap_promise.Pass());
}
- gfx::Vector2d inner_viewport_scroll_delta;
- gfx::Vector2d outer_viewport_scroll_delta;
+ gfx::Vector2dF inner_viewport_scroll_delta;
+ gfx::Vector2dF outer_viewport_scroll_delta;
if (root_layer_.get()) {
for (size_t i = 0; i < info->scrolls.size(); ++i) {
@@ -1131,10 +1138,13 @@ void LayerTreeHost::ApplyScrollAndScale(ScrollAndScaleSet* info) {
ApplyPageScaleDeltaFromImplSide(info->page_scale_delta);
elastic_overscroll_ += info->elastic_overscroll_delta;
if (!settings_.use_pinch_virtual_viewport) {
+ // TODO(miletus): Make sure either this code path is totally gone,
+ // or revisit the flooring here if the old pinch viewport code path
+ // is causing problems with fractional scroll offset.
client_->ApplyViewportDeltas(
- inner_viewport_scroll_delta + outer_viewport_scroll_delta,
- info->page_scale_delta,
- info->top_controls_delta);
+ gfx::ToFlooredVector2d(inner_viewport_scroll_delta +
+ outer_viewport_scroll_delta),
+ info->page_scale_delta, info->top_controls_delta);
} else {
// TODO(ccameron): pass the elastic overscroll here so that input events
// may be translated appropriately.
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698