Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,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
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/darwin/macos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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_
Original file line number Diff line number Diff line change
@@ -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;
Comment thread
gw280 marked this conversation as resolved.
}
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