2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2017-01-20 14:37:10 -08:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_
|
|
|
|
|
#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
2017-02-22 15:40:23 -08:00
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
#include "flutter/fml/macros.h"
|
2017-05-31 17:27:47 -07:00
|
|
|
#include "flutter/fml/platform/android/jni_util.h"
|
|
|
|
|
#include "flutter/fml/platform/android/jni_weak_ref.h"
|
2017-01-20 14:37:10 -08:00
|
|
|
#include "flutter/shell/common/platform_view.h"
|
|
|
|
|
#include "flutter/shell/common/surface.h"
|
|
|
|
|
#include "flutter/shell/platform/android/android_native_window.h"
|
|
|
|
|
#include "third_party/skia/include/core/SkSize.h"
|
|
|
|
|
|
|
|
|
|
namespace shell {
|
|
|
|
|
|
|
|
|
|
class AndroidSurface {
|
|
|
|
|
public:
|
2018-04-13 13:48:15 -07:00
|
|
|
static std::unique_ptr<AndroidSurface> Create(bool use_software_rendering);
|
|
|
|
|
|
2017-01-20 14:37:10 -08:00
|
|
|
virtual ~AndroidSurface();
|
|
|
|
|
|
|
|
|
|
virtual bool IsValid() const = 0;
|
|
|
|
|
|
|
|
|
|
virtual void TeardownOnScreenContext() = 0;
|
|
|
|
|
|
|
|
|
|
virtual std::unique_ptr<Surface> CreateGPUSurface() = 0;
|
|
|
|
|
|
|
|
|
|
virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0;
|
|
|
|
|
|
|
|
|
|
virtual bool ResourceContextMakeCurrent() = 0;
|
|
|
|
|
|
2018-08-14 13:15:42 -07:00
|
|
|
virtual bool ResourceContextClearCurrent() = 0;
|
|
|
|
|
|
2018-07-26 12:49:34 -07:00
|
|
|
virtual bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) = 0;
|
2017-01-20 14:37:10 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace shell
|
|
|
|
|
|
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_
|