Adam Barth e5d7e69346 Pass the sky::LayerTree to the GPU thread for drawing
Instead of squashing the layers down into a single SkPicture, we now pass the
tree to the GPU thread, which draws everything separately.
2015-09-03 19:20:32 -07:00

33 lines
787 B
C++

// Copyright 2015 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 "sky/engine/core/compositing/Scene.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
namespace blink {
PassRefPtr<Scene> Scene::create(std::unique_ptr<sky::Layer> rootLayer)
{
ASSERT(rootLayer);
return adoptRef(new Scene(std::move(rootLayer)));
}
Scene::Scene(std::unique_ptr<sky::Layer> rootLayer)
: m_layerTree(new sky::LayerTree())
{
m_layerTree->set_root_layer(std::move(rootLayer));
}
Scene::~Scene()
{
}
std::unique_ptr<sky::LayerTree> Scene::takeLayerTree() {
return std::move(m_layerTree);
}
} // namespace blink