OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/compositing/DisplayListCompositingBuilder.h" |
| 7 |
| 8 #include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h" |
| 9 #include "platform/graphics/paint/DisplayList.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 void DisplayListCompositingBuilder::build() |
| 14 { |
| 15 DisplayItemTransformTreeBuilder transformTreeBuilder; |
| 16 transformTreeBuilder.build(m_displayItemList, m_displayListDiff); |
| 17 m_transformTree = transformTreeBuilder.releaseTransformTree(); |
| 18 |
| 19 buildGraphicsLayerTree(); |
| 20 |
| 21 m_rootGraphicsLayer.setTransformTree(m_transformTree.release()); |
| 22 } |
| 23 |
| 24 void DisplayListCompositingBuilder::buildGraphicsLayerTree() |
| 25 { |
| 26 // TODO(chrishtr): implement by walking the display list and transform tree,
plus additional hints, to decide layerization, |
| 27 // including overlap testing and optimizations such as squashing. |
| 28 |
| 29 // Also create a DisplayList for each graphics layer that is a sliced window
into the DisplayItemList for the page. |
| 30 |
| 31 // And add pixel refs. |
| 32 |
| 33 // Trivial implementation with only one composited layer: |
| 34 OwnPtr<DisplayList> displayList = adoptPtr(new DisplayList(m_displayItemList
)); |
| 35 for (unsigned i = 0; i < m_displayItemList.displayItems().size(); i++) { |
| 36 displayList->offsets.append(i); |
| 37 } |
| 38 m_rootGraphicsLayer.setDisplayList(displayList.release()); |
| 39 } |
| 40 |
| 41 } // namespace blink |
OLD | NEW |