| Index: Source/core/compositing/DisplayListCompositingBuilder.cpp
|
| diff --git a/Source/core/compositing/DisplayListCompositingBuilder.cpp b/Source/core/compositing/DisplayListCompositingBuilder.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..de9f037187dbf4841e4955218e6c04bc425db031
|
| --- /dev/null
|
| +++ b/Source/core/compositing/DisplayListCompositingBuilder.cpp
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "config.h"
|
| +#include "core/compositing/DisplayListCompositingBuilder.h"
|
| +
|
| +#include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h"
|
| +#include "platform/graphics/paint/DisplayList.h"
|
| +
|
| +namespace blink {
|
| +
|
| +void DisplayListCompositingBuilder::build()
|
| +{
|
| + DisplayItemTransformTreeBuilder transformTreeBuilder;
|
| + transformTreeBuilder.build(m_displayItemList, m_displayListDiff);
|
| + m_transformTree = transformTreeBuilder.releaseTransformTree();
|
| +
|
| + buildGraphicsLayerTree();
|
| +
|
| + m_rootGraphicsLayer.setTransformTree(m_transformTree.release());
|
| +}
|
| +
|
| +void DisplayListCompositingBuilder::buildGraphicsLayerTree()
|
| +{
|
| + // TODO(chrishtr): implement by walking the display list and transform tree, plus additional hints, to decide layerization,
|
| + // including overlap testing and optimizations such as squashing.
|
| +
|
| + // Also create a DisplayList for each graphics layer that is a sliced window into the DisplayItemList for the page.
|
| +
|
| + // And add pixel refs.
|
| +
|
| + // Trivial implementation with only one composited layer:
|
| + OwnPtr<DisplayList> displayList = adoptPtr(new DisplayList(m_displayItemList));
|
| + for (unsigned i = 0; i < m_displayItemList.displayItems().size(); i++) {
|
| + displayList->offsets.append(i);
|
| + }
|
| + m_rootGraphicsLayer.setDisplayList(displayList.release());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|