mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
36 lines
799 B
C++
36 lines
799 B
C++
// Copyright 2013 The Flutter 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_SHELL_COMMON_LAYER_TREE_HOLDER_H_
|
|
#define FLUTTER_SHELL_COMMON_LAYER_TREE_HOLDER_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "flow/layers/layer_tree.h"
|
|
|
|
namespace flutter {
|
|
|
|
class LayerTreeHolder {
|
|
public:
|
|
LayerTreeHolder() = default;
|
|
|
|
~LayerTreeHolder() = default;
|
|
|
|
bool IsEmpty() const;
|
|
|
|
std::unique_ptr<LayerTree> Get();
|
|
|
|
void ReplaceIfNewer(std::unique_ptr<LayerTree> proposed_layer_tree);
|
|
|
|
private:
|
|
mutable std::mutex layer_tree_mutex;
|
|
std::unique_ptr<LayerTree> layer_tree_;
|
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(LayerTreeHolder);
|
|
};
|
|
|
|
}; // namespace flutter
|
|
|
|
#endif // FLUTTER_SHELL_COMMON_LAYER_TREE_HOLDER_H_
|