#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_SOFTWARE_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_SOFTWARE_H_
#include "flutter/fml/macros.h"
#include "flutter/fml/platform/android/jni_weak_ref.h"
#include "flutter/fml/platform/android/scoped_java_ref.h"
#include "flutter/shell/gpu/gpu_surface_software.h"
#include "flutter/shell/platform/android/android_surface.h"
namespace flutter {
class AndroidSurfaceSoftware final : public AndroidSurface,
public GPUSurfaceSoftwareDelegate {
public:
AndroidSurfaceSoftware();
~AndroidSurfaceSoftware() override;
bool IsValid() const override;
bool ResourceContextMakeCurrent() override;
bool ResourceContextClearCurrent() override;
std::unique_ptr<Surface> CreateGPUSurface() override;
void TeardownOnScreenContext() override;
bool OnScreenSurfaceResize(const SkISize& size) const override;
bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) override;
sk_sp<SkSurface> AcquireBackingStore(const SkISize& size) override;
bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
ExternalViewEmbedder* GetExternalViewEmbedder() override;
private:
sk_sp<SkSurface> sk_surface_;
fml::RefPtr<AndroidNativeWindow> native_window_;
SkColorType target_color_type_;
SkAlphaType target_alpha_type_;
FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceSoftware);
};
}
#endif