Adlai Holler c57aff1800
Use the GrDirectContext factories instead of deprecated GrContext ones (#19962)
This is part of a larger effort to expose the difference between GrDirectContext,
which runs on the GPU thread and can directly perform operations like uploading
textures, and GrRecordingContext, which can only queue up work to be delivered
to the GrDirectContext later.
2020-07-28 13:32:09 -07:00

44 lines
1.4 KiB
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// 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 "flutter/flow/surface.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/android/context/android_context.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
#include "flutter/shell/platform/android/surface/android_native_window.h"
#include "third_party/skia/include/core/SkSize.h"
namespace flutter {
class AndroidSurface {
public:
using Factory = std::function<std::unique_ptr<AndroidSurface>(
std::shared_ptr<AndroidContext> android_context,
std::shared_ptr<PlatformViewAndroidJNI> jni_facade)>;
virtual ~AndroidSurface();
virtual bool IsValid() const = 0;
virtual void TeardownOnScreenContext() = 0;
virtual std::unique_ptr<Surface> CreateGPUSurface(
GrDirectContext* gr_context = nullptr) = 0;
virtual bool OnScreenSurfaceResize(const SkISize& size) = 0;
virtual bool ResourceContextMakeCurrent() = 0;
virtual bool ResourceContextClearCurrent() = 0;
virtual bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) = 0;
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_H_