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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 321373003: Changing animate to beginFrame and use struct rather than naked double to allow extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing Adam+Shane's feedback. Created 6 years, 6 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 #include "platform/exported/WebActiveGestureAnimation.h" 101 #include "platform/exported/WebActiveGestureAnimation.h"
102 #include "platform/fonts/FontCache.h" 102 #include "platform/fonts/FontCache.h"
103 #include "platform/graphics/Color.h" 103 #include "platform/graphics/Color.h"
104 #include "platform/graphics/Image.h" 104 #include "platform/graphics/Image.h"
105 #include "platform/graphics/ImageBuffer.h" 105 #include "platform/graphics/ImageBuffer.h"
106 #include "platform/scroll/ScrollbarTheme.h" 106 #include "platform/scroll/ScrollbarTheme.h"
107 #include "platform/weborigin/SchemeRegistry.h" 107 #include "platform/weborigin/SchemeRegistry.h"
108 #include "public/platform/Platform.h" 108 #include "public/platform/Platform.h"
109 #include "public/platform/WebDragData.h" 109 #include "public/platform/WebDragData.h"
110 #include "public/platform/WebFloatPoint.h" 110 #include "public/platform/WebFloatPoint.h"
111 #include "public/platform/WebFrameTime.h"
111 #include "public/platform/WebGestureCurve.h" 112 #include "public/platform/WebGestureCurve.h"
112 #include "public/platform/WebImage.h" 113 #include "public/platform/WebImage.h"
113 #include "public/platform/WebLayerTreeView.h" 114 #include "public/platform/WebLayerTreeView.h"
114 #include "public/platform/WebVector.h" 115 #include "public/platform/WebVector.h"
115 #include "public/web/WebAXObject.h" 116 #include "public/web/WebAXObject.h"
116 #include "public/web/WebActiveWheelFlingParameters.h" 117 #include "public/web/WebActiveWheelFlingParameters.h"
117 #include "public/web/WebAutofillClient.h" 118 #include "public/web/WebAutofillClient.h"
118 #include "public/web/WebFrameClient.h" 119 #include "public/web/WebFrameClient.h"
119 #include "public/web/WebHitTestResult.h" 120 #include "public/web/WebHitTestResult.h"
120 #include "public/web/WebInputElement.h" 121 #include "public/web/WebInputElement.h"
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 void WebViewImpl::willExitFullScreen() 1672 void WebViewImpl::willExitFullScreen()
1672 { 1673 {
1673 m_fullscreenController->willExitFullScreen(); 1674 m_fullscreenController->willExitFullScreen();
1674 } 1675 }
1675 1676
1676 void WebViewImpl::didExitFullScreen() 1677 void WebViewImpl::didExitFullScreen()
1677 { 1678 {
1678 m_fullscreenController->didExitFullScreen(); 1679 m_fullscreenController->didExitFullScreen();
1679 } 1680 }
1680 1681
1681 void WebViewImpl::animate(double monotonicFrameBeginTime) 1682 void WebViewImpl::animate(WebFrameTime frameTime)
1682 { 1683 {
1683 TRACE_EVENT0("webkit", "WebViewImpl::animate"); 1684 TRACE_EVENT0("webkit", "WebViewImpl::animate");
1684 1685
1685 if (!monotonicFrameBeginTime)
1686 monotonicFrameBeginTime = monotonicallyIncreasingTime();
1687
1688 // Create synthetic wheel events as necessary for fling. 1686 // Create synthetic wheel events as necessary for fling.
1689 if (m_gestureAnimation) { 1687 if (m_gestureAnimation) {
1690 if (m_gestureAnimation->animate(monotonicFrameBeginTime)) 1688 if (m_gestureAnimation->animate(frameTime))
1691 scheduleAnimation(); 1689 scheduleAnimation();
1692 else { 1690 else {
1693 endActiveFlingAnimation(); 1691 endActiveFlingAnimation();
1694 1692
1695 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, 1693 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd,
1696 m_positionOnFlingStart, m_globalPositionOnFlingStart, 1694 m_positionOnFlingStart, m_globalPositionOnFlingStart,
1697 IntSize(), 0, false, false, false, false, 1695 IntSize(), 0, false, false, false, false,
1698 0, 0, 0, 0); 1696 0, 0, 0, 0);
1699 1697
1700 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS crollEvent); 1698 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS crollEvent);
1701 } 1699 }
1702 } 1700 }
1703 1701
1704 if (!m_page) 1702 if (!m_page)
1705 return; 1703 return;
1706 1704
1707 PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime); 1705 PageWidgetDelegate::animate(m_page.get(), frameTime);
1708 1706
1709 if (m_continuousPaintingEnabled) { 1707 if (m_continuousPaintingEnabled) {
1710 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO verlays.get()); 1708 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO verlays.get());
1711 m_client->scheduleAnimation(); 1709 m_client->scheduleAnimation();
1712 } 1710 }
1713 } 1711 }
1714 1712
1715 void WebViewImpl::layout() 1713 void WebViewImpl::layout()
1716 { 1714 {
1717 TRACE_EVENT0("webkit", "WebViewImpl::layout"); 1715 TRACE_EVENT0("webkit", "WebViewImpl::layout");
(...skipping 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4136 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4139 4137
4140 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4138 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4141 return false; 4139 return false;
4142 4140
4143 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4141 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4144 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4142 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4145 } 4143 }
4146 4144
4147 } // namespace blink 4145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698