| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/html/canvas/CanvasRenderingContext.h" | 34 #include "core/html/canvas/CanvasRenderingContext.h" |
| 35 #include "core/inspector/InspectorNodeIds.h" | 35 #include "core/inspector/InspectorNodeIds.h" |
| 36 #include "core/inspector/InspectorTraceEvents.h" | 36 #include "core/inspector/InspectorTraceEvents.h" |
| 37 #include "core/page/Chrome.h" | 37 #include "core/page/Chrome.h" |
| 38 #include "core/page/ChromeClient.h" | 38 #include "core/page/ChromeClient.h" |
| 39 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
| 40 #include "core/page/scrolling/ScrollingCoordinator.h" | 40 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 41 #include "core/rendering/FilterEffectRenderer.h" | 41 #include "core/rendering/FilterEffectRenderer.h" |
| 42 #include "core/rendering/RenderImage.h" | 42 #include "core/rendering/RenderImage.h" |
| 43 #include "core/rendering/RenderLayerStackingNodeIterator.h" | 43 #include "core/rendering/RenderLayerStackingNodeIterator.h" |
| 44 #include "core/rendering/RenderPart.h" | |
| 45 #include "core/rendering/RenderVideo.h" | 44 #include "core/rendering/RenderVideo.h" |
| 46 #include "core/rendering/RenderView.h" | 45 #include "core/rendering/RenderView.h" |
| 47 #include "core/rendering/compositing/RenderLayerCompositor.h" | 46 #include "core/rendering/compositing/RenderLayerCompositor.h" |
| 48 #include "core/rendering/style/KeyframeList.h" | 47 #include "core/rendering/style/KeyframeList.h" |
| 49 #include "platform/LengthFunctions.h" | 48 #include "platform/LengthFunctions.h" |
| 50 #include "platform/RuntimeEnabledFeatures.h" | 49 #include "platform/RuntimeEnabledFeatures.h" |
| 51 #include "platform/fonts/FontCache.h" | 50 #include "platform/fonts/FontCache.h" |
| 52 #include "platform/geometry/TransformState.h" | 51 #include "platform/geometry/TransformState.h" |
| 53 #include "platform/graphics/GraphicsContext.h" | 52 #include "platform/graphics/GraphicsContext.h" |
| 54 #include "wtf/CurrentTime.h" | 53 #include "wtf/CurrentTime.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 275 } |
| 277 | 276 |
| 278 void CompositedLayerMapping::updateCompositedBounds() | 277 void CompositedLayerMapping::updateCompositedBounds() |
| 279 { | 278 { |
| 280 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); | 279 ASSERT(m_owningLayer.compositor()->lifecycle().state() == DocumentLifecycle:
:InCompositingUpdate); |
| 281 // FIXME: if this is really needed for performance, it would be better to st
ore it on RenderLayer. | 280 // FIXME: if this is really needed for performance, it would be better to st
ore it on RenderLayer. |
| 282 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); | 281 m_compositedBounds = m_owningLayer.boundingBoxForCompositing(); |
| 283 m_contentOffsetInCompositingLayerDirty = true; | 282 m_contentOffsetInCompositingLayerDirty = true; |
| 284 } | 283 } |
| 285 | 284 |
| 286 void CompositedLayerMapping::updateAfterWidgetResize() | |
| 287 { | |
| 288 if (renderer()->isRenderPart()) { | |
| 289 if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::fram
eContentsCompositor(toRenderPart(renderer()))) { | |
| 290 innerCompositor->frameViewDidChangeSize(); | |
| 291 // We can floor this point because our frameviews are always aligned
to pixel boundaries. | |
| 292 ASSERT(m_compositedBounds.location() == flooredIntPoint(m_composited
Bounds.location())); | |
| 293 innerCompositor->frameViewDidChangeLocation(flooredIntPoint(contents
Box().location())); | |
| 294 } | |
| 295 } | |
| 296 } | |
| 297 | |
| 298 void CompositedLayerMapping::updateCompositingReasons() | 285 void CompositedLayerMapping::updateCompositingReasons() |
| 299 { | 286 { |
| 300 // All other layers owned by this mapping will have the same compositing rea
son | 287 // All other layers owned by this mapping will have the same compositing rea
son |
| 301 // for their lifetime, so they are initialized only when created. | 288 // for their lifetime, so they are initialized only when created. |
| 302 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons()); | 289 m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons()); |
| 303 } | 290 } |
| 304 | 291 |
| 305 bool CompositedLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor
() | 292 bool CompositedLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor
() |
| 306 { | 293 { |
| 307 if (!m_owningLayer.parent()) | 294 if (!m_owningLayer.parent()) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 435 |
| 449 if (renderer->isVideo()) { | 436 if (renderer->isVideo()) { |
| 450 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); | 437 HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer->node()); |
| 451 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(
)); | 438 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(
)); |
| 452 } else if (isAcceleratedCanvas(renderer)) { | 439 } else if (isAcceleratedCanvas(renderer)) { |
| 453 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node()); | 440 HTMLCanvasElement* canvas = toHTMLCanvasElement(renderer->node()); |
| 454 if (CanvasRenderingContext* context = canvas->renderingContext()) | 441 if (CanvasRenderingContext* context = canvas->renderingContext()) |
| 455 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer()
); | 442 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer()
); |
| 456 layerConfigChanged = true; | 443 layerConfigChanged = true; |
| 457 } | 444 } |
| 458 if (renderer->isRenderPart()) | |
| 459 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR
enderPart(renderer)); | |
| 460 | 445 |
| 461 // Changes to either the internal hierarchy or the mask layer have an impact | 446 // Changes to either the internal hierarchy or the mask layer have an impact |
| 462 // on painting phases, so we need to update when either are updated. | 447 // on painting phases, so we need to update when either are updated. |
| 463 if (layerConfigChanged || maskLayerChanged) | 448 if (layerConfigChanged || maskLayerChanged) |
| 464 updatePaintingPhases(); | 449 updatePaintingPhases(); |
| 465 | 450 |
| 466 return layerConfigChanged; | 451 return layerConfigChanged; |
| 467 } | 452 } |
| 468 | 453 |
| 469 static IntRect clipBox(RenderBox* renderer) | 454 static IntRect clipBox(RenderBox* renderer) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 625 |
| 641 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { | 626 if (RuntimeEnabledFeatures::cssCompositingEnabled()) { |
| 642 updateLayerBlendMode(renderer()->style()); | 627 updateLayerBlendMode(renderer()->style()); |
| 643 updateIsRootForIsolatedGroup(); | 628 updateIsRootForIsolatedGroup(); |
| 644 } | 629 } |
| 645 | 630 |
| 646 updateContentsRect(); | 631 updateContentsRect(); |
| 647 updateBackgroundColor(); | 632 updateBackgroundColor(); |
| 648 updateDrawsContent(); | 633 updateDrawsContent(); |
| 649 updateContentsOpaque(); | 634 updateContentsOpaque(); |
| 650 updateAfterWidgetResize(); | |
| 651 updateRenderingContext(); | 635 updateRenderingContext(); |
| 652 updateShouldFlattenTransform(); | 636 updateShouldFlattenTransform(); |
| 653 updateChildrenTransform(); | 637 updateChildrenTransform(); |
| 654 updateScrollParent(compositor()->preferCompositingToLCDTextEnabled() ? m_own
ingLayer.scrollParent() : 0); | 638 updateScrollParent(compositor()->preferCompositingToLCDTextEnabled() ? m_own
ingLayer.scrollParent() : 0); |
| 655 | 639 |
| 656 updateCompositingReasons(); | 640 updateCompositingReasons(); |
| 657 } | 641 } |
| 658 | 642 |
| 659 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) | 643 void CompositedLayerMapping::updateMainGraphicsLayerGeometry(const IntRect& rela
tiveCompositingBounds, const IntRect& localCompositingBounds, const IntPoint& gr
aphicsLayerParentLocation) |
| 660 { | 644 { |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2210 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2227 name = "Scrolling Block Selection Layer"; | 2211 name = "Scrolling Block Selection Layer"; |
| 2228 } else { | 2212 } else { |
| 2229 ASSERT_NOT_REACHED(); | 2213 ASSERT_NOT_REACHED(); |
| 2230 } | 2214 } |
| 2231 | 2215 |
| 2232 return name; | 2216 return name; |
| 2233 } | 2217 } |
| 2234 | 2218 |
| 2235 } // namespace blink | 2219 } // namespace blink |
| OLD | NEW |