Flutter Engine
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_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 
33 
34  virtual std::unique_ptr<GLContextResult> MakeRenderContextCurrent();
35 
36  virtual bool ClearRenderContext();
37 
38  private:
39  FML_DISALLOW_COPY_AND_ASSIGN(Surface);
40 };
41 
42 } // namespace flutter
43 
44 #endif // FLUTTER_FLOW_SURFACE_H_
virtual ~Surface()
virtual bool ClearRenderContext()
Definition: surface.cc:21
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
virtual flutter::ExternalViewEmbedder * GetExternalViewEmbedder()
Definition: surface.cc:13
virtual SkMatrix GetRootTransformation() const =0
Abstract Base Class that represents where we will be rendering content.
Definition: surface.h:18
virtual bool IsValid()=0
virtual std::unique_ptr< GLContextResult > MakeRenderContextCurrent()
Definition: surface.cc:17
virtual std::unique_ptr< SurfaceFrame > AcquireFrame(const SkISize &size)=0
virtual GrDirectContext * GetContext()=0