Flutter Engine
android_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_ANDROID_ANDROID_SURFACE_H_
6 #define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_
7 
8 #include "flutter/flow/embedded_views.h"
9 #include "flutter/flow/surface.h"
10 #include "flutter/fml/macros.h"
11 #include "flutter/shell/platform/android/context/android_context.h"
12 #include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
13 #include "flutter/shell/platform/android/surface/android_native_window.h"
14 #include "third_party/skia/include/core/SkSize.h"
15 
16 namespace flutter {
17 
18 class AndroidExternalViewEmbedder;
19 
21  public:
22  virtual ~AndroidSurface();
23 
24  virtual bool IsValid() const = 0;
25 
26  virtual void TeardownOnScreenContext() = 0;
27 
28  virtual std::unique_ptr<Surface> CreateGPUSurface(
29  GrDirectContext* gr_context = nullptr) = 0;
30 
31  virtual bool OnScreenSurfaceResize(const SkISize& size) = 0;
32 
33  virtual bool ResourceContextMakeCurrent() = 0;
34 
35  virtual bool ResourceContextClearCurrent() = 0;
36 
37  virtual bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) = 0;
38 };
39 
41  public:
42  AndroidSurfaceFactory() = default;
43 
44  virtual ~AndroidSurfaceFactory() = default;
45 
46  virtual std::unique_ptr<AndroidSurface> CreateSurface() = 0;
47 };
48 
49 } // namespace flutter
50 
51 #endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_
virtual void TeardownOnScreenContext()=0
virtual bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window)=0
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
virtual bool OnScreenSurfaceResize(const SkISize &size)=0
virtual bool ResourceContextClearCurrent()=0
virtual bool IsValid() const =0
virtual bool ResourceContextMakeCurrent()=0
virtual std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr)=0