5#include "flutter/shell/platform/embedder/embedder_external_texture_metal.h"
8#include "flutter/fml/logging.h"
9#import "flutter/shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.h"
18 if (expected == actual) {
21 FML_LOG(
ERROR) <<
"Invalid number of textures, expected: " << expected <<
", got: " << actual;
35void EmbedderExternalTextureMetal::Paint(
PaintContext& context,
39 if (last_image_ ==
nullptr) {
49 if (
bounds != image_bounds) {
60 std::unique_ptr<FlutterMetalExternalTexture>
texture =
69 switch (
texture->pixel_format) {
72 id<MTLTexture> rgbaTex = (__bridge id<MTLTexture>)
texture->textures[0];
82 id<MTLTexture> yTex = (__bridge id<MTLTexture>)
texture->textures[0];
83 id<MTLTexture> uvTex = (__bridge id<MTLTexture>)
texture->textures[1];
108void EmbedderExternalTextureMetal::OnGrContextCreated() {}
111void EmbedderExternalTextureMetal::OnGrContextDestroyed() {}
114void EmbedderExternalTextureMetal::MarkNewFrameAvailable() {
115 last_image_ =
nullptr;
119void EmbedderExternalTextureMetal::OnTextureUnregistered() {}
@ kRec601_Limited_SkYUVColorSpace
describes SDTV range
@ kJPEG_Full_SkYUVColorSpace
describes full range
static sk_sp< DlImage > Make(const SkImage *image)
EmbedderExternalTextureMetal(int64_t texture_identifier, const ExternalTextureCallback &callback)
std::function< std::unique_ptr< FlutterMetalExternalTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
~EmbedderExternalTextureMetal()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_LOG(severity)
#define FML_DCHECK(condition)
Optional< SkRect > bounds
sk_sp< const SkImage > image
SkSamplingOptions sampling
static bool ValidNumTextures(int expected, int actual)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
flutter::DlCanvas DlCanvas
static constexpr SkISize Make(int32_t w, int32_t h)
static SkRect Make(const SkISize &size)
GrDirectContext * gr_context