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

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

Issue 877173002: Fixed position layer counter-scroll with main thread scroll offset fractional part (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready for review Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 // Save the difference but clear the sent delta so that we don't subtract 545 // Save the difference but clear the sent delta so that we don't subtract
546 // it again in SetScrollOffsetAndDelta's pending twin mirroring logic. 546 // it again in SetScrollOffsetAndDelta's pending twin mirroring logic.
547 gfx::Vector2dF remaining_delta = 547 gfx::Vector2dF remaining_delta =
548 layer_animation_controller_->scroll_offset_animation_was_interrupted() 548 layer_animation_controller_->scroll_offset_animation_was_interrupted()
549 ? gfx::Vector2dF() 549 ? gfx::Vector2dF()
550 : layer->ScrollDelta() - layer->sent_scroll_delta(); 550 : layer->ScrollDelta() - layer->sent_scroll_delta();
551 551
552 layer->SetSentScrollDelta(gfx::Vector2dF()); 552 layer->SetSentScrollDelta(gfx::Vector2dF());
553 layer->SetScrollOffsetAndDelta(scroll_offset_, remaining_delta); 553 layer->SetScrollOffsetAndDelta(scroll_offset_, remaining_delta);
554 layer->SetMainScrollOffsetFractionalPart(main_scroll_offset_fractional_part_);
554 555
555 layer->Set3dSortingContextId(sorting_context_id_); 556 layer->Set3dSortingContextId(sorting_context_id_);
556 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); 557 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_);
557 558
558 LayerImpl* scroll_parent = nullptr; 559 LayerImpl* scroll_parent = nullptr;
559 if (scroll_parent_) { 560 if (scroll_parent_) {
560 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id()); 561 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
561 DCHECK(scroll_parent); 562 DCHECK(scroll_parent);
562 } 563 }
563 564
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 SetNeedsPushProperties(); 1609 SetNeedsPushProperties();
1609 layer_tree_impl()->set_needs_update_draw_properties(); 1610 layer_tree_impl()->set_needs_update_draw_properties();
1610 if (should_have_render_surface) { 1611 if (should_have_render_surface) {
1611 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this)); 1612 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this));
1612 return; 1613 return;
1613 } 1614 }
1614 render_surface_.reset(); 1615 render_surface_.reset();
1615 } 1616 }
1616 1617
1617 } // namespace cc 1618 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698