// 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. #ifndef FLUTTER_LIB_UI_COMPOSITING_SCENE_H_ #define FLUTTER_LIB_UI_COMPOSITING_SCENE_H_ #include #include #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/dart_wrapper.h" #include "third_party/skia/include/core/SkPicture.h" namespace tonic { class DartLibraryNatives; } // namespace tonic namespace blink { class Scene : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FML_FRIEND_MAKE_REF_COUNTED(Scene); public: ~Scene() override; static fml::RefPtr create(std::shared_ptr rootLayer, uint32_t rasterizerTracingThreshold, bool checkerboardRasterCacheImages, bool checkerboardOffscreenLayers); std::unique_ptr takeLayerTree(); Dart_Handle toImage(uint32_t width, uint32_t height, Dart_Handle image_callback); void dispose(); static void RegisterNatives(tonic::DartLibraryNatives* natives); private: explicit Scene(std::shared_ptr rootLayer, uint32_t rasterizerTracingThreshold, bool checkerboardRasterCacheImages, bool checkerboardOffscreenLayers); std::unique_ptr m_layerTree; }; } // namespace blink #endif // FLUTTER_LIB_UI_COMPOSITING_SCENE_H_