Flutter Engine
 
Loading...
Searching...
No Matches
surface.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 "surface.h"
6
7#include <fcntl.h>
8#include <lib/fdio/watcher.h>
9#include <lib/zx/time.h>
10#include <unistd.h>
11
13
14namespace flutter_runner {
15
16Surface::Surface(std::string debug_label,
17 std::shared_ptr<flutter::ExternalViewEmbedder> view_embedder,
18 GrDirectContext* gr_context)
19 : debug_label_(std::move(debug_label)),
20 view_embedder_(view_embedder),
21 gr_context_(gr_context) {}
22
23Surface::~Surface() = default;
24
25// |flutter::Surface|
26bool Surface::IsValid() {
27 return true;
28}
29
30// |flutter::Surface|
31std::unique_ptr<flutter::SurfaceFrame> Surface::AcquireFrame(
32 const flutter::DlISize& size) {
34 framebuffer_info.supports_readback = true;
35 return std::make_unique<flutter::SurfaceFrame>(
36 nullptr, std::move(framebuffer_info),
37 [](const flutter::SurfaceFrame& surface_frame,
38 flutter::DlCanvas* canvas) { return true; },
39 [](const flutter::SurfaceFrame& surface_frame) { return true; }, size);
40}
41
42// |flutter::Surface|
43GrDirectContext* Surface::GetContext() {
44 return gr_context_;
45}
46
47// |flutter::Surface|
48flutter::DlMatrix Surface::GetRootTransformation() const {
49 // This backend does not support delegating to the underlying platform to
50 // query for root surface transformations. Just return identity.
51 return flutter::DlMatrix();
52}
53
54} // namespace flutter_runner
Developer-facing API for rendering anything within the engine.
Definition dl_canvas.h:32
impeller::Matrix DlMatrix
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition ref_ptr.h:261
A 4x4 matrix using column-major storage.
Definition matrix.h:37