Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
fuchsia
flutter
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
14
namespace
flutter_runner
{
15
16
Surface::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
23
Surface::~Surface
() =
default
;
24
25
// |flutter::Surface|
26
bool
Surface::IsValid
() {
27
return
true
;
28
}
29
30
// |flutter::Surface|
31
std::unique_ptr<flutter::SurfaceFrame>
Surface::AcquireFrame
(
32
const
SkISize
& size) {
33
flutter::SurfaceFrame::FramebufferInfo
framebuffer_info;
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|
43
GrDirectContext
*
Surface::GetContext
() {
44
return
gr_context_;
45
}
46
47
// |flutter::Surface|
48
SkMatrix
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
SkMatrix
matrix;
52
matrix.reset();
53
return
matrix;
54
}
55
56
}
// namespace flutter_runner
GrDirectContext
Definition
GrDirectContext.h:60
SkMatrix
Definition
SkMatrix.h:54
flutter::DlCanvas
Developer-facing API for rendering anything within the engine.
Definition
dl_canvas.h:37
flutter::SurfaceFrame
Definition
surface_frame.h:24
flutter::Surface::Surface
Surface()
flutter_runner::Surface::IsValid
bool IsValid() override
Definition
surface.cc:26
flutter_runner::Surface::~Surface
~Surface() override
flutter_runner::Surface::AcquireFrame
std::unique_ptr< flutter::SurfaceFrame > AcquireFrame(const SkISize &size) override
Definition
surface.cc:31
flutter_runner::Surface::GetRootTransformation
SkMatrix GetRootTransformation() const override
Definition
surface.cc:48
flutter_runner::Surface::GetContext
GrDirectContext * GetContext() override
Definition
surface.cc:43
flutter_runner
Definition
accessibility_bridge.cc:20
std
Definition
ref_ptr.h:256
surface.h
SkISize
Definition
SkSize.h:16
flutter::SurfaceFrame::FramebufferInfo
Definition
surface_frame.h:30
flutter::SurfaceFrame::FramebufferInfo::supports_readback
bool supports_readback
Definition
surface_frame.h:33
Generated on Fri Apr 26 2024 06:14:04 for Flutter Engine by
1.9.8