#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_H_
#include <jni.h>
#include <memory>
#include "flutter/fml/macros.h"
#include "flutter/shell/gpu/gpu_surface_gl.h"
#include "flutter/shell/platform/android/android_context_gl.h"
#include "flutter/shell/platform/android/android_environment_gl.h"
#include "flutter/shell/platform/android/android_surface.h"
namespace flutter {
class AndroidSurfaceGL final : public GPUSurfaceGLDelegate,
public AndroidSurface {
public:
AndroidSurfaceGL();
~AndroidSurfaceGL() override;
bool IsOffscreenContextValid() const;
bool IsValid() const override;
std::unique_ptr<Surface> CreateGPUSurface() override;
void TeardownOnScreenContext() override;
bool OnScreenSurfaceResize(const SkISize& size) const override;
bool ResourceContextMakeCurrent() override;
bool ResourceContextClearCurrent() override;
bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) override;
bool GLContextMakeCurrent() override;
bool GLContextClearCurrent() override;
bool GLContextPresent() override;
intptr_t GLContextFBO() const override;
ExternalViewEmbedder* GetExternalViewEmbedder() override;
private:
fml::RefPtr<AndroidContextGL> onscreen_context_;
fml::RefPtr<AndroidContextGL> offscreen_context_;
FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGL);
};
}
#endif