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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 2559273003: Blink Compositor Animation: Introduce CompositorAnimationHost correctly. (Closed)
Patch Set: Allocate on stack in unit tests. Created 4 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 // the initial viewport width. 788 // the initial viewport width.
789 // 2. The author has disabled viewport zoom. 789 // 2. The author has disabled viewport zoom.
790 const PageScaleConstraints& constraints = 790 const PageScaleConstraints& constraints =
791 frameHost().pageScaleConstraintsSet().pageDefinedConstraints(); 791 frameHost().pageScaleConstraintsSet().pageDefinedConstraints();
792 792
793 return mainFrame()->view()->layoutSize().width() == m_size.width() || 793 return mainFrame()->view()->layoutSize().width() == m_size.width() ||
794 (constraints.minimumScale == constraints.maximumScale && 794 (constraints.minimumScale == constraints.maximumScale &&
795 constraints.minimumScale != -1); 795 constraints.minimumScale != -1);
796 } 796 }
797 797
798 CompositorAnimationHost* VisualViewport::compositorAnimationHost() const {
799 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator();
800 return c ? c->compositorAnimationHost() : nullptr;
801 }
802
798 CompositorAnimationTimeline* VisualViewport::compositorAnimationTimeline() 803 CompositorAnimationTimeline* VisualViewport::compositorAnimationTimeline()
799 const { 804 const {
800 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator(); 805 ScrollingCoordinator* c = frameHost().page().scrollingCoordinator();
801 return c ? c->compositorAnimationTimeline() : nullptr; 806 return c ? c->compositorAnimationTimeline() : nullptr;
802 } 807 }
803 808
804 void VisualViewport::notifyRootFrameViewport() const { 809 void VisualViewport::notifyRootFrameViewport() const {
805 if (!mainFrame() || !mainFrame()->view()) 810 if (!mainFrame() || !mainFrame()->view())
806 return; 811 return;
807 812
(...skipping 23 matching lines...) Expand all
831 } else if (graphicsLayer == m_rootTransformLayer.get()) { 836 } else if (graphicsLayer == m_rootTransformLayer.get()) {
832 name = "Root Transform Layer"; 837 name = "Root Transform Layer";
833 } else { 838 } else {
834 ASSERT_NOT_REACHED(); 839 ASSERT_NOT_REACHED();
835 } 840 }
836 841
837 return name; 842 return name;
838 } 843 }
839 844
840 } // namespace blink 845 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698