Changeset 127476 in webkit
- Timestamp:
- Sep 4, 2012 11:37:26 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r127474 r127476 1 2012-09-04 Brian Anderson <brianderson@chromium.org> 2 3 [chromium] Do not allow infinite pending frames in CCFrameRateController 4 https://bugs.webkit.org/show_bug.cgi?id=94254 5 6 Reviewed by James Robinson. 7 8 Removes support for infinite pending frames in CCFrameRateController 9 if swap acks are available. 10 11 Functionality covered by existing tests. 12 13 * platform/graphics/chromium/cc/CCFrameRateController.cpp: 14 (WebCore::CCFrameRateController::CCFrameRateController): 15 (WebCore::CCFrameRateController::setMaxFramesPending): 16 (WebCore::CCFrameRateController::setSwapBuffersCompleteSupported): 17 (WebCore): 18 (WebCore::CCFrameRateController::onTimerTick): 19 (WebCore::CCFrameRateController::didBeginFrame): 20 (WebCore::CCFrameRateController::didFinishFrame): 21 * platform/graphics/chromium/cc/CCFrameRateController.h: 22 (CCFrameRateController): 23 * platform/graphics/chromium/cc/CCScheduler.cpp: 24 (WebCore::CCScheduler::setSwapBuffersCompleteSupported): 25 (WebCore): 26 * platform/graphics/chromium/cc/CCScheduler.h: 27 (CCScheduler): 28 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 29 (WebCore::CCThreadProxy::initializeRendererOnImplThread): 30 1 31 2012-09-04 Tim Horton <timothy_horton@apple.com> 2 32 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp
-
Property
svn:executable
set to
*
r126954 r127476 32 32 #include <wtf/CurrentTime.h> 33 33 34 namespace { 35 36 // This will be the maximum number of pending frames unless 37 // CCFrameRateController::setMaxFramesPending is called. 38 const int defaultMaxFramesPending = 2; 39 40 } 41 34 42 namespace WebCore { 35 43 … … 53 61 : m_client(0) 54 62 , m_numFramesPending(0) 55 , m_maxFramesPending( 0)63 , m_maxFramesPending(defaultMaxFramesPending) 56 64 , m_timeSource(timer) 57 65 , m_active(false) 66 , m_swapBuffersCompleteSupported(true) 58 67 , m_isTimeSourceThrottling(true) 59 68 { … … 65 74 : m_client(0) 66 75 , m_numFramesPending(0) 67 , m_maxFramesPending( 0)76 , m_maxFramesPending(defaultMaxFramesPending) 68 77 , m_active(false) 78 , m_swapBuffersCompleteSupported(true) 69 79 , m_isTimeSourceThrottling(false) 70 80 { … … 97 107 void CCFrameRateController::setMaxFramesPending(int maxFramesPending) 98 108 { 109 ASSERT(maxFramesPending > 0); 99 110 m_maxFramesPending = maxFramesPending; 100 111 } … … 106 117 } 107 118 119 void CCFrameRateController::setSwapBuffersCompleteSupported(bool supported) 120 { 121 m_swapBuffersCompleteSupported = supported; 122 } 123 108 124 void CCFrameRateController::onTimerTick() 109 125 { … … 111 127 112 128 // Don't forward the tick if we have too many frames in flight. 113 if (m_ maxFramesPending && m_numFramesPending >= m_maxFramesPending) {129 if (m_numFramesPending >= m_maxFramesPending) { 114 130 TRACE_EVENT0("cc", "CCFrameRateController::onTimerTickButMaxFramesPending"); 115 131 return; … … 119 135 m_client->vsyncTick(); 120 136 121 if (!m_isTimeSourceThrottling 122 && (!m_maxFramesPending || m_numFramesPending < m_maxFramesPending)) 137 if (m_swapBuffersCompleteSupported && !m_isTimeSourceThrottling && m_numFramesPending < m_maxFramesPending) 123 138 postManualTick(); 124 139 } … … 137 152 void CCFrameRateController::didBeginFrame() 138 153 { 139 m_numFramesPending++; 154 if (m_swapBuffersCompleteSupported) 155 m_numFramesPending++; 156 else if (!m_isTimeSourceThrottling) 157 postManualTick(); 140 158 } 141 159 142 160 void CCFrameRateController::didFinishFrame() 143 161 { 162 ASSERT(m_swapBuffersCompleteSupported); 163 144 164 m_numFramesPending--; 145 165 if (!m_isTimeSourceThrottling) -
Property
svn:executable
set to
-
trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h
r126431 r127476 71 71 72 72 void setTimebaseAndInterval(double timebase, double intervalSeconds); 73 void setSwapBuffersCompleteSupported(bool); 73 74 74 75 protected: … … 87 88 OwnPtr<CCFrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter; 88 89 bool m_active; 90 bool m_swapBuffersCompleteSupported; 89 91 90 92 // Members for unthrottled frame-rate. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
r127079 r127476 107 107 } 108 108 109 void CCScheduler::setSwapBuffersCompleteSupported(bool supported) 110 { 111 m_frameRateController->setSwapBuffersCompleteSupported(supported); 112 } 113 109 114 void CCScheduler::didSwapBuffersComplete() 110 115 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
r127079 r127476 98 98 99 99 void setMaxFramesPending(int); 100 void setSwapBuffersCompleteSupported(bool); 100 101 void didSwapBuffersComplete(); 101 102 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r127317 r127476 889 889 if (*initializeSucceeded) { 890 890 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); 891 if (capabilities->usingSwapCompleteCallback)892 m_schedulerOnImplThread->setMaxFramesPending(2);891 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( 892 capabilities->usingSwapCompleteCallback); 893 893 } 894 894
Note: See TracChangeset
for help on using the changeset viewer.