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_FLOW_SURFACE_H_ |
6 | #define FLUTTER_FLOW_SURFACE_H_ |
7 | |
8 | #include <memory> |
9 | |
10 | #include "flutter/flow/embedded_views.h" |
11 | #include "flutter/flow/gl_context_switch.h" |
12 | #include "flutter/flow/surface_frame.h" |
13 | #include "flutter/fml/macros.h" |
14 | |
15 | namespace flutter { |
16 | |
17 | /// Abstract Base Class that represents where we will be rendering content. |
18 | class Surface { |
19 | public: |
20 | Surface(); |
21 | |
22 | virtual ~Surface(); |
23 | |
24 | virtual bool IsValid() = 0; |
25 | |
26 | virtual std::unique_ptr<SurfaceFrame> AcquireFrame(const SkISize& size) = 0; |
27 | |
28 | virtual SkMatrix GetRootTransformation() const = 0; |
29 | |
30 | virtual GrDirectContext* GetContext() = 0; |
31 | |
32 | virtual flutter::ExternalViewEmbedder* GetExternalViewEmbedder(); |
33 | |
34 | virtual std::unique_ptr<GLContextResult> MakeRenderContextCurrent(); |
35 | |
36 | private: |
37 | FML_DISALLOW_COPY_AND_ASSIGN(Surface); |
38 | }; |
39 | |
40 | } // namespace flutter |
41 | |
42 | #endif // FLUTTER_FLOW_SURFACE_H_ |
43 |