mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This furthers the refactor of making platform view hold the reference to the external view embedder on iOS.
63 lines
1.9 KiB
Objective-C
63 lines
1.9 KiB
Objective-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_DARWIN_IOS_IOS_SURFACE_GL_H_
|
|
#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_
|
|
|
|
#include "flutter/fml/macros.h"
|
|
#include "flutter/fml/platform/darwin/scoped_nsobject.h"
|
|
#include "flutter/shell/gpu/gpu_surface_gl.h"
|
|
#import "flutter/shell/platform/darwin/ios/ios_context.h"
|
|
#import "flutter/shell/platform/darwin/ios/ios_render_target_gl.h"
|
|
#import "flutter/shell/platform/darwin/ios/ios_surface.h"
|
|
|
|
@class CAEAGLLayer;
|
|
|
|
namespace flutter {
|
|
|
|
class IOSSurfaceGL final : public IOSSurface, public GPUSurfaceGLDelegate {
|
|
public:
|
|
IOSSurfaceGL(fml::scoped_nsobject<CAEAGLLayer> layer,
|
|
std::shared_ptr<IOSContext> context,
|
|
const std::shared_ptr<IOSExternalViewEmbedder>& external_view_embedder = nullptr);
|
|
|
|
~IOSSurfaceGL() override;
|
|
|
|
// |IOSSurface|
|
|
bool IsValid() const override;
|
|
|
|
// |IOSSurface|
|
|
void UpdateStorageSizeIfNecessary() override;
|
|
|
|
// |IOSSurface|
|
|
std::unique_ptr<Surface> CreateGPUSurface(GrDirectContext* gr_context) override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool GLContextClearCurrent() override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool GLContextPresent(uint32_t fbo_id) override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
intptr_t GLContextFBO(GLFrameInfo frame_info) const override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
bool SurfaceSupportsReadback() const override;
|
|
|
|
// |GPUSurfaceGLDelegate|
|
|
ExternalViewEmbedder* GetExternalViewEmbedder() override;
|
|
|
|
private:
|
|
std::unique_ptr<IOSRenderTargetGL> render_target_;
|
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceGL);
|
|
};
|
|
|
|
} // namespace flutter
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_
|