Migrate use of deprecated GrDirectContext::MakeMetal (flutter/engine#51537)
This was deprecated in https://skia-review.googlesource.com/c/skia/+/826397. Furthermore, some metal files were relocated, so this changes those also. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "third_party/skia/include/core/SkSize.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/mtl/GrMtlTypes.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "flutter/impeller/renderer/backend/metal/context_mtl.h"
|
||||
#include "flutter/impeller/renderer/renderer.h"
|
||||
#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
|
||||
#include "third_party/skia/include/gpu/mtl/GrMtlTypes.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "flutter/fml/macros.h"
|
||||
#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
|
||||
#import "flutter/shell/platform/darwin/ios/ios_surface.h"
|
||||
#include "third_party/skia/include/gpu/mtl/GrMtlTypes.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlTypes.h"
|
||||
|
||||
@class CAMetalLayer;
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "flutter/fml/logging.h"
|
||||
#include "flutter/fml/platform/darwin/scoped_nsobject.h"
|
||||
#include "third_party/skia/include/core/SkSurface.h"
|
||||
#include "third_party/skia/include/gpu/GrDirectContext.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlBackendContext.h"
|
||||
#include "third_party/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h"
|
||||
|
||||
namespace flutter {
|
||||
|
||||
@@ -28,9 +31,12 @@ TestMetalContext::TestMetalContext() {
|
||||
|
||||
[command_queue.get() setLabel:@"Flutter Test Queue"];
|
||||
|
||||
GrMtlBackendContext backendContext = {};
|
||||
// Skia expect arguments to `MakeMetal` transfer ownership of the reference in for release later
|
||||
// when the GrDirectContext is collected.
|
||||
skia_context_ = GrDirectContext::MakeMetal([device.get() retain], [command_queue.get() retain]);
|
||||
backendContext.fDevice.reset([device.get() retain]);
|
||||
backendContext.fQueue.reset([command_queue.get() retain]);
|
||||
skia_context_ = GrDirectContexts::MakeMetal(backendContext);
|
||||
if (!skia_context_) {
|
||||
FML_LOG(ERROR) << "Could not create the GrDirectContext from the Metal Device "
|
||||
"and command queue.";
|
||||
|
||||
Reference in New Issue
Block a user