Flutter Engine
embedder_render_target.cc
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 #include "flutter/shell/platform/embedder/embedder_render_target.h"
6 
7 #include "flutter/fml/logging.h"
8 
9 namespace flutter {
10 
12  sk_sp<SkSurface> render_surface,
13  fml::closure on_release)
14  : backing_store_(backing_store),
15  render_surface_(std::move(render_surface)),
16  on_release_(on_release) {
17  // TODO(38468): The optimization to elide backing store updates between frames
18  // has not been implemented yet.
19  backing_store_.did_update = true;
20  FML_DCHECK(render_surface_);
21 }
22 
24  if (on_release_) {
25  on_release_();
26  }
27 }
28 
30  return &backing_store_;
31 }
32 
33 sk_sp<SkSurface> EmbedderRenderTarget::GetRenderSurface() const {
34  return render_surface_;
35 }
36 
37 } // namespace flutter
const FlutterBackingStore * GetBackingStore() const
The embedder backing store descriptor. This is the descriptor that was given to the engine by the emb...
#define FML_DCHECK(condition)
Definition: logging.h:86
Definition: ref_ptr.h:252
~EmbedderRenderTarget()
Destroys this instance of the render target and invokes the callback for the embedder to release its ...
std::function< void()> closure
Definition: closure.h:14
sk_sp< SkSurface > GetRenderSurface() const
A render surface the rasterizer can use to draw into the backing store of this render target...
EmbedderRenderTarget(FlutterBackingStore backing_store, sk_sp< SkSurface > render_surface, fml::closure on_release)
Creates a render target whose backing store is managed by the embedder. The way this render target is...