forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "[metal] Darwin unified external metal textures (flutter#24157)…
…" (flutter#24244)
- Loading branch information
1 parent
625d13a
commit 2e10a97
Showing
12 changed files
with
370 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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 <Foundation/Foundation.h> | ||
#import <Metal/Metal.h> | ||
|
||
#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterTexture.h" | ||
#include "third_party/skia/include/core/SkCanvas.h" | ||
#include "third_party/skia/include/gpu/GrDirectContext.h" | ||
|
||
@interface FlutterDarwinExternalTextureMetal : NSObject | ||
|
||
- (nullable instancetype)initWithTextureCache:(nonnull CVMetalTextureCacheRef)textureCache | ||
textureID:(int64_t)textureID | ||
texture:(nonnull NSObject<FlutterTexture>*)texture; | ||
|
||
- (void)paint:(SkCanvas&)canvas | ||
bounds:(const SkRect&)bounds | ||
freeze:(BOOL)freeze | ||
grContext:(nonnull GrDirectContext*)grContext | ||
sampling:(const SkSamplingOptions&)sampling; | ||
|
||
- (void)onGrContextCreated; | ||
|
||
- (void)onGrContextDestroyed; | ||
|
||
- (void)markNewFrameAvailable; | ||
|
||
- (void)onTextureUnregistered; | ||
|
||
@property(nonatomic, readonly) int64_t textureID; | ||
|
||
@end |
Oops, something went wrong.