| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 } else { | 388 } else { |
| 389 TRACE_EVENT0("blink", | 389 TRACE_EVENT0("blink", |
| 390 "WebPagePopupImpl::setIsAcceleratedCompositingActive(true)"); | 390 "WebPagePopupImpl::setIsAcceleratedCompositingActive(true)"); |
| 391 | 391 |
| 392 m_layerTreeView = m_widgetClient->initializeLayerTreeView(); | 392 m_layerTreeView = m_widgetClient->initializeLayerTreeView(); |
| 393 if (m_layerTreeView) { | 393 if (m_layerTreeView) { |
| 394 m_layerTreeView->setVisible(true); | 394 m_layerTreeView->setVisible(true); |
| 395 m_isAcceleratedCompositingActive = true; | 395 m_isAcceleratedCompositingActive = true; |
| 396 m_animationHost = WTF::makeUnique<CompositorAnimationHost>( | 396 m_animationHost = WTF::makeUnique<CompositorAnimationHost>( |
| 397 m_layerTreeView->compositorAnimationHost()); | 397 m_layerTreeView->compositorAnimationHost()); |
| 398 m_page->layerTreeViewInitialized(*m_layerTreeView, | 398 m_page->layerTreeViewInitialized(*m_layerTreeView, nullptr); |
| 399 m_popupClient->ownerElement() | |
| 400 .document() | |
| 401 .frame() | |
| 402 ->localFrameRoot() | |
| 403 ->view()); | |
| 404 } else { | 399 } else { |
| 405 m_isAcceleratedCompositingActive = false; | 400 m_isAcceleratedCompositingActive = false; |
| 406 m_animationHost = nullptr; | 401 m_animationHost = nullptr; |
| 407 } | 402 } |
| 408 } | 403 } |
| 409 } | 404 } |
| 410 | 405 |
| 411 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) { | 406 void WebPagePopupImpl::beginFrame(double lastFrameTimeMonotonic) { |
| 412 if (!m_page) | 407 if (!m_page) |
| 413 return; | 408 return; |
| 414 // FIXME: This should use lastFrameTimeMonotonic but doing so | 409 // FIXME: This should use lastFrameTimeMonotonic but doing so |
| 415 // breaks tests. | 410 // breaks tests. |
| 416 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); | 411 PageWidgetDelegate::animate(*m_page, monotonicallyIncreasingTime()); |
| 417 } | 412 } |
| 418 | 413 |
| 419 void WebPagePopupImpl::willCloseLayerTreeView() { | 414 void WebPagePopupImpl::willCloseLayerTreeView() { |
| 420 if (m_page && m_layerTreeView) { | 415 if (m_page && m_layerTreeView) |
| 421 m_page->willCloseLayerTreeView(*m_layerTreeView, | 416 m_page->willCloseLayerTreeView(*m_layerTreeView, nullptr); |
| 422 m_popupClient->ownerElement() | |
| 423 .document() | |
| 424 .frame() | |
| 425 ->localFrameRoot() | |
| 426 ->view()); | |
| 427 } | |
| 428 | 417 |
| 429 setIsAcceleratedCompositingActive(false); | 418 setIsAcceleratedCompositingActive(false); |
| 430 m_layerTreeView = nullptr; | 419 m_layerTreeView = nullptr; |
| 431 m_animationHost = nullptr; | 420 m_animationHost = nullptr; |
| 432 } | 421 } |
| 433 | 422 |
| 434 void WebPagePopupImpl::updateAllLifecyclePhases() { | 423 void WebPagePopupImpl::updateAllLifecyclePhases() { |
| 435 if (!m_page) | 424 if (!m_page) |
| 436 return; | 425 return; |
| 437 PageWidgetDelegate::updateAllLifecyclePhases( | 426 PageWidgetDelegate::updateAllLifecyclePhases( |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 // A WebPagePopupImpl instance usually has two references. | 598 // A WebPagePopupImpl instance usually has two references. |
| 610 // - One owned by the instance itself. It represents the visible widget. | 599 // - One owned by the instance itself. It represents the visible widget. |
| 611 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 600 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
| 612 // WebPagePopupImpl to close. | 601 // WebPagePopupImpl to close. |
| 613 // We need them because the closing operation is asynchronous and the widget | 602 // We need them because the closing operation is asynchronous and the widget |
| 614 // can be closed while the WebViewImpl is unaware of it. | 603 // can be closed while the WebViewImpl is unaware of it. |
| 615 return adoptRef(new WebPagePopupImpl(client)).leakRef(); | 604 return adoptRef(new WebPagePopupImpl(client)).leakRef(); |
| 616 } | 605 } |
| 617 | 606 |
| 618 } // namespace blink | 607 } // namespace blink |
| OLD | NEW |