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;
39 if (last_image_ ==
nullptr) {
49 if (bounds != image_bounds) {
52 canvas->
DrawImage(last_image_, {bounds.x(), bounds.y()}, sampling,
paint);
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];
115 last_image_ =
nullptr;
@ kRec601_Limited_SkYUVColorSpace
describes SDTV range
@ kJPEG_Full_SkYUVColorSpace
describes full range
Developer-facing API for rendering anything within the engine.
virtual void DrawImageRect(const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast)=0
virtual void DrawImage(const sk_sp< DlImage > &image, const SkPoint point, DlImageSampling sampling, const DlPaint *paint=nullptr)=0
static sk_sp< DlImage > Make(const SkImage *image)
void MarkNewFrameAvailable() override
EmbedderExternalTextureMetal(int64_t texture_identifier, const ExternalTextureCallback &callback)
std::function< std::unique_ptr< FlutterMetalExternalTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
void OnGrContextCreated() override
void OnGrContextDestroyed() override
void OnTextureUnregistered() override
void Paint(PaintContext &context, const SkRect &bounds, bool freeze, const DlImageSampling sampling) override
~EmbedderExternalTextureMetal()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_LOG(severity)
#define FML_DCHECK(condition)
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
static constexpr SkISize Make(int32_t w, int32_t h)
static SkRect Make(const SkISize &size)
GrDirectContext * gr_context