5#include "flutter/shell/common/snapshot_controller_impeller.h"
9#include "flutter/flow/surface.h"
10#include "flutter/fml/trace_event.h"
11#include "flutter/impeller/display_list/dl_dispatcher.h"
12#include "flutter/impeller/display_list/dl_image_impeller.h"
13#include "flutter/impeller/geometry/size.h"
14#include "flutter/shell/common/snapshot_controller.h"
22 const std::shared_ptr<impeller::AiksContext>& context) {
25 display_list->Dispatch(dispatcher);
28 auto max_size = context->GetContext()
29 ->GetResourceAllocator()
30 ->GetMaxTextureSizeSupported();
31 double scale_factor_x =
32 static_cast<double>(max_size.width) /
static_cast<double>(
size.width());
33 double scale_factor_y =
static_cast<double>(max_size.height) /
34 static_cast<double>(
size.height());
43 if (scale_factor < 1.0) {
44 render_target_size.width *= scale_factor;
45 render_target_size.height *= scale_factor;
48 std::shared_ptr<impeller::Image>
image =
49 picture.ToImage(*context, render_target_size);
62 const std::shared_ptr<const fml::SyncSwitch>& sync_switch,
63 const std::shared_ptr<impeller::AiksContext>& context) {
70 result = DoMakeRasterSnapshot(
71 display_list, picture_size, context);
83 std::shared_ptr<const fml::SyncSwitch> sync_switch =
88 std::shared_ptr<impeller::AiksContext> context =
91 context->GetContext()->StoreTaskForGPU(
92 [context, sync_switch, display_list = std::move(display_list),
94 callback(DoMakeRasterSnapshot(display_list, picture_size,
95 sync_switch, context));
102 callback(DoMakeRasterSnapshot(display_list, picture_size,
110 return DoMakeRasterSnapshot(display_list, picture_size,
116 const std::shared_ptr<impeller::RuntimeStage>& runtime_stage) {
sk_sp< SkImage > ConvertToRasterImage(sk_sp< SkImage > image) override
void CacheRuntimeStage(const std::shared_ptr< impeller::RuntimeStage > &runtime_stage) override
sk_sp< DlImage > MakeRasterSnapshotSync(sk_sp< DisplayList > display_list, SkISize picture_size) override
void MakeRasterSnapshot(sk_sp< DisplayList > display_list, SkISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback) override
virtual std::shared_ptr< const fml::SyncSwitch > GetIsGpuDisabledSyncSwitch() const =0
virtual std::shared_ptr< impeller::AiksContext > GetAiksContext() const =0
const Delegate & GetDelegate()
Picture EndRecordingAsPicture()
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
bool BootstrapShader(const ContentContext &renderer) const
Load the runtime effect and ensure a default PSO is initialized.
void SetRuntimeStage(std::shared_ptr< RuntimeStage > runtime_stage)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
#define FML_UNREACHABLE()
Dart_NativeFunction function
static float min(float r, float g, float b)
sk_sp< const SkImage > image
sk_sp< const SkPicture > picture
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
Represents the 2 code paths available when calling |SyncSwitch::Execute|.
#define TRACE_EVENT0(category_group, name)