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

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

Issue 656463004: Use the scheduling mechanism provided by the platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Mike's comments. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebKit.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 #include "platform/PopupMenuClient.h" 105 #include "platform/PopupMenuClient.h"
106 #include "platform/RuntimeEnabledFeatures.h" 106 #include "platform/RuntimeEnabledFeatures.h"
107 #include "platform/TraceEvent.h" 107 #include "platform/TraceEvent.h"
108 #include "platform/UserGestureIndicator.h" 108 #include "platform/UserGestureIndicator.h"
109 #include "platform/exported/WebActiveGestureAnimation.h" 109 #include "platform/exported/WebActiveGestureAnimation.h"
110 #include "platform/fonts/FontCache.h" 110 #include "platform/fonts/FontCache.h"
111 #include "platform/graphics/Color.h" 111 #include "platform/graphics/Color.h"
112 #include "platform/graphics/FirstPaintInvalidationTracking.h" 112 #include "platform/graphics/FirstPaintInvalidationTracking.h"
113 #include "platform/graphics/Image.h" 113 #include "platform/graphics/Image.h"
114 #include "platform/graphics/ImageBuffer.h" 114 #include "platform/graphics/ImageBuffer.h"
115 #include "platform/scheduler/Scheduler.h"
116 #include "platform/scroll/ScrollbarTheme.h" 115 #include "platform/scroll/ScrollbarTheme.h"
117 #include "platform/weborigin/SchemeRegistry.h" 116 #include "platform/weborigin/SchemeRegistry.h"
118 #include "public/platform/Platform.h" 117 #include "public/platform/Platform.h"
119 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" 118 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h"
120 #include "public/platform/WebDragData.h" 119 #include "public/platform/WebDragData.h"
121 #include "public/platform/WebFloatPoint.h" 120 #include "public/platform/WebFloatPoint.h"
122 #include "public/platform/WebGestureCurve.h" 121 #include "public/platform/WebGestureCurve.h"
123 #include "public/platform/WebImage.h" 122 #include "public/platform/WebImage.h"
124 #include "public/platform/WebLayerTreeView.h" 123 #include "public/platform/WebLayerTreeView.h"
125 #include "public/platform/WebURLRequest.h" 124 #include "public/platform/WebURLRequest.h"
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 } 1834 }
1836 1835
1837 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) 1836 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime)
1838 { 1837 {
1839 TRACE_EVENT0("blink", "WebViewImpl::beginFrame"); 1838 TRACE_EVENT0("blink", "WebViewImpl::beginFrame");
1840 1839
1841 WebBeginFrameArgs validFrameTime(frameTime); 1840 WebBeginFrameArgs validFrameTime(frameTime);
1842 if (!validFrameTime.lastFrameTimeMonotonic) 1841 if (!validFrameTime.lastFrameTimeMonotonic)
1843 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime(); 1842 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime();
1844 1843
1845 Scheduler::shared()->willBeginFrame(validFrameTime.lastFrameTimeMonotonic + validFrameTime.interval);
1846
1847 // Create synthetic wheel events as necessary for fling. 1844 // Create synthetic wheel events as necessary for fling.
1848 if (m_gestureAnimation) { 1845 if (m_gestureAnimation) {
1849 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic)) 1846 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic))
1850 scheduleAnimation(); 1847 scheduleAnimation();
1851 else { 1848 else {
1852 endActiveFlingAnimation(); 1849 endActiveFlingAnimation();
1853 1850
1854 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, 1851 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd,
1855 m_positionOnFlingStart, m_globalPositionOnFlingStart, 1852 m_positionOnFlingStart, m_globalPositionOnFlingStart,
1856 IntSize(), 0, false, false, false, false, 1853 IntSize(), 0, false, false, false, false,
(...skipping 11 matching lines...) Expand all
1868 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton ic, *m_page->deprecatedLocalMainFrame()); 1865 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton ic, *m_page->deprecatedLocalMainFrame());
1869 1866
1870 if (m_continuousPaintingEnabled) { 1867 if (m_continuousPaintingEnabled) {
1871 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO verlays.get()); 1868 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, m_pageO verlays.get());
1872 m_client->scheduleAnimation(); 1869 m_client->scheduleAnimation();
1873 } 1870 }
1874 } 1871 }
1875 1872
1876 void WebViewImpl::didCommitFrameToCompositor() 1873 void WebViewImpl::didCommitFrameToCompositor()
1877 { 1874 {
1878 Scheduler::shared()->didCommitFrameToCompositor(); 1875 // TODO: Remove this function.
1879 } 1876 }
1880 1877
1881 void WebViewImpl::layout() 1878 void WebViewImpl::layout()
1882 { 1879 {
1883 TRACE_EVENT0("blink", "WebViewImpl::layout"); 1880 TRACE_EVENT0("blink", "WebViewImpl::layout");
1884 if (!localFrameRootTemporary()) 1881 if (!localFrameRootTemporary())
1885 return; 1882 return;
1886 1883
1887 PageWidgetDelegate::layout(*m_page, *localFrameRootTemporary()->frame()); 1884 PageWidgetDelegate::layout(*m_page, *localFrameRootTemporary()->frame());
1888 updateLayerTreeBackgroundColor(); 1885 updateLayerTreeBackgroundColor();
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after
4468 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4465 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4469 4466
4470 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4467 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4471 return false; 4468 return false;
4472 4469
4473 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4470 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4474 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4471 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4475 } 4472 }
4476 4473
4477 } // namespace blink 4474 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebKit.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698