mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
762294cf2d
This reverts commit f456423cfb.
This is being reverted because it caused flutter/flutter#45098
(images don't load on iOS).
74 lines
1.9 KiB
C++
74 lines
1.9 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_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;
|
|
|
|
// |AndroidSurface|
|
|
bool IsValid() const override;
|
|
|
|
// |AndroidSurface|
|
|
std::unique_ptr<Surface> CreateGPUSurface() override;
|
|
|
|
// |AndroidSurface|
|
|
void TeardownOnScreenContext() override;
|
|
|
|
// |AndroidSurface|
|
|
bool OnScreenSurfaceResize(const SkISize& size) const override;
|
|
|
|
// |AndroidSurface|
|
|
bool ResourceContextMakeCurrent() override;
|
|
|
|
// |AndroidSurface|
|
|
bool ResourceContextClearCurrent() override;
|
|
|
|
// |AndroidSurface|
|
|
bool SetNativeWindow(fml::RefPtr<AndroidNativeWindow> window) override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool GLContextMakeCurrent() override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool GLContextClearCurrent() override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool GLContextPresent() override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
intptr_t GLContextFBO() const override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
ExternalViewEmbedder* GetExternalViewEmbedder() override;
|
|
|
|
private:
|
|
fml::RefPtr<AndroidContextGL> onscreen_context_;
|
|
fml::RefPtr<AndroidContextGL> offscreen_context_;
|
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGL);
|
|
};
|
|
|
|
} // namespace flutter
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_H_
|