OLD | NEW |
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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 void WebViewImpl::instrumentBeginFrame() | 1323 void WebViewImpl::instrumentBeginFrame() |
1324 { | 1324 { |
1325 InspectorInstrumentation::didBeginFrame(m_page.get()); | 1325 InspectorInstrumentation::didBeginFrame(m_page.get()); |
1326 } | 1326 } |
1327 | 1327 |
1328 void WebViewImpl::instrumentCancelFrame() | 1328 void WebViewImpl::instrumentCancelFrame() |
1329 { | 1329 { |
1330 InspectorInstrumentation::didCancelFrame(m_page.get()); | 1330 InspectorInstrumentation::didCancelFrame(m_page.get()); |
1331 } | 1331 } |
1332 | 1332 |
1333 void WebViewImpl::animate(double frameBeginTime) | 1333 void WebViewImpl::animate(double) |
1334 { | 1334 { |
1335 #if ENABLE(REQUEST_ANIMATION_FRAME) | 1335 #if ENABLE(REQUEST_ANIMATION_FRAME) |
1336 // FIXME: remove this zero-check once render_widget has been modified to | 1336 double monotonicFrameBeginTime = monotonicallyIncreasingTime(); |
1337 // pass in a frameBeginTime. | |
1338 if (!frameBeginTime) | |
1339 frameBeginTime = currentTime(); | |
1340 | 1337 |
1341 #if USE(ACCELERATED_COMPOSITING) | 1338 #if USE(ACCELERATED_COMPOSITING) |
1342 // In composited mode, we always go through the compositor so it can apply | 1339 // In composited mode, we always go through the compositor so it can apply |
1343 // appropriate flow-control mechanisms. | 1340 // appropriate flow-control mechanisms. |
1344 if (isAcceleratedCompositingActive()) | 1341 if (isAcceleratedCompositingActive()) |
1345 m_layerTreeView.updateAnimations(frameBeginTime); | 1342 m_layerTreeView.updateAnimations(monotonicFrameBeginTime); |
1346 else | 1343 else |
1347 #endif | 1344 #endif |
1348 updateAnimations(frameBeginTime); | 1345 updateAnimations(monotonicFrameBeginTime); |
1349 #endif | 1346 #endif |
1350 } | 1347 } |
1351 | 1348 |
1352 void WebViewImpl::willBeginFrame() | 1349 void WebViewImpl::willBeginFrame() |
1353 { | 1350 { |
1354 m_client->willBeginCompositorFrame(); | 1351 m_client->willBeginCompositorFrame(); |
1355 } | 1352 } |
1356 | 1353 |
1357 void WebViewImpl::updateAnimations(double frameBeginTime) | 1354 void WebViewImpl::updateAnimations(double monotonicFrameBeginTime) |
1358 { | 1355 { |
1359 #if ENABLE(REQUEST_ANIMATION_FRAME) | 1356 #if ENABLE(REQUEST_ANIMATION_FRAME) |
1360 TRACE_EVENT("WebViewImpl::updateAnimations", this, 0); | 1357 TRACE_EVENT("WebViewImpl::updateAnimations", this, 0); |
1361 | 1358 |
1362 WebFrameImpl* webframe = mainFrameImpl(); | 1359 WebFrameImpl* webframe = mainFrameImpl(); |
1363 if (!webframe) | 1360 if (!webframe) |
1364 return; | 1361 return; |
1365 FrameView* view = webframe->frameView(); | 1362 FrameView* view = webframe->frameView(); |
1366 if (!view) | 1363 if (!view) |
1367 return; | 1364 return; |
1368 | 1365 |
1369 // Create synthetic wheel events as necessary for fling. | 1366 // Create synthetic wheel events as necessary for fling. |
1370 if (m_gestureAnimation) { | 1367 if (m_gestureAnimation) { |
1371 if (m_gestureAnimation->animate(frameBeginTime)) | 1368 if (m_gestureAnimation->animate(monotonicFrameBeginTime)) |
1372 scheduleAnimation(); | 1369 scheduleAnimation(); |
1373 else | 1370 else |
1374 m_gestureAnimation.clear(); | 1371 m_gestureAnimation.clear(); |
1375 } | 1372 } |
1376 | 1373 |
1377 view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(frameBeginTime)
); | 1374 double timeShift = currentTime() - monotonicallyIncreasingTime(); |
| 1375 view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameB
eginTime + timeShift)); |
1378 #endif | 1376 #endif |
1379 } | 1377 } |
1380 | 1378 |
1381 void WebViewImpl::layout() | 1379 void WebViewImpl::layout() |
1382 { | 1380 { |
1383 TRACE_EVENT("WebViewImpl::layout", this, 0); | 1381 TRACE_EVENT("WebViewImpl::layout", this, 0); |
1384 | 1382 |
1385 WebFrameImpl* webframe = mainFrameImpl(); | 1383 WebFrameImpl* webframe = mainFrameImpl(); |
1386 if (webframe) { | 1384 if (webframe) { |
1387 // In order for our child HWNDs (NativeWindowWidgets) to update properly
, | 1385 // In order for our child HWNDs (NativeWindowWidgets) to update properly
, |
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); | 3512 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); |
3515 | 3513 |
3516 if (page()) | 3514 if (page()) |
3517 page()->pointerLockController()->dispatchLockedMouseEvent( | 3515 page()->pointerLockController()->dispatchLockedMouseEvent( |
3518 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), | 3516 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), |
3519 eventType); | 3517 eventType); |
3520 } | 3518 } |
3521 #endif | 3519 #endif |
3522 | 3520 |
3523 } // namespace WebKit | 3521 } // namespace WebKit |
OLD | NEW |