chore: Upgrade Skia to new Ganesh Rendering Pipeline and RN to 0.72 (#1638)
* chore: Upgrade all Deps RN 72 * fix breaking skia changes * fix devDeps * Update yarn.lock * fix metro config * Update yarn.lock
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "SkiaMetalCanvasProvider.h"
|
||||
#include <include/core/SkCanvas.h>
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
@@ -13,7 +13,9 @@
|
||||
#import <include/core/SkColorSpace.h>
|
||||
#import <include/core/SkSurface.h>
|
||||
#import <include/core/SkCanvas.h>
|
||||
#import <include/core/SkData.h>
|
||||
#import <include/core/SkImage.h>
|
||||
#import <include/gpu/ganesh/SkImageGanesh.h>
|
||||
#import <include/gpu/mtl/GrMtlTypes.h>
|
||||
#import <include/gpu/GrRecordingContext.h>
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
@@ -68,17 +70,17 @@ sk_sp<SkImage> SkImageHelpers::convertCMSampleBufferToSkImage(GrRecordingContext
|
||||
GrMtlTextureInfo textureInfo;
|
||||
auto mtlTexture = CVMetalTextureGetTexture(cvTexture);
|
||||
textureInfo.fTexture.retain((__bridge void*)mtlTexture);
|
||||
|
||||
|
||||
// Wrap it in a GrBackendTexture
|
||||
GrBackendTexture texture(width, height, GrMipmapped::kNo, textureInfo);
|
||||
|
||||
|
||||
// Create an SkImage from the existing texture
|
||||
auto image = SkImage::MakeFromTexture(context,
|
||||
texture,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
kBGRA_8888_SkColorType,
|
||||
kOpaque_SkAlphaType,
|
||||
SkColorSpace::MakeSRGB());
|
||||
auto image = SkImages::AdoptTextureFrom(context,
|
||||
texture,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
kBGRA_8888_SkColorType,
|
||||
kOpaque_SkAlphaType,
|
||||
SkColorSpace::MakeSRGB());
|
||||
|
||||
// Release the Texture wrapper (it will still be strong)
|
||||
CFRelease(cvTexture);
|
||||
|
@@ -6,11 +6,12 @@
|
||||
|
||||
#import <MetalKit/MetalKit.h>
|
||||
#import <QuartzCore/CAMetalLayer.h>
|
||||
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
#include <functional>
|
||||
#include <include/gpu/GrDirectContext.h>
|
||||
#include <include/core/SkCanvas.h>
|
||||
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#import <include/core/SkSurface.h>
|
||||
#import <include/core/SkCanvas.h>
|
||||
#import <include/core/SkFont.h>
|
||||
#import <include/gpu/ganesh/SkImageGanesh.h>
|
||||
#import <include/gpu/GrDirectContext.h>
|
||||
|
||||
#import "SkImageHelpers.h"
|
||||
@@ -120,12 +121,12 @@ void SkiaMetalCanvasProvider::render() {
|
||||
GrMtlTextureInfo textureInfo;
|
||||
textureInfo.fTexture.retain((__bridge void*)texture);
|
||||
GrBackendTexture backendTexture(texture.width, texture.height, GrMipmapped::kNo, textureInfo);
|
||||
auto image = SkImage::MakeFromTexture(context,
|
||||
backendTexture,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
kBGRA_8888_SkColorType,
|
||||
kOpaque_SkAlphaType,
|
||||
SkColorSpace::MakeSRGB());
|
||||
auto image = SkImages::AdoptTextureFrom(context,
|
||||
backendTexture,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
kBGRA_8888_SkColorType,
|
||||
kOpaque_SkAlphaType,
|
||||
SkColorSpace::MakeSRGB());
|
||||
|
||||
// Draw the Texture (Frame) to the Canvas
|
||||
canvas->drawImage(image, 0, 0);
|
||||
|
Reference in New Issue
Block a user