Flutter Engine
The Flutter Engine
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
12#include "flutter/fml/unique_fd.h"
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 SkISize& 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 size);
40}
41
42// |flutter::Surface|
43GrDirectContext* Surface::GetContext() {
44 return gr_context_;
45}
46
47// |flutter::Surface|
48SkMatrix Surface::GetRootTransformation() const {
49 // This backend does not support delegating to the underlying platform to
50 // query for root surface transformations. Just return identity.
52 matrix.reset();
53 return matrix;
54}
55
56} // namespace flutter_runner
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
it will be possible to load the file into Perfetto s trace viewer 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: switches.h:259
Definition: ref_ptr.h:256
Definition: SkSize.h:16