Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
embedder_render_target_cache.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_RENDER_TARGET_CACHE_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_RENDER_TARGET_CACHE_H_
7
8#include <set>
9#include <stack>
10#include <tuple>
11#include <unordered_map>
12
13#include "flutter/fml/macros.h"
14#include "flutter/shell/platform/embedder/embedder_external_view.h"
15
16namespace flutter {
17
18//------------------------------------------------------------------------------
19/// @brief A cache used to reference render targets that are owned by the
20/// embedder but needed by th engine to render a frame.
21///
22/// A map of class is managed by EmbedderExternalViewEmbedder. Each
23/// instance of this class manages the cached render targets for a
24/// view.
25///
27 public:
29
31
32 std::unique_ptr<EmbedderRenderTarget> GetRenderTarget(
34
35 std::set<std::unique_ptr<EmbedderRenderTarget>>
37
38 void CacheRenderTarget(std::unique_ptr<EmbedderRenderTarget> target);
39
40 size_t GetCachedTargetsCount() const;
41
42 private:
43 using CachedRenderTargets = std::unordered_multimap<
45 std::unique_ptr<EmbedderRenderTarget>,
48
49 CachedRenderTargets cached_render_targets_;
50
52};
53
54} // namespace flutter
55
56#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_RENDER_TARGET_CACHE_H_
A cache used to reference render targets that are owned by the embedder but needed by th engine to re...
std::set< std::unique_ptr< EmbedderRenderTarget > > ClearAllRenderTargetsInCache()
std::unique_ptr< EmbedderRenderTarget > GetRenderTarget(const EmbedderExternalView::RenderTargetDescriptor &descriptor)
void CacheRenderTarget(std::unique_ptr< EmbedderRenderTarget > target)
uint32_t * target
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27