Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
surface.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_FUCHSIA_FLUTTER_SURFACE_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_SURFACE_H_
7
8#include "flutter/flow/surface.h"
9#include "flutter/fml/macros.h"
10#include "flutter/fml/memory/weak_ptr.h"
11
12namespace flutter_runner {
13
14// The interface between the Flutter rasterizer and the underlying platform. May
15// be constructed on any thread but will be used by the engine only on the
16// raster thread.
17class Surface final : public flutter::Surface {
18 public:
19 Surface(std::string debug_label,
20 std::shared_ptr<flutter::ExternalViewEmbedder> view_embedder,
21 GrDirectContext* gr_context);
22
23 ~Surface() override;
24
25 private:
26 const std::string debug_label_;
27 std::shared_ptr<flutter::ExternalViewEmbedder> view_embedder_;
28 GrDirectContext* gr_context_;
29
30 // |flutter::Surface|
31 bool IsValid() override;
32
33 // |flutter::Surface|
34 std::unique_ptr<flutter::SurfaceFrame> AcquireFrame(
35 const SkISize& size) override;
36
37 // |flutter::Surface|
38 GrDirectContext* GetContext() override;
39
40 // |flutter::Surface|
41 SkMatrix GetRootTransformation() const override;
42
44};
45
46} // namespace flutter_runner
47
48#endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_SURFACE_H_
Abstract Base Class that represents where we will be rendering content.
Definition surface.h:24
bool IsValid() override
Definition surface.cc:26
std::unique_ptr< flutter::SurfaceFrame > AcquireFrame(const SkISize &size) override
Definition surface.cc:31
SkMatrix GetRootTransformation() const override
Definition surface.cc:48
GrDirectContext * GetContext() override
Definition surface.cc:43
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27