OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 , m_compositedLayerCount(0) | 222 , m_compositedLayerCount(0) |
223 , m_showRepaintCounter(false) | 223 , m_showRepaintCounter(false) |
224 , m_reevaluateCompositingAfterLayout(false) | 224 , m_reevaluateCompositingAfterLayout(false) |
225 , m_compositing(false) | 225 , m_compositing(false) |
226 , m_compositingLayersNeedRebuild(false) | 226 , m_compositingLayersNeedRebuild(false) |
227 , m_forceCompositingMode(false) | 227 , m_forceCompositingMode(false) |
228 , m_inPostLayoutUpdate(false) | 228 , m_inPostLayoutUpdate(false) |
229 , m_needsUpdateCompositingRequirementsState(false) | 229 , m_needsUpdateCompositingRequirementsState(false) |
230 , m_isTrackingRepaints(false) | 230 , m_isTrackingRepaints(false) |
231 , m_rootLayerAttachment(RootLayerUnattached) | 231 , m_rootLayerAttachment(RootLayerUnattached) |
232 , m_currentFullscreenRenderer(0) | |
232 #if !LOG_DISABLED | 233 #if !LOG_DISABLED |
233 , m_rootLayerUpdateCount(0) | 234 , m_rootLayerUpdateCount(0) |
234 , m_obligateCompositedLayerCount(0) | 235 , m_obligateCompositedLayerCount(0) |
235 , m_secondaryCompositedLayerCount(0) | 236 , m_secondaryCompositedLayerCount(0) |
236 , m_obligatoryBackingStoreBytes(0) | 237 , m_obligatoryBackingStoreBytes(0) |
237 , m_secondaryBackingStoreBytes(0) | 238 , m_secondaryBackingStoreBytes(0) |
238 #endif | 239 #endif |
239 { | 240 { |
240 } | 241 } |
241 | 242 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
430 if (needHierarchyUpdate) { | 431 if (needHierarchyUpdate) { |
431 // Update the hierarchy of the compositing layers. | 432 // Update the hierarchy of the compositing layers. |
432 Vector<GraphicsLayer*> childList; | 433 Vector<GraphicsLayer*> childList; |
433 { | 434 { |
434 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::rebuildCompo sitingLayerTree"); | 435 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::rebuildCompo sitingLayerTree"); |
435 rebuildCompositingLayerTree(updateRoot, childList, 0); | 436 rebuildCompositingLayerTree(updateRoot, childList, 0); |
436 } | 437 } |
437 | 438 |
438 // Host the document layer in the RenderView's root layer. | 439 // Host the document layer in the RenderView's root layer. |
439 if (isFullUpdate) { | 440 if (isFullUpdate) { |
441 #if USE(NATIVE_FULLSCREEN_VIDEO) | |
442 if (m_currentFullscreenRenderer && m_currentFullscreenRenderer->isMe dia()) { | |
443 RenderLayerModelObject* renderer = toRenderLayerModelObject(m_cu rrentFullscreenRenderer); | |
444 RenderLayerBacking* backing = renderer->layer() ? renderer->laye r()->backing() : 0; | |
445 childList.clear(); | |
446 childList.append(backing->graphicsLayer()); | |
falken
2013/08/24 05:25:40
Should you check if backing was set to 0 above?
| |
447 } | |
448 #endif | |
440 // Even when childList is empty, don't drop out of compositing mode if there are | 449 // Even when childList is empty, don't drop out of compositing mode if there are |
441 // composited layers that we didn't hit in our traversal (e.g. becau se of visibility:hidden). | 450 // composited layers that we didn't hit in our traversal (e.g. becau se of visibility:hidden). |
442 if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateR oot)) | 451 if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateR oot)) |
443 destroyRootLayer(); | 452 destroyRootLayer(); |
444 else | 453 else |
445 m_rootContentLayer->setChildren(childList); | 454 m_rootContentLayer->setChildren(childList); |
446 } | 455 } |
447 } else if (needGeometryUpdate) { | 456 } else if (needGeometryUpdate) { |
448 // We just need to do a geometry update. This is only used for position: fixed scrolling; | 457 // We just need to do a geometry update. This is only used for position: fixed scrolling; |
449 // most of the time, geometry is updated via RenderLayer::styleChanged() . | 458 // most of the time, geometry is updated via RenderLayer::styleChanged() . |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1763 return false; | 1772 return false; |
1764 | 1773 |
1765 RenderStyle* style = renderer->style(); | 1774 RenderStyle* style = renderer->style(); |
1766 // Note that we ask the renderer if it has a transform, because the style ma y have transforms, | 1775 // Note that we ask the renderer if it has a transform, because the style ma y have transforms, |
1767 // but the renderer may be an inline that doesn't suppport them. | 1776 // but the renderer may be an inline that doesn't suppport them. |
1768 return renderer->hasTransform() && style->transform().has3DOperation(); | 1777 return renderer->hasTransform() && style->transform().has3DOperation(); |
1769 } | 1778 } |
1770 | 1779 |
1771 bool RenderLayerCompositor::requiresCompositingForVideo(RenderObject* renderer) const | 1780 bool RenderLayerCompositor::requiresCompositingForVideo(RenderObject* renderer) const |
1772 { | 1781 { |
1782 #if USE(NATIVE_FULLSCREEN_VIDEO) | |
1783 if (renderer->isVideo() && renderer == m_currentFullscreenRenderer) | |
1784 return true; | |
1785 #endif | |
1786 | |
1773 if (!(m_compositingTriggers & ChromeClient::VideoTrigger)) | 1787 if (!(m_compositingTriggers & ChromeClient::VideoTrigger)) |
1774 return false; | 1788 return false; |
1775 | 1789 |
1776 if (renderer->isVideo()) { | 1790 if (renderer->isVideo()) { |
1777 RenderVideo* video = toRenderVideo(renderer); | 1791 RenderVideo* video = toRenderVideo(renderer); |
1778 return video->shouldDisplayVideo() && canAccelerateVideoRendering(video) ; | 1792 return video->shouldDisplayVideo() && canAccelerateVideoRendering(video) ; |
1779 } | 1793 } |
1780 return false; | 1794 return false; |
1781 } | 1795 } |
1782 | 1796 |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2634 } | 2648 } |
2635 | 2649 |
2636 Page* RenderLayerCompositor::page() const | 2650 Page* RenderLayerCompositor::page() const |
2637 { | 2651 { |
2638 if (Frame* frame = m_renderView->frameView()->frame()) | 2652 if (Frame* frame = m_renderView->frameView()->frame()) |
2639 return frame->page(); | 2653 return frame->page(); |
2640 | 2654 |
2641 return 0; | 2655 return 0; |
2642 } | 2656 } |
2643 | 2657 |
2658 void RenderLayerCompositor::setCurrentFullscreenRenderer(RenderObject* renderer) | |
2659 { | |
2660 if (renderer == m_currentFullscreenRenderer) | |
2661 return; | |
2662 m_currentFullscreenRenderer = renderer; | |
2663 #if USE(NATIVE_FULLSCREEN_VIDEO) | |
2664 if (!renderer || renderer->isVideo()) | |
2665 setCompositingLayersNeedRebuild(true); | |
2666 #endif | |
2667 } | |
2668 | |
2644 } // namespace WebCore | 2669 } // namespace WebCore |
OLD | NEW |