Add a stub implementation of FlutterMetalCompositor (flutter/engine#25790)

This commit is contained in:
George Wright
2021-04-27 15:06:21 -07:00
committed by GitHub
parent 2b4b5aefbf
commit d489a6cb71
4 changed files with 81 additions and 0 deletions

View File

@@ -1148,6 +1148,8 @@ FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterKeybo
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManager.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterKeyboardManagerUnittests.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMacOSExternalTexture.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.h
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRenderer.mm
FILE: ../../../flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalRendererTest.mm

View File

@@ -85,6 +85,8 @@ source_set("flutter_framework_source") {
"framework/Source/FlutterKeyboardManager.mm",
"framework/Source/FlutterMacOSExternalTexture.h",
"framework/Source/FlutterMacOSExternalTexture.h",
"framework/Source/FlutterMetalCompositor.h",
"framework/Source/FlutterMetalCompositor.mm",
"framework/Source/FlutterMetalRenderer.h",
"framework/Source/FlutterMetalRenderer.mm",
"framework/Source/FlutterMouseCursorPlugin.h",

View File

@@ -0,0 +1,48 @@
// 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_METAL_COMPOSITOR_H_
#define FLUTTER_METAL_COMPOSITOR_H_
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/darwin/macos/framework/Source/FlutterCompositor.h"
namespace flutter {
class FlutterMetalCompositor : public FlutterCompositor {
public:
explicit FlutterMetalCompositor(FlutterViewController* view_controller);
virtual ~FlutterMetalCompositor() = default;
// Creates a BackingStore and sets backing_store_out to a
// FlutterBackingStore struct containing details of the new
// backing store.
//
// If the backing store is being requested for the first time
// for a given frame, we do not create a new backing store but
// rather return the backing store associated with the
// FlutterView's FlutterSurfaceManager.
//
// Any additional state allocated for the backing store and
// saved as user_data in the backing store must be collected
// in backing_store_out's destruction_callback field which will
// be called when the embedder collects the backing store.
bool CreateBackingStore(const FlutterBackingStoreConfig* config,
FlutterBackingStore* backing_store_out) override;
// Releases and deallocates any and all resources that were allocated
// for this FlutterBackingStore object in CreateBackingStore.
bool CollectBackingStore(const FlutterBackingStore* backing_store) override;
// Composites the provided FlutterLayer objects and presents the composited
// frame to the FlutterView(s).
bool Present(const FlutterLayer** layers, size_t layers_count) override;
FML_DISALLOW_COPY_AND_ASSIGN(FlutterMetalCompositor);
};
} // namespace flutter
#endif // FLUTTER_METAL_COMPOSITOR_H_

View File

@@ -0,0 +1,29 @@
// 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.
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterMetalCompositor.h"
#include "flutter/fml/logging.h"
namespace flutter {
FlutterMetalCompositor::FlutterMetalCompositor(FlutterViewController* view_controller)
: FlutterCompositor(view_controller) {}
bool FlutterMetalCompositor::CreateBackingStore(const FlutterBackingStoreConfig* config,
FlutterBackingStore* backing_store_out) {
FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320";
return false;
}
bool FlutterMetalCompositor::CollectBackingStore(const FlutterBackingStore* backing_store) {
FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320";
return false;
}
bool FlutterMetalCompositor::Present(const FlutterLayer** layers, size_t layers_count) {
FML_CHECK(false) << "Not implemented, see issue: https://github.com/flutter/flutter/issues/81320";
return false;
}
} // namespace flutter