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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "core/paint/TransformRecorder.h" | 56 #include "core/paint/TransformRecorder.h" |
57 #include "platform/RuntimeEnabledFeatures.h" | 57 #include "platform/RuntimeEnabledFeatures.h" |
58 #include "platform/ScriptForbiddenScope.h" | 58 #include "platform/ScriptForbiddenScope.h" |
59 #include "platform/TraceEvent.h" | 59 #include "platform/TraceEvent.h" |
60 #include "platform/graphics/GraphicsLayer.h" | 60 #include "platform/graphics/GraphicsLayer.h" |
61 #include "platform/graphics/paint/CullRect.h" | 61 #include "platform/graphics/paint/CullRect.h" |
62 #include "platform/graphics/paint/DrawingRecorder.h" | 62 #include "platform/graphics/paint/DrawingRecorder.h" |
63 #include "platform/graphics/paint/PaintController.h" | 63 #include "platform/graphics/paint/PaintController.h" |
64 #include "platform/graphics/paint/TransformDisplayItem.h" | 64 #include "platform/graphics/paint/TransformDisplayItem.h" |
65 #include "public/platform/Platform.h" | 65 #include "public/platform/Platform.h" |
| 66 #include "public/platform/WebCompositorMutableProperties.h" |
66 | 67 |
67 namespace blink { | 68 namespace blink { |
68 | 69 |
69 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView) | 70 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView) |
70 : m_layoutView(layoutView) | 71 : m_layoutView(layoutView) |
71 , m_compositingReasonFinder(layoutView) | 72 , m_compositingReasonFinder(layoutView) |
72 , m_pendingUpdateType(CompositingUpdateNone) | 73 , m_pendingUpdateType(CompositingUpdateNone) |
73 , m_hasAcceleratedCompositing(true) | 74 , m_hasAcceleratedCompositing(true) |
74 , m_compositing(false) | 75 , m_compositing(false) |
75 , m_rootShouldAlwaysCompositeDirty(true) | 76 , m_rootShouldAlwaysCompositeDirty(true) |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 for (ScrollableArea* scrollableArea : *scrollableAreas) | 385 for (ScrollableArea* scrollableArea : *scrollableAreas) |
385 layersChanged |= scrollableArea->updateAfterCompositingChang
e(); | 386 layersChanged |= scrollableArea->updateAfterCompositingChang
e(); |
386 } | 387 } |
387 } | 388 } |
388 | 389 |
389 if (layersChanged) | 390 if (layersChanged) |
390 updateType = std::max(updateType, CompositingUpdateRebuildTree); | 391 updateType = std::max(updateType, CompositingUpdateRebuildTree); |
391 } | 392 } |
392 | 393 |
393 if (updateType != CompositingUpdateNone) { | 394 if (updateType != CompositingUpdateNone) { |
| 395 if (RuntimeEnabledFeatures::compositorWorkerEnabled() && m_scrollLayer)
{ |
| 396 if (Element* scrollingElement = m_layoutView.document().scrollingEle
ment()) { |
| 397 uint64_t elementId = 0; |
| 398 uint32_t mutableProperties = WebCompositorMutablePropertyNone; |
| 399 if (scrollingElement->hasCompositorProxy()) { |
| 400 elementId = DOMNodeIds::idForNode(scrollingElement); |
| 401 mutableProperties = (WebCompositorMutablePropertyScrollLeft
| WebCompositorMutablePropertyScrollTop) & scrollingElement->compositorMutablePr
operties(); |
| 402 } |
| 403 m_scrollLayer->setElementId(elementId); |
| 404 m_scrollLayer->setCompositorMutableProperties(mutableProperties)
; |
| 405 } |
| 406 } |
| 407 |
394 GraphicsLayerUpdater updater; | 408 GraphicsLayerUpdater updater; |
395 updater.update(*updateRoot, layersNeedingPaintInvalidation); | 409 updater.update(*updateRoot, layersNeedingPaintInvalidation); |
396 | 410 |
397 if (updater.needsRebuildTree()) | 411 if (updater.needsRebuildTree()) |
398 updateType = std::max(updateType, CompositingUpdateRebuildTree); | 412 updateType = std::max(updateType, CompositingUpdateRebuildTree); |
399 | 413 |
400 #if ENABLE(ASSERT) | 414 #if ENABLE(ASSERT) |
401 // FIXME: Move this check to the end of the compositing update. | 415 // FIXME: Move this check to the end of the compositing update. |
402 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat
eRoot); | 416 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat
eRoot); |
403 #endif | 417 #endif |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 } else if (graphicsLayer == m_scrollLayer.get()) { | 1206 } else if (graphicsLayer == m_scrollLayer.get()) { |
1193 name = "Frame Scrolling Layer"; | 1207 name = "Frame Scrolling Layer"; |
1194 } else { | 1208 } else { |
1195 ASSERT_NOT_REACHED(); | 1209 ASSERT_NOT_REACHED(); |
1196 } | 1210 } |
1197 | 1211 |
1198 return name; | 1212 return name; |
1199 } | 1213 } |
1200 | 1214 |
1201 } // namespace blink | 1215 } // namespace blink |
OLD | NEW |