Flutter Engine
flutter Namespace Reference

Namespaces

 internal
 
 runtime
 
 testing
 

Classes

class  AccessibilityBridge
 
class  AccessibilityBridgeIos
 Interface that represents an accessibility bridge for iOS. More...
 
class  AndroidContext
 Holds state that is shared across Android surfaces. More...
 
class  AndroidContextGL
 
class  AndroidEGLSurface
 
class  AndroidEnvironmentGL
 
class  AndroidExternalTextureGL
 
class  AndroidExternalViewEmbedder
 
class  AndroidNativeWindow
 
class  AndroidShellHolder
 
class  AndroidSurface
 
class  AndroidSurfaceFactory
 
class  AndroidSurfaceFactoryImpl
 
class  AndroidSurfaceGL
 
class  AndroidSurfaceMock
 
class  AndroidSurfaceSoftware
 
class  AndroidSurfaceVulkan
 
class  AngleSurfaceManager
 
class  Animator
 
struct  AotDataDeleter
 
class  APKAssetMapping
 
class  APKAssetProvider
 
class  AppSnapshotIsolateConfiguration
 
class  AssetManager
 
class  AssetManagerFontProvider
 
class  AssetManagerFontStyleSet
 
class  AssetResolver
 
class  BackdropFilterLayer
 
class  BasicMessageChannel
 
class  BinaryMessenger
 
class  BinaryMessengerImpl
 
class  ByteBufferStreamReader
 
class  ByteBufferStreamWriter
 
class  ByteStreamReader
 
class  ByteStreamWriter
 
class  Canvas
 
class  CanvasGradient
 
class  CanvasImage
 
class  CanvasPath
 
class  CanvasPathMeasure
 
class  CanvasSpy
 
class  ChildSceneLayer
 
class  ClipPathLayer
 
class  ClipRectLayer
 
class  ClipRRectLayer
 
class  Codec
 
class  ColorFilter
 
class  ColorFilterLayer
 
class  CompositorContext
 
class  ConnectionCollection
 Maintains a current integer assigned to a name (connections). More...
 
class  ContainerLayer
 
class  Counter
 
class  CounterValues
 
struct  CpuUsageInfo
 CPU usage stats. num_threads is the number of threads owned by the process. It is to be noted that this is not per shell, there can be multiple shells within the process. total_cpu_usage is the percentage (between [0, 100]) cpu usage of the application. This is across all the cores, for example an application using 100% of all the core will report total_cpu_usage as 100, if it has 100% across 2 cores and 0% across the other cores, embedder must report total_cpu_usage as 50. More...
 
class  CursorHandler
 
struct  CustomAccessibilityAction
 
class  CustomEncodableValue
 
class  DartCallbackCache
 
struct  DartCallbackRepresentation
 
class  DartIO
 
class  DartIsolate
 Represents an instance of a live isolate. An isolate is a separate Dart execution context. Different Dart isolates don't share memory and can be scheduled concurrently by the Dart VM on one of the Dart VM managed worker pool threads. More...
 
class  DartIsolateGroupData
 
class  DartProject
 
class  DartProjectTest
 
class  DartRuntimeHooks
 
class  DartServiceIsolate
 Utility methods for interacting with the DartVM managed service isolate present in debug and profile runtime modes. More...
 
class  DartSnapshot
 A read-only Dart heap snapshot, or, read-executable mapping of AOT compiled Dart code. More...
 
class  DartUI
 
class  DartVM
 Describes a running instance of the Dart VM. There may only be one running instance of the Dart VM in the process at any given time. The Dart VM may be created and destroyed on any thread. Typically, the first Flutter shell instance running in the process bootstraps the Dart VM in the process as it starts up. This cost is borne on the platform task runner of that first Flutter shell. When the last Flutter shell instance is destroyed, the VM is destroyed as well if all shell instances were launched with the Settings::leak_vm flag set to false. If there is any shell launch in the process with leak_vm set to true, the VM is never shut down in the process. When the VM is shutdown, the cost of the shutdown is borne on the platform task runner of the last shell instance to be shut down. More...
 
class  DartVMData
 Provides thread-safe access to data that is necessary to bootstrap a new Dart VM instance. All snapshots referenced by this object are read-only. More...
 
class  DartVMRef
 
class  DefaultPointerDataDispatcher
 
class  DidDrawCanvas
 
class  DirectoryAssetBundle
 
class  Display
 
class  DisplayManager
 Manages lifecycle of the connected displays. This class is thread-safe. More...
 
class  EmbeddedViewParams
 
class  EmbedderEngine
 
class  EmbedderExternalTextureGL
 
class  EmbedderExternalView
 
class  EmbedderExternalViewEmbedder
 The external view embedder used by the generic embedder API. This class acts a proxy between the rasterizer and the embedder when the rasterizer is rendering into multiple layers. It asks the embedder for the render targets for the various layers the rasterizer is rendering into, recycles the render targets as necessary and converts rasterizer specific metadata into an embedder friendly format so that it can present the layers on-screen. More...
 
class  EmbedderLayers
 
class  EmbedderPlatformMessageResponse
 The platform message response subclass for responses to messages from the embedder to the framework. Message responses are fulfilled by the framework. More...
 
class  EmbedderRenderTarget
 Describes a surface whose backing store is managed by the embedder. The type of surface depends on the client rendering API used. The embedder is notified of the collection of this render target via a callback. More...
 
class  EmbedderRenderTargetCache
 A cache used to reference render targets that are owned by the embedder but needed by th engine to render a frame. More...
 
class  EmbedderResources
 
class  EmbedderSurface
 
class  EmbedderSurfaceGL
 
class  EmbedderSurfaceSoftware
 
class  EmbedderTaskRunner
 
class  EmbedderThreadHost
 
class  EncodableValue
 
class  Engine
 
class  EngineLayer
 
class  EngineMethodResult
 
class  EventChannel
 
class  EventLoop
 
class  EventSink
 
class  ExternalViewEmbedder
 
class  Fixture
 
class  FlutterEngine
 
class  FlutterEventTracer
 
class  FlutterMain
 
struct  FlutterPlatformViewLayer
 
class  FlutterPlatformViewLayerPool
 
class  FlutterPlatformViewsController
 
class  FlutterProjectBundle
 
class  FlutterView
 
class  FlutterViewController
 
class  FlutterWindow
 
class  FlutterWindowController
 
class  FlutterWindowsEngine
 
class  FlutterWindowsView
 
class  FontCollection
 
class  FrameTiming
 
class  GLContextDefaultResult
 
class  GLContextResult
 
class  GLContextSwitch
 
struct  GLFrameInfo
 
class  GLFWEventLoop
 
class  GPUSurfaceDelegate
 
class  GPUSurfaceGL
 
class  GPUSurfaceGLDelegate
 
class  GPUSurfaceMetal
 
class  GPUSurfaceSoftware
 
class  GPUSurfaceSoftwareDelegate
 Interface implemented by all platform surfaces that can present a software backing store to the "screen". The GPU surface abstraction (which abstracts the client rendering API) uses this delegation pattern to tell the platform surface (which abstracts how backing stores fulfilled by the selected client rendering API end up on the "screen" on a particular platform) when the rasterizer needs to allocate and present the software backing store. More...
 
class  GPUSurfaceVulkan
 
class  GPUSurfaceVulkanDelegate
 
struct  GpuUsageInfo
 Polled information related to the usage of the GPU. More...
 
class  HeadlessEventLoop
 
class  HintFreedDelegate
 
class  ImageDecoder
 
class  ImageDescriptor
 
class  ImageFilter
 
class  ImageFilterLayer
 
struct  ImageMetaData
 
class  ImageShader
 
class  ImmutableBuffer
 
class  IncomingMessageDispatcher
 
class  IOManager
 
class  IOSContext
 Manages the lifetime of the on-screen and off-screen rendering contexts on iOS. On-screen contexts are used by Flutter for rendering into the surface. The lifecycle of this context may be tied to the lifecycle of the surface. On the other hand, the lifecycle of the the off-screen context it tied to that of the platform view. This one object used to manage both context because GPU handles may need to be shared between the two context. To achieve this, context may need references to one another at creation time. This one object manages the creation, use and collection of both contexts in a client rendering API agnostic manner. More...
 
class  IOSContextGL
 
class  IOSContextMetal
 
class  IOSContextSoftware
 
class  IOSExternalTextureGL
 
class  IOSExternalTextureMetal
 
class  IOSExternalViewEmbedder
 
class  IOSRenderTargetGL
 
class  IOSSurface
 
class  IOSSurfaceGL
 
class  IOSSurfaceMetal
 
class  IOSSurfaceSoftware
 
class  IOSSwitchableGLContext
 
class  IsolateConfiguration
 An isolate configuration is a collection of snapshots and asset managers that the engine will use to configure the isolate before invoking its root entrypoint. The set of snapshots must be sufficient for the engine to move the isolate from the |DartIsolate::Phase::LibrariesSetup| phase to the |DartIsolate::Phase::Ready| phase. Note that the isolate configuration will not be collected till the isolate tied to the configuration as well as any and all child isolates of that isolate are collected. The engine may ask the configuration to prepare multiple isolates. All subclasses of this class must be thread safe as the configuration may be created, collected and used on multiple threads. Usually these threads are engine or VM managed so care must be taken to ensure that subclasses do not reference any thread local state. More...
 
class  IsolateNameServer
 
class  IsolateNameServerNatives
 
class  JNIMock
 
class  JsonMessageCodec
 
class  JsonMethodCodec
 
class  KernelIsolateConfiguration
 
class  KernelListIsolateConfiguration
 
class  KeyboardHookHandler
 
class  KeyEventHandler
 
struct  LanguageInfo
 
class  Layer
 
class  LayerTree
 
struct  LineMetrics
 
class  MatrixDecomposition
 
struct  MemoryUsageInfo
 Memory usage stats. dirty_memory_usage is the the memory usage (in MB) such that the app uses its physical memory for dirty memory. Dirty memory is the memory data that cannot be paged to disk. owned_shared_memory_usage is the memory usage (in MB) such that the app uses its physicaal memory for shared memory, including loaded frameworks and executables. On iOS, it's physical memory - dirty memory. More...
 
class  MergedContainerLayer
 
class  MessageCodec
 
class  MethodCall
 
class  MethodChannel
 
class  MethodCodec
 
class  MethodResult
 
class  MethodResultFunctions
 
class  MultiFrameCodec
 
class  Mutator
 
class  MutatorsStack
 
class  OpacityLayer
 
struct  OverlayLayer
 
class  Paint
 
class  PaintData
 
class  Paragraph
 
class  ParagraphBuilder
 
class  PerformanceOverlayLayer
 
class  PersistentCache
 
class  PhysicalShapeLayer
 
struct  PhysicalWindowBounds
 
class  Picture
 
class  PictureLayer
 
class  PictureRecorder
 
class  Pipeline
 
class  PlatformConfiguration
 A class for holding and distributing platform-level information to and from the Dart code in Flutter's framework. More...
 
class  PlatformConfigurationClient
 A client interface that the RuntimeController uses to define handlers for PlatformConfiguration requests. More...
 
struct  PlatformData
 
class  PlatformHandler
 
class  PlatformMessage
 
class  PlatformMessageResponse
 
class  PlatformMessageResponseAndroid
 
class  PlatformMessageResponseDart
 
class  PlatformMessageResponseDarwin
 
class  PlatformMessageRouter
 
class  PlatformView
 Platform views are created by the shell on the platform task runner. Unless explicitly specified, all platform view methods are called on the platform task runner as well. Platform views are usually sub-classed on a per platform basis and the bulk of the window system integration happens using that subclass. Since most platform window toolkits are usually only safe to access on a single "main" thread, any interaction that requires access to the underlying platform's window toolkit is routed through the platform view associated with that shell. This involves operations like settings up and tearing down the render surface, platform messages, interacting with accessibility features on the platform, input events, etc. More...
 
class  PlatformViewAndroid
 
class  PlatformViewAndroidDelegate
 
class  PlatformViewAndroidJNI
 
class  PlatformViewAndroidJNIImpl
 Concrete implementation of PlatformViewAndroidJNI that is compiled with the Android toolchain. More...
 
class  PlatformViewEmbedder
 
class  PlatformViewIOS
 
class  PlatformViewLayer
 
class  Plugin
 
class  PluginRegistrar
 
class  PluginRegistrarGlfw
 
class  PluginRegistrarManager
 
class  PluginRegistrarWindows
 
class  PluginRegistry
 
class  Point
 
struct  PointerData
 
class  PointerDataDispatcher
 
class  PointerDataPacket
 
class  PointerDataPacketConverter
 
struct  PointerState
 
class  PointExtensionSerializer
 
struct  PrerollContext
 
class  ProfilerMetricsIOS
 Utility class that gathers profiling metrics used by flutter::SamplingProfiler. More...
 
struct  ProfileSample
 Container for the metrics we collect during each run of Sampler. This currently holds CpuUsageInfo and MemoryUsageInfo but the intent is to expand it to other metrics. More...
 
class  RasterCache
 
class  RasterCacheKey
 
class  RasterCacheResult
 
class  Rasterizer
 
class  RefCountedDartWrappable
 
class  RRect
 
class  RTree
 
class  RTreeFactory
 
class  RunConfiguration
 Specifies all the configuration required by the runtime library to launch the root isolate. This object may be created on any thread but must be given to the |Run| call of the |Engine| on the UI thread. The configuration object is used to specify how the root isolate finds its snapshots, assets, root library and the "main" entrypoint. More...
 
class  RuntimeController
 
class  RuntimeDelegate
 
class  SamplingProfiler
 a Sampling Profiler that runs peridically and calls the Sampler which servers as a value function to gather various profiling metrics as represented by ProfileSample. These profiling metrics are then posted to the observatory timeline. More...
 
class  Scene
 
class  SceneBuilder
 
class  SceneHost
 
class  SceneUpdateContext
 
class  ScriptCompletionTaskObserver
 
struct  SemanticsNode
 
class  SemanticsUpdate
 
class  SemanticsUpdateBuilder
 
class  ServiceProtocol
 
class  SessionWrapper
 
struct  Settings
 
class  Shader
 
class  ShaderMaskLayer
 
class  Shell
 
struct  ShellArgs
 
class  ShellIOManager
 
class  ShellTestExternalViewEmbedder
 The external view embedder used by |ShellTestPlatformViewGL|. More...
 
class  SingleFrameCodec
 
class  SkiaConcurrentExecutor
 An interface used by Skia to schedule work on engine managed threads (usually workers in a concurrent message loop). More...
 
class  SkiaGPUObject
 
class  SkiaUnrefQueue
 
class  SmoothPointerDataDispatcher
 
class  SnapshotDelegate
 
class  SomeData
 
class  SomeDataExtensionSerializer
 
class  StandardCodecSerializer
 
class  StandardMessageCodec
 
class  StandardMethodCodec
 
class  Stopwatch
 
class  StreamHandler
 
struct  StreamHandlerError
 
class  StreamHandlerFunctions
 
class  Surface
 Abstract Base Class that represents where we will be rendering content. More...
 
class  SurfaceFrame
 
class  SurfacePool
 
class  SwitchableGLContext
 
class  TaskRunners
 
class  TestMetalSurface
 Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests. More...
 
class  TestMetalSurfaceImpl
 
struct  TextBox
 
class  TextInputModel
 
class  TextInputPlugin
 
class  Texture
 
class  TextureLayer
 
class  TextureRegistry
 
struct  ThreadHost
 The collection of all the threads used by the engine. More...
 
class  TransformLayer
 
class  UIDartState
 
class  Vertices
 
class  ViewHolder
 
struct  ViewportMetrics
 
class  VsyncWaiter
 
class  VsyncWaiterAndroid
 
class  VsyncWaiterEmbedder
 
class  VsyncWaiterFallback
 A |VsyncWaiter| that will fire at 60 fps irrespective of the vsync. More...
 
class  VsyncWaiterIOS
 
class  Win32FlutterWindow
 
class  Win32TaskRunner
 
class  Win32Window
 
class  Win32WindowProcDelegateManager
 
class  Window
 
class  WindowBindingHandler
 
class  WindowBindingHandlerDelegate
 
struct  WindowFrame
 
struct  WindowProperties
 

Typedefs

using TaskObserverAdd = std::function< void(intptr_t, fml::closure)>
 
using TaskObserverRemove = std::function< void(intptr_t)>
 
using UnhandledExceptionCallback = std::function< bool(const std::string &, const std::string &)>
 
using MappingCallback = std::function< std::unique_ptr< fml::Mapping >(void)>
 
using Mappings = std::vector< std::unique_ptr< const fml::Mapping > >
 
using MappingsCallback = std::function< Mappings(void)>
 
using FrameRasterizedCallback = std::function< void(const FrameTiming &)>
 
using PictureRasterCacheKey = RasterCacheKey< uint32_t >
 
using LayerRasterCacheKey = RasterCacheKey< uint64_t >
 
typedef CanvasGradient Gradient
 
typedef CanvasImage Image
 
typedef CanvasPath Path
 
typedef CanvasPathMeasure PathMeasure
 
using CustomAccessibilityActionUpdates = std::unordered_map< int32_t, CustomAccessibilityAction >
 
using SemanticsNodeUpdates = std::unordered_map< int32_t, SemanticsNode >
 
using ChildIsolatePreparer = std::function< bool(DartIsolate *)>
 
typedef uint64_t DisplayId
 
using PointerDataDispatcherMaker = std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)>
 Signature for constructing PointerDataDispatcher. More...
 
template<class T >
using EGLResult = std::pair< bool, T >
 
using JavaWeakGlobalRef = std::nullptr_t
 
template<typename T >
using MessageReply = std::function< void(const T &reply)>
 
template<typename T >
using MessageHandler = std::function< void(const T &message, const MessageReply< T > &reply)>
 
typedef std::function< void(const uint8_t *reply, size_t reply_size)> BinaryReply
 
typedef std::function< void(const uint8_t *message, size_t message_size, BinaryReply reply)> BinaryMessageHandler
 
using EncodableList = std::vector< EncodableValue >
 
using EncodableMap = std::map< EncodableValue, EncodableValue >
 
template<typename T >
using StreamHandlerListen = std::function< std::unique_ptr< StreamHandlerError< T > >(const T *arguments, std::unique_ptr< EventSink< T > > &&events)>
 
template<typename T >
using StreamHandlerCancel = std::function< std::unique_ptr< StreamHandlerError< T > >(const T *arguments)>
 
template<typename T >
using MethodCallHandler = std::function< void(const MethodCall< T > &call, std::unique_ptr< MethodResult< T > > result)>
 
template<typename T >
using ResultHandlerSuccess = std::function< void(const T *result)>
 
template<typename T >
using ResultHandlerError = std::function< void(const std::string &error_code, const std::string &error_message, const T *error_details)>
 
template<typename T >
using ResultHandlerNotImplemented = std::function< void()>
 
using WindowProcDelegate = std::function< std::optional< LRESULT >(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)>
 
using UniqueAotDataPtr = std::unique_ptr< _FlutterEngineAOTData, AotDataDeleter >
 
using WindowsRenderTarget = std::variant< HWND >
 
using Sampler = std::function< ProfileSample(void)>
 Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version of a Sampler if they decide to participate in gathering profiling metrics. More...
 

Enumerations

enum  RasterStatus {
  RasterStatus::kSuccess,
  RasterStatus::kResubmit,
  RasterStatus::kSkipAndRetry,
  RasterStatus::kEnqueuePipeline,
  RasterStatus::kFailed,
  RasterStatus::kDiscarded
}
 
enum  MutatorType {
  clip_rect,
  clip_rrect,
  clip_path,
  transform,
  opacity
}
 
enum  PostPrerollResult {
  PostPrerollResult::kSuccess,
  PostPrerollResult::kResubmitFrame,
  PostPrerollResult::kSkipAndRetryFrame
}
 
enum  Clip {
  none,
  hardEdge,
  antiAlias,
  antiAliasWithSaveLayer
}
 
enum  MaskFilterType {
  Null,
  Blur
}
 
enum  SemanticsAction : int32_t {
  SemanticsAction::kTap = 1 << 0,
  SemanticsAction::kLongPress = 1 << 1,
  SemanticsAction::kScrollLeft = 1 << 2,
  SemanticsAction::kScrollRight = 1 << 3,
  SemanticsAction::kScrollUp = 1 << 4,
  SemanticsAction::kScrollDown = 1 << 5,
  SemanticsAction::kIncrease = 1 << 6,
  SemanticsAction::kDecrease = 1 << 7,
  SemanticsAction::kShowOnScreen = 1 << 8,
  SemanticsAction::kMoveCursorForwardByCharacter = 1 << 9,
  SemanticsAction::kMoveCursorBackwardByCharacter = 1 << 10,
  SemanticsAction::kSetSelection = 1 << 11,
  SemanticsAction::kCopy = 1 << 12,
  SemanticsAction::kCut = 1 << 13,
  SemanticsAction::kPaste = 1 << 14,
  SemanticsAction::kDidGainAccessibilityFocus = 1 << 15,
  SemanticsAction::kDidLoseAccessibilityFocus = 1 << 16,
  SemanticsAction::kCustomAction = 1 << 17,
  SemanticsAction::kDismiss = 1 << 18,
  SemanticsAction::kMoveCursorForwardByWordIndex = 1 << 19,
  SemanticsAction::kMoveCursorBackwardByWordIndex = 1 << 20
}
 
enum  SemanticsFlags : int32_t {
  SemanticsFlags::kHasCheckedState = 1 << 0,
  SemanticsFlags::kIsChecked = 1 << 1,
  SemanticsFlags::kIsSelected = 1 << 2,
  SemanticsFlags::kIsButton = 1 << 3,
  SemanticsFlags::kIsTextField = 1 << 4,
  SemanticsFlags::kIsFocused = 1 << 5,
  SemanticsFlags::kHasEnabledState = 1 << 6,
  SemanticsFlags::kIsEnabled = 1 << 7,
  SemanticsFlags::kIsInMutuallyExclusiveGroup = 1 << 8,
  SemanticsFlags::kIsHeader = 1 << 9,
  SemanticsFlags::kIsObscured = 1 << 10,
  SemanticsFlags::kScopesRoute = 1 << 11,
  SemanticsFlags::kNamesRoute = 1 << 12,
  SemanticsFlags::kIsHidden = 1 << 13,
  SemanticsFlags::kIsImage = 1 << 14,
  SemanticsFlags::kIsLiveRegion = 1 << 15,
  SemanticsFlags::kHasToggledState = 1 << 16,
  SemanticsFlags::kIsToggled = 1 << 17,
  SemanticsFlags::kHasImplicitScrolling = 1 << 18,
  SemanticsFlags::kIsReadOnly = 1 << 20,
  SemanticsFlags::kIsFocusable = 1 << 21,
  SemanticsFlags::kIsLink = 1 << 22,
  SemanticsFlags::kIsSlider = 1 << 23
}
 
enum  TextDirection {
  TextDirection::rtl,
  TextDirection::ltr
}
 
enum  AccessibilityFeatureFlag : int32_t {
  AccessibilityFeatureFlag::kAccessibleNavigation = 1 << 0,
  AccessibilityFeatureFlag::kInvertColors = 1 << 1,
  AccessibilityFeatureFlag::kDisableAnimations = 1 << 2,
  AccessibilityFeatureFlag::kBoldText = 1 << 3,
  AccessibilityFeatureFlag::kReduceMotion = 1 << 4,
  AccessibilityFeatureFlag::kHighContrast = 1 << 5
}
 An enum for defining the different kinds of accessibility features that can be enabled by the platform. More...
 
enum  PointerButtonMouse : int64_t {
  kPointerButtonMousePrimary = 1 << 0,
  kPointerButtonMouseSecondary = 1 << 1,
  kPointerButtonMouseMiddle = 1 << 2,
  kPointerButtonMouseBack = 1 << 3,
  kPointerButtonMouseForward = 1 << 4
}
 
enum  PointerButtonTouch : int64_t { kPointerButtonTouchContact = 1 << 0 }
 
enum  PointerButtonStylus : int64_t {
  kPointerButtonStylusContact = 1 << 0,
  kPointerButtonStylusPrimary = 1 << 1,
  kPointerButtonStylusSecondary = 1 << 2
}
 
enum  TracingResult {
  TracingResult::kNotAttempted,
  TracingResult::kEnabled,
  TracingResult::kNotNecessary = kEnabled,
  TracingResult::kDisabled
}
 
enum  DisplayUpdateType { DisplayUpdateType::kStartup }
 
enum  PipelineConsumeResult {
  PipelineConsumeResult::NoneAvailable,
  PipelineConsumeResult::Done,
  PipelineConsumeResult::MoreAvailable
}
 
enum  DartErrorCode {
  DartErrorCode::NoError = 0,
  DartErrorCode::ApiError = 253,
  DartErrorCode::CompilationError = 254,
  DartErrorCode::UnknownError = 255
}
 Error exit codes for the Dart isolate. More...
 
enum  AndroidRenderingAPI {
  AndroidRenderingAPI::kSoftware,
  AndroidRenderingAPI::kOpenGLES,
  AndroidRenderingAPI::kVulkan
}
 
enum  IOSRenderingAPI {
  IOSRenderingAPI::kSoftware,
  IOSRenderingAPI::kOpenGLES,
  IOSRenderingAPI::kMetal
}
 

Functions

const std::string & GetGoldenDir ()
 
void SetGoldenDir (const std::string &dir)
 
const std::string & GetFontFile ()
 
void SetFontFile (const std::string &file)
 
static SkV3 SkV3Combine (const SkV3 &a, float a_scale, const SkV3 &b, float b_scale)
 
static void SkV3Normalize (SkV3 *v)
 
void DrawCheckerboard (SkCanvas *canvas, SkColor c1, SkColor c2, int size)
 
void DrawCheckerboard (SkCanvas *canvas, const SkRect &rect)
 
static bool CanRasterizePicture (SkPicture *picture)
 
static bool IsPictureWorthRasterizing (SkPicture *picture, bool will_change, bool is_complex)
 
static std::unique_ptr< RasterCacheResultRasterize (GrDirectContext *context, const SkMatrix &ctm, SkColorSpace *dst_color_space, bool checkerboard, const SkRect &logical_rect, const std::function< void(SkCanvas *)> &draw_function)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Scene)
 
static void SceneBuilder_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SceneBuilder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SceneHost)
 
 BUILTIN_NATIVE_LIST (DECLARE_FUNCTION)
 
static void PropagateIfError (Dart_Handle result)
 
static Dart_Handle InvokeFunction (Dart_Handle builtin_library, const char *name)
 
static void InitDartInternal (Dart_Handle builtin_library, bool is_ui_isolate)
 
static void InitDartCore (Dart_Handle builtin, const std::string &script_uri)
 
static void InitDartAsync (Dart_Handle builtin_library, bool is_ui_isolate)
 
static void InitDartIO (Dart_Handle builtin_library, const std::string &script_uri)
 
void Logger_PrintDebugString (Dart_NativeArguments args)
 
void Logger_PrintString (Dart_NativeArguments args)
 
void SaveCompilationTrace (Dart_NativeArguments args)
 
void ScheduleMicrotask (Dart_NativeArguments args)
 
static std::string GetFunctionLibraryUrl (Dart_Handle closure)
 
static std::string GetFunctionClassName (Dart_Handle closure)
 
static std::string GetFunctionName (Dart_Handle func)
 
void GetCallbackHandle (Dart_NativeArguments args)
 
void GetCallbackFromHandle (Dart_NativeArguments args)
 
static void Canvas_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Canvas)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Codec)
 
static void ColorFilter_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ColorFilter)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, EngineLayer)
 
static void Gradient_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Gradient)
 
static sk_sp< SkImage > ResizeRasterImage (sk_sp< SkImage > image, const SkISize &resized_dimensions, const fml::tracing::TraceFlow &flow)
 
static sk_sp< SkImage > ImageFromDecompressedData (fml::RefPtr< ImageDescriptor > descriptor, uint32_t target_width, uint32_t target_height, const fml::tracing::TraceFlow &flow)
 
sk_sp< SkImage > ImageFromCompressedData (fml::RefPtr< ImageDescriptor > descriptor, uint32_t target_width, uint32_t target_height, const fml::tracing::TraceFlow &flow)
 
static SkiaGPUObject< SkImage > UploadRasterImage (sk_sp< SkImage > image, fml::WeakPtr< IOManager > io_manager, const fml::tracing::TraceFlow &flow)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImageDescriptor)
 
Dart_Handle EncodeImage (CanvasImage *canvas_image, int format, Dart_Handle callback_handle)
 
static void ImageFilter_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImageFilter)
 
static void ImageShader_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImageShader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImmutableBuffer)
 
SkMatrix ToSkMatrix (const tonic::Float64List &matrix4)
 
tonic::Float64List ToMatrix4 (const SkMatrix &sk_matrix)
 
static void InvokeNextFrameCallback (fml::RefPtr< CanvasImage > image, int duration, std::unique_ptr< DartPersistentValue > callback, size_t trace_id)
 
static bool CopyToBitmap (SkBitmap *dst, SkColorType dstColorType, const SkBitmap &src)
 
static void Path_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Path)
 
static void PathMeasure_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, PathMeasure)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Picture)
 
static void PictureRecorder_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, PictureRecorder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Shader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Vertices)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SemanticsUpdate)
 
static void SemanticsUpdateBuilder_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SemanticsUpdateBuilder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Paragraph)
 
static tonic::Float32List EncodeTextBoxes (const std::vector< txt::Paragraph::TextBox > &boxes)
 
static void ParagraphBuilder_constructor (Dart_NativeArguments args)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ParagraphBuilder)
 
void decodeStrut (Dart_Handle strut_data, const std::vector< std::string > &strut_font_families, txt::ParagraphStyle &paragraph_style)
 
void decodeTextShadows (Dart_Handle shadows_data, std::vector< txt::TextShadow > &decoded_shadows)
 
void decodeFontFeatures (Dart_Handle font_features_data, txt::FontFeatures &font_features)
 
static void BM_PlatformMessageResponseDartComplete (benchmark::State &state)
 
 Unit (benchmark::kMicrosecond)
 
Dart_Handle ComputePlatformResolvedLocale (Dart_Handle supportedLocalesHandle)
 
static void _ComputePlatformResolvedLocale (Dart_NativeArguments args)
 
bool operator== (const ViewportMetrics &a, const ViewportMetrics &b)
 
std::ostream & operator<< (std::ostream &os, const ViewportMetrics &a)
 
static bool InvokeMainEntrypoint (Dart_Handle user_entrypoint_function, Dart_Handle args)
 
 TEST (DartServiceIsolateTest, CanAddAndRemoveHandles)
 
static std::unique_ptr< const fml::MappingGetFileMapping (const std::string &path, bool executable)
 
static std::shared_ptr< const fml::MappingSearchMapping (MappingCallback embedder_mapping_callback, const std::string &file_path, const std::vector< std::string > &native_library_path, const char *native_library_symbol_name, bool is_executable)
 
static std::shared_ptr< const fml::MappingResolveVMData (const Settings &settings)
 
static std::shared_ptr< const fml::MappingResolveVMInstructions (const Settings &settings)
 
static std::shared_ptr< const fml::MappingResolveIsolateData (const Settings &settings)
 
static std::shared_ptr< const fml::MappingResolveIsolateInstructions (const Settings &settings)
 
static std::string DartOldGenHeapSizeArgs (uint64_t heap_size)
 
bool DartFileModifiedCallback (const char *source_url, int64_t since_ms)
 
void ThreadExitCallback ()
 
Dart_Handle GetVMServiceAssetsArchiveCallback ()
 
static bool ServiceStreamListenCallback (const char *stream_id)
 
static void ServiceStreamCancelCallback (const char *stream_id)
 
static std::vector< const char * > ProfilingFlags (bool enable_profiling)
 
void PushBackAll (std::vector< const char *> *args, const char **argv, size_t argc)
 
static void EmbedderInformationCallback (Dart_EmbedderInformation *info)
 
static std::vector< std::string > ParseKernelListPaths (std::unique_ptr< fml::Mapping > kernel_list)
 
static std::vector< std::future< std::unique_ptr< const fml::Mapping > > > PrepareKernelMappings (std::vector< std::string > kernel_pieces_paths, std::shared_ptr< AssetManager > asset_manager, fml::RefPtr< fml::TaskRunner > io_worker)
 
bool EnableTracingIfNecessary (const Settings &vm_settings)
 Enables tracing in the process so that JIT mode VMs may be launched. Explicitly enabling tracing is not required on all platforms. On platforms where it is not required, calling this method will return true. If tracing is required but cannot be enabled, it is the responsibility of the caller to display the appropriate error message to the user as subsequent attempts to launch the VM in JIT mode will cause process termination. More...
 
TracingResult GetTracingResult ()
 Returns if a tracing check has been performed and its result. To enable tracing, the Settings object used to launch the VM is required. Components may want to display messages based on the result of a previous tracing check without actually having the settings object. This accessor can be used instead. More...
 
static void WriteServerErrorResponse (rapidjson::Document *document, const char *message)
 
static bool HandleMessageOnHandler (ServiceProtocol::Handler *handler, std::string_view method, const ServiceProtocol::Handler::ServiceProtocolMap &params, rapidjson::Document *document)
 
static std::string CreateFlutterViewID (intptr_t handler)
 
static std::string CreateIsolateID (int64_t isolate)
 
std::vector< std::unique_ptr< SkStreamAsset > > GetTestFontData ()
 
std::string GetTestFontFamilyName ()
 
std::vector< std::string > GetTestFontFamilyNames ()
 
static int64_t FxlToDartOrEarlier (fml::TimePoint time)
 
 TEST_F (EngineTest, Create)
 
 TEST_F (EngineTest, DispatchPlatformMessageUnknown)
 
 TEST_F (EngineTest, DispatchPlatformMessageInitialRoute)
 
 TEST_F (EngineTest, DispatchPlatformMessageInitialRouteIgnored)
 
sk_sp< SkData > ParseBase32 (const std::string &input)
 
sk_sp< SkData > ParseBase64 (const std::string &input)
 
static void PersistentCacheStore (fml::RefPtr< fml::TaskRunner > worker, std::shared_ptr< fml::UniqueFD > cache_directory, std::string key, std::unique_ptr< fml::Mapping > value)
 
size_t GetNextPipelineTraceID ()
 
static constexpr std::chrono::milliseconds kSkiaCleanupExpiration (15000)
 
static sk_sp< SkData > ScreenshotLayerTreeAsPicture (flutter::LayerTree *tree, flutter::CompositorContext &compositor_context)
 
static sk_sp< SkSurface > CreateSnapshotSurface (GrDirectContext *surface_context, const SkISize &size)
 
sk_sp< SkData > SerializeTypefaceWithoutData (SkTypeface *typeface, void *ctx)
 
sk_sp< SkData > SerializeTypefaceWithData (SkTypeface *typeface, void *ctx)
 
struct flutter::ImageMetaData __attribute__ ((packed))
 
sk_sp< SkData > SerializeImageWithoutData (SkImage *image, void *ctx)
 
sk_sp< SkImage > DeserializeImageWithoutData (const void *data, size_t length, void *ctx)
 
static void Tokenize (const std::string &input, std::vector< std::string > *results, char delimiter)
 
static void PerformInitializationTasks (Settings &settings)
 
static void ServiceProtocolParameterError (rapidjson::Document *response, std::string error_details)
 
static void ServiceProtocolFailureError (rapidjson::Document *response, std::string message)
 
static void StartupAndShutdownShell (benchmark::State &state, bool measure_startup, bool measure_shutdown)
 
static void BM_ShellInitialization (benchmark::State &state)
 
 BENCHMARK (BM_ShellInitialization)
 
static void BM_ShellShutdown (benchmark::State &state)
 
 BENCHMARK (BM_ShellShutdown)
 
static void BM_ShellInitializationAndShutdown (benchmark::State &state)
 
 BENCHMARK (BM_ShellInitializationAndShutdown)
 
bool enableSkiaTracingCallback (const char *method, const char **param_keys, const char **param_values, intptr_t num_params, void *user_data, const char **json_object)
 
void InitSkiaEventTracer (bool enabled)
 
void PrintUsage (const std::string &executable_name)
 
const std::string_view FlagForSwitch (Switch swtch)
 
static bool IsAllowedDartVMFlag (const std::string &flag)
 
template<typename T >
static bool GetSwitchValue (const fml::CommandLine &command_line, Switch sw, T *result)
 
std::unique_ptr< fml::MappingGetSymbolMapping (std::string symbol_prefix, std::string native_lib_path)
 
Settings SettingsFromCommandLine (const fml::CommandLine &command_line)
 
DEF_SWITCHES_START DEF_SWITCH (AotSharedLibraryName, "aot-shared-library-name", "Name of the *.so containing AOT compiled Dart assets.") DEF_SWITCH(SnapshotAssetPath
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions DEF_SWITCH (VmSnapshotData, "vm-snapshot-data", "The VM snapshot data that will be memory mapped as read-only. " "SnapshotAssetPath must be present.") DEF_SWITCH(VmSnapshotInstructions
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present DEF_SWITCH (IsolateSnapshotData, "isolate-snapshot-data", "The isolate snapshot data that will be memory mapped as read-only. " "SnapshotAssetPath must be present.") DEF_SWITCH(IsolateSnapshotInstructions
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present DEF_SWITCH (CacheDirPath, "cache-dir-path", "Path to the cache directory. " "This is different from the persistent_cache_path in embedder.h, " "which is used for Skia shader cache.") DEF_SWITCH(ICUSymbolPrefix
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library DEF_SWITCH (ICUNativeLibPath, "icu-native-lib-path", "Path to the library file that exports the ICU data.") DEF_SWITCH(DartFlags
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell DEF_SWITCH (DeviceObservatoryHost, "observatory-host", "The hostname/IP address on which the Dart Observatory should " "be served. If not set, defaults to 127.0.0.1 or ::1 depending on " "whether --ipv6 is specified.") DEF_SWITCH(DeviceObservatoryPort
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port DEF_SWITCH (DisableObservatory, "disable-observatory", "Disable the Dart Observatory. The observatory is never available " "in release mode.") DEF_SWITCH(DisableObservatoryPublication
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication DEF_SWITCH (IPv6, "ipv6", "Bind to the IPv6 localhost address for the Dart Observatory. " "Ignored if --observatory-host is set.") DEF_SWITCH(EnableDartProfiling
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication enable dart Enable Dart profiling Profiling information can be viewed from the observatory DEF_SWITCH (EndlessTraceBuffer, "endless-trace-buffer", "Enable an endless trace buffer. The default is a ring buffer. " "This is useful when very old events need to viewed. For example, " "during application launch. Memory usage will continue to grow " "indefinitely however.") DEF_SWITCH(EnableSoftwareRendering
 
static SkColorType FirstSupportedColorType (GrDirectContext *context, GrGLenum *format)
 
static sk_sp< SkSurface > WrapOnscreenSurface (GrDirectContext *context, const SkISize &size, intptr_t fbo)
 
static bool IsProcResolverOpenGLES (GPUSurfaceGLDelegate::GLProcResolver proc_resolver)
 
static sk_sp< const GrGLInterface > CreateGLInterface (GPUSurfaceGLDelegate::GLProcResolver proc_resolver)
 
static void LogLastEGLError ()
 
static EGLResult< EGLContext > CreateContext (EGLDisplay display, EGLConfig config, EGLContext share=EGL_NO_CONTEXT)
 
static EGLResult< EGLConfig > ChooseEGLConfiguration (EGLDisplay display)
 
static bool TeardownContext (EGLDisplay display, EGLContext context)
 
static PlatformData GetDefaultPlatformData ()
 
static void PrefetchDefaultFontManager (JNIEnv *env, jclass jcaller)
 
jobject CreateFlutterCallbackInformation (JNIEnv *env, const std::string &callbackName, const std::string &callbackClassName, const std::string &callbackLibraryPath)
 
static jlong AttachJNI (JNIEnv *env, jclass clazz, jobject flutterJNI, jboolean is_background_view)
 
static void DestroyJNI (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
static void SurfaceCreated (JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
 
static void SurfaceWindowChanged (JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
 
static void SurfaceChanged (JNIEnv *env, jobject jcaller, jlong shell_holder, jint width, jint height)
 
static void SurfaceDestroyed (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
static void RunBundleAndSnapshotFromLibrary (JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jBundlePath, jstring jEntrypoint, jstring jLibraryUrl, jobject jAssetManager)
 
static jobject LookupCallbackInformation (JNIEnv *env, jobject, jlong handle)
 
static void SetViewportMetrics (JNIEnv *env, jobject jcaller, jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, jint physicalPaddingTop, jint physicalPaddingRight, jint physicalPaddingBottom, jint physicalPaddingLeft, jint physicalViewInsetTop, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft, jint systemGestureInsetTop, jint systemGestureInsetRight, jint systemGestureInsetBottom, jint systemGestureInsetLeft)
 
static jobject GetBitmap (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
static void DispatchPlatformMessage (JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jobject message, jint position, jint responseId)
 
static void DispatchEmptyPlatformMessage (JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jint responseId)
 
static void DispatchPointerDataPacket (JNIEnv *env, jobject jcaller, jlong shell_holder, jobject buffer, jint position)
 
static void DispatchSemanticsAction (JNIEnv *env, jobject jcaller, jlong shell_holder, jint id, jint action, jobject args, jint args_position)
 
static void SetSemanticsEnabled (JNIEnv *env, jobject jcaller, jlong shell_holder, jboolean enabled)
 
static void SetAccessibilityFeatures (JNIEnv *env, jobject jcaller, jlong shell_holder, jint flags)
 
static jboolean GetIsSoftwareRendering (JNIEnv *env, jobject jcaller)
 
static void RegisterTexture (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject surface_texture)
 
static void MarkTextureFrameAvailable (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
 
static void UnregisterTexture (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
 
static void InvokePlatformMessageResponseCallback (JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId, jobject message, jint position)
 
static void InvokePlatformMessageEmptyResponseCallback (JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId)
 
static void NotifyLowMemoryWarning (JNIEnv *env, jobject obj, jlong shell_holder)
 
static jboolean FlutterTextUtilsIsEmoji (JNIEnv *env, jobject obj, jint codePoint)
 
static jboolean FlutterTextUtilsIsEmojiModifier (JNIEnv *env, jobject obj, jint codePoint)
 
static jboolean FlutterTextUtilsIsEmojiModifierBase (JNIEnv *env, jobject obj, jint codePoint)
 
static jboolean FlutterTextUtilsIsVariationSelector (JNIEnv *env, jobject obj, jint codePoint)
 
static jboolean FlutterTextUtilsIsRegionalIndicator (JNIEnv *env, jobject obj, jint codePoint)
 
bool RegisterApi (JNIEnv *env)
 
SkSize ScaleToFill (float scaleX, float scaleY)
 
 TEST (BasicMessageChannelTest, Registration)
 
 TEST (BasicMessageChannelTest, Unregistration)
 
 TEST (EncodableValueTest, Null)
 
 TEST (EncodableValueTest, Bool)
 
 TEST (EncodableValueTest, Int)
 
 TEST (EncodableValueTest, LongValue)
 
 TEST (EncodableValueTest, Long)
 
 TEST (EncodableValueTest, Double)
 
 TEST (EncodableValueTest, String)
 
 TEST (EncodableValueTest, CString)
 
 TEST (EncodableValueTest, UInt8List)
 
 TEST (EncodableValueTest, Int32List)
 
 TEST (EncodableValueTest, Int64List)
 
 TEST (EncodableValueTest, DoubleList)
 
 TEST (EncodableValueTest, List)
 
 TEST (EncodableValueTest, Map)
 
 TEST (EncodableValueTest, Comparison)
 
 TEST (EncodableValueTest, DeepCopy)
 
 TEST (EventChannelTest, Registration)
 
 TEST (EventChannelTest, Unregistration)
 
 TEST (EventChannelTest, Cancel)
 
 TEST (EventChannelTest, ReRegistration)
 
 TEST (MethodCallTest, Basic)
 
 TEST (MethodChannelTest, Registration)
 
 TEST (MethodChannelTest, Unregistration)
 
 TEST (MethodChannelTest, InvokeWithoutResponse)
 
 TEST (MethodChannelTest, InvokeWithResponse)
 
 TEST (MethodChannelTest, InvokeNotImplemented)
 
 TEST (MethodChannelTest, NoHandlers)
 
 TEST (MethodChannelTest, Success)
 
 TEST (MethodChannelTest, Error)
 
 TEST (MethodChannelTest, NotImplemented)
 
 TEST (PluginRegistrarTest, PluginDestroyedBeforeRegistrar)
 
 TEST (PluginRegistrarTest, MessengerSend)
 
 TEST (PluginRegistrarTest, MessengerSetMessageHandler)
 
 TEST (PluginRegistrarTest, ManagerSameInstance)
 
 TEST (PluginRegistrarTest, ManagerDifferentInstances)
 
 TEST (PluginRegistrarTest, ManagerRemovesOnDestruction)
 
static void CheckEncodeDecode (const EncodableValue &value, const std::vector< uint8_t > &expected_encoding, const StandardCodecSerializer *serializer=nullptr, std::function< bool(const EncodableValue &a, const EncodableValue &b)> custom_comparator=nullptr)
 
static void CheckEncodeDecodeWithEncodePrefix (const EncodableValue &value, const std::vector< uint8_t > &expected_encoding_prefix, size_t expected_encoding_length)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeNull)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeTrue)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeFalse)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeInt32)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeInt64)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeDouble)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeString)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeStringWithNonAsciiCodePoint)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeStringWithNonBMPCodePoint)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeEmptyString)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeList)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeEmptyList)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeMap)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeByteArray)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeInt32Array)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeInt64Array)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeFloat64Array)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeSimpleCustomType)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeVariableLengthCustomType)
 
 TEST (StandardMethodCodec, HandlesMethodCallsWithNullArguments)
 
 TEST (StandardMethodCodec, HandlesMethodCallsWithArgument)
 
 TEST (StandardMethodCodec, HandlesSuccessEnvelopesWithNullResult)
 
 TEST (StandardMethodCodec, HandlesSuccessEnvelopesWithResult)
 
 TEST (StandardMethodCodec, HandlesErrorEnvelopesWithNulls)
 
 TEST (StandardMethodCodec, HandlesErrorEnvelopesWithDetails)
 
 TEST (StandardMethodCodec, HandlesCustomTypeArguments)
 
std::vector< std::string > GetSwitchesFromEnvironment ()
 
 TEST (FlutterProjectBundle, SwitchesEmpty)
 
 TEST (FlutterProjectBundle, Switches)
 
 TEST (FlutterProjectBundle, SwitchesExtraValues)
 
 TEST (FlutterProjectBundle, SwitchesMissingValues)
 
 TEST (JsonMessageCodec, EncodeDecode)
 
 TEST (JsonMethodCodec, HandlesMethodCallsWithNullArguments)
 
 TEST (JsonMethodCodec, HandlesMethodCallsWithArgument)
 
 TEST (JsonMethodCodec, HandlesSuccessEnvelopesWithNullResult)
 
 TEST (JsonMethodCodec, HandlesSuccessEnvelopesWithResult)
 
 TEST (JsonMethodCodec, HandlesErrorEnvelopesWithNulls)
 
 TEST (JsonMethodCodec, HandlesErrorEnvelopesWithDetails)
 
std::filesystem::path GetExecutableDirectory ()
 
 TEST (PathUtilsTest, ExecutableDirector)
 
 TEST (TextInputModel, SetText)
 
 TEST (TextInputModel, SetTextWideCharacters)
 
 TEST (TextInputModel, SetTextEmpty)
 
 TEST (TextInputModel, SetTextReplaceText)
 
 TEST (TextInputModel, SetTextResetsSelection)
 
 TEST (TextInputModel, SetSelectionStart)
 
 TEST (TextInputModel, SetSelectionComposingStart)
 
 TEST (TextInputModel, SetSelectionMiddle)
 
 TEST (TextInputModel, SetSelectionComposingMiddle)
 
 TEST (TextInputModel, SetSelectionEnd)
 
 TEST (TextInputModel, SetSelectionComposingEnd)
 
 TEST (TextInputModel, SetSelectionWthExtent)
 
 TEST (TextInputModel, SetSelectionWthExtentComposing)
 
 TEST (TextInputModel, SetSelectionReverseExtent)
 
 TEST (TextInputModel, SetSelectionReverseExtentComposing)
 
 TEST (TextInputModel, SetSelectionOutsideString)
 
 TEST (TextInputModel, SetSelectionOutsideComposingRange)
 
 TEST (TextInputModel, SetComposingRangeStart)
 
 TEST (TextInputModel, SetComposingRangeMiddle)
 
 TEST (TextInputModel, SetComposingRangeEnd)
 
 TEST (TextInputModel, SetComposingRangeWithExtent)
 
 TEST (TextInputModel, SetComposingRangeReverseExtent)
 
 TEST (TextInputModel, SetComposingRangeOutsideString)
 
 TEST (TextInputModel, CommitComposingNoTextWithNoSelection)
 
 TEST (TextInputModel, CommitComposingNoTextWithSelection)
 
 TEST (TextInputModel, CommitComposingTextWithNoSelection)
 
 TEST (TextInputModel, CommitComposingTextWithSelection)
 
 TEST (TextInputModel, UpdateComposingRemovesLastComposingCharacter)
 
 TEST (TextInputModel, AddCodePoint)
 
 TEST (TextInputModel, AddCodePointSelection)
 
 TEST (TextInputModel, AddCodePointReverseSelection)
 
 TEST (TextInputModel, AddCodePointSelectionWideCharacter)
 
 TEST (TextInputModel, AddCodePointReverseSelectionWideCharacter)
 
 TEST (TextInputModel, AddText)
 
 TEST (TextInputModel, AddTextSelection)
 
 TEST (TextInputModel, AddTextReverseSelection)
 
 TEST (TextInputModel, AddTextSelectionWideCharacter)
 
 TEST (TextInputModel, AddTextReverseSelectionWideCharacter)
 
 TEST (TextInputModel, DeleteStart)
 
 TEST (TextInputModel, DeleteMiddle)
 
 TEST (TextInputModel, DeleteEnd)
 
 TEST (TextInputModel, DeleteWideCharacters)
 
 TEST (TextInputModel, DeleteSelection)
 
 TEST (TextInputModel, DeleteReverseSelection)
 
 TEST (TextInputModel, DeleteStartComposing)
 
 TEST (TextInputModel, DeleteStartReverseComposing)
 
 TEST (TextInputModel, DeleteMiddleComposing)
 
 TEST (TextInputModel, DeleteMiddleReverseComposing)
 
 TEST (TextInputModel, DeleteEndComposing)
 
 TEST (TextInputModel, DeleteEndReverseComposing)
 
 TEST (TextInputModel, DeleteSurroundingAtCursor)
 
 TEST (TextInputModel, DeleteSurroundingAtCursorComposing)
 
 TEST (TextInputModel, DeleteSurroundingAtCursorAll)
 
 TEST (TextInputModel, DeleteSurroundingAtCursorAllComposing)
 
 TEST (TextInputModel, DeleteSurroundingAtCursorGreedy)
 
 TEST (TextInputModel, DeleteSurroundingAtCursorGreedyComposing)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursor)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursorComposing)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursorAll)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursorAllComposing)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursorGreedy)
 
 TEST (TextInputModel, DeleteSurroundingBeforeCursorGreedyComposing)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursor)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursorComposing)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursorAll)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursorAllComposing)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursorGreedy)
 
 TEST (TextInputModel, DeleteSurroundingAfterCursorGreedyComposing)
 
 TEST (TextInputModel, DeleteSurroundingSelection)
 
 TEST (TextInputModel, DeleteSurroundingReverseSelection)
 
 TEST (TextInputModel, BackspaceStart)
 
 TEST (TextInputModel, BackspaceMiddle)
 
 TEST (TextInputModel, BackspaceEnd)
 
 TEST (TextInputModel, BackspaceWideCharacters)
 
 TEST (TextInputModel, BackspaceSelection)
 
 TEST (TextInputModel, BackspaceReverseSelection)
 
 TEST (TextInputModel, BackspaceStartComposing)
 
 TEST (TextInputModel, BackspaceStartReverseComposing)
 
 TEST (TextInputModel, BackspaceMiddleComposing)
 
 TEST (TextInputModel, BackspaceMiddleReverseComposing)
 
 TEST (TextInputModel, BackspaceEndComposing)
 
 TEST (TextInputModel, BackspaceEndReverseComposing)
 
 TEST (TextInputModel, MoveCursorForwardStart)
 
 TEST (TextInputModel, MoveCursorForwardMiddle)
 
 TEST (TextInputModel, MoveCursorForwardEnd)
 
 TEST (TextInputModel, MoveCursorForwardWideCharacters)
 
 TEST (TextInputModel, MoveCursorForwardSelection)
 
 TEST (TextInputModel, MoveCursorForwardReverseSelection)
 
 TEST (TextInputModel, MoveCursorForwardStartComposing)
 
 TEST (TextInputModel, MoveCursorForwardStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorForwardMiddleComposing)
 
 TEST (TextInputModel, MoveCursorForwardMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorForwardEndComposing)
 
 TEST (TextInputModel, MoveCursorForwardEndReverseComposing)
 
 TEST (TextInputModel, MoveCursorBackStart)
 
 TEST (TextInputModel, MoveCursorBackMiddle)
 
 TEST (TextInputModel, MoveCursorBackEnd)
 
 TEST (TextInputModel, MoveCursorBackWideCharacters)
 
 TEST (TextInputModel, MoveCursorBackSelection)
 
 TEST (TextInputModel, MoveCursorBackReverseSelection)
 
 TEST (TextInputModel, MoveCursorBackStartComposing)
 
 TEST (TextInputModel, MoveCursorBackStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorBackMiddleComposing)
 
 TEST (TextInputModel, MoveCursorBackMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorBackEndComposing)
 
 TEST (TextInputModel, MoveCursorBackEndReverseComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningStart)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddle)
 
 TEST (TextInputModel, MoveCursorToBeginningEnd)
 
 TEST (TextInputModel, MoveCursorToBeginningSelection)
 
 TEST (TextInputModel, MoveCursorToBeginningReverseSelection)
 
 TEST (TextInputModel, MoveCursorToBeginningStartComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddleComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningEndComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningEndReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndStart)
 
 TEST (TextInputModel, MoveCursorToEndMiddle)
 
 TEST (TextInputModel, MoveCursorToEndEnd)
 
 TEST (TextInputModel, MoveCursorToEndSelection)
 
 TEST (TextInputModel, MoveCursorToEndReverseSelection)
 
 TEST (TextInputModel, MoveCursorToEndStartComposing)
 
 TEST (TextInputModel, MoveCursorToEndStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndMiddleComposing)
 
 TEST (TextInputModel, MoveCursorToEndMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndEndComposing)
 
 TEST (TextInputModel, MoveCursorToEndEndReverseComposing)
 
 TEST (TextInputModel, GetCursorOffset)
 
 TEST (TextInputModel, GetCursorOffsetSelection)
 
 TEST (TextInputModel, GetCursorOffsetReverseSelection)
 
 TEST (TextRange, TextRangeFromPositionZero)
 
 TEST (TextRange, TextRangeFromPositionNonZero)
 
 TEST (TextRange, TextRangeFromRange)
 
 TEST (TextRange, TextRangeFromReversedRange)
 
 TEST (TextRange, SetBase)
 
 TEST (TextRange, SetBaseReversed)
 
 TEST (TextRange, SetExtent)
 
 TEST (TextRange, SetExtentReversed)
 
 TEST (TextRange, SetStart)
 
 TEST (TextRange, SetStartReversed)
 
 TEST (TextRange, SetEnd)
 
 TEST (TextRange, SetEndReversed)
 
 TEST (TextRange, ContainsPreStartPosition)
 
 TEST (TextRange, ContainsStartPosition)
 
 TEST (TextRange, ContainsMiddlePosition)
 
 TEST (TextRange, ContainsEndPosition)
 
 TEST (TextRange, ContainsPostEndPosition)
 
 TEST (TextRange, ContainsPreStartPositionReversed)
 
 TEST (TextRange, ContainsStartPositionReversed)
 
 TEST (TextRange, ContainsMiddlePositionReversed)
 
 TEST (TextRange, ContainsEndPositionReversed)
 
 TEST (TextRange, ContainsPostEndPositionReversed)
 
 TEST (TextRange, ContainsRangePreStartPosition)
 
 TEST (TextRange, ContainsRangeSpanningStartPosition)
 
 TEST (TextRange, ContainsRangeStartPosition)
 
 TEST (TextRange, ContainsRangeMiddlePosition)
 
 TEST (TextRange, ContainsRangeEndPosition)
 
 TEST (TextRange, ContainsRangeSpanningEndPosition)
 
 TEST (TextRange, ContainsRangePostEndPosition)
 
 TEST (TextRange, ContainsRangePreStartPositionReversed)
 
 TEST (TextRange, ContainsRangeSpanningStartPositionReversed)
 
 TEST (TextRange, ContainsRangeStartPositionReversed)
 
 TEST (TextRange, ContainsRangeMiddlePositionReversed)
 
 TEST (TextRange, ContainsRangeSpanningEndPositionReversed)
 
 TEST (TextRange, ContainsRangeEndPositionReversed)
 
 TEST (TextRange, ContainsRangePostEndPositionReversed)
 
 TEST (TextRange, ReversedForwardRange)
 
 TEST (TextRange, ReversedCollapsedRange)
 
 TEST (TextRange, ReversedReversedRange)
 
std::vector< uint8_t > GetVectorFromNSData (NSData *data)
 
NSData * GetNSDataFromVector (const std::vector< uint8_t > &buffer)
 
std::unique_ptr< fml::MappingGetMappingFromNSData (NSData *data)
 
NSData * GetNSDataFromMapping (std::unique_ptr< fml::Mapping > mapping)
 
fml::CommandLine CommandLineFromNSProcessInfo ()
 
FlutterStandardField FlutterStandardFieldForDataType (FlutterStandardDataType type)
 
FlutterStandardDataType FlutterStandardDataTypeForField (FlutterStandardField field)
 
UInt8 elementSizeForFlutterStandardDataType (FlutterStandardDataType type)
 
static void ReplaceSemanticsObject (SemanticsObject *oldObject, SemanticsObject *newObject, NSMutableDictionary< NSNumber *, SemanticsObject *> *objects)
 
static SemanticsObjectCreateObject (const flutter::SemanticsNode &node, fml::WeakPtr< AccessibilityBridge > weak_ptr)
 
static bool DidFlagChange (const flutter::SemanticsNode &oldNode, const flutter::SemanticsNode &newNode, SemanticsFlags flag)
 
CATransform3D GetCATransform3DFromSkMatrix (const SkMatrix &matrix)
 
void ResetAnchor (CALayer *layer)
 
static GrContextOptions CreateMetalGrContextOptions ()
 
bool IsIosEmbeddedViewsPreviewEnabled ()
 
static IOSContextGLCastToGLContext (const std::shared_ptr< IOSContext > &context)
 
static IOSContextMetalCastToMetalContext (const std::shared_ptr< IOSContext > &context)
 
IOSRenderingAPI GetRenderingAPIForProcess (bool force_software)
 
Class GetCoreAnimationLayerClassForRenderingAPI (IOSRenderingAPI rendering_api)
 
static SkISize TransformedSurfaceSize (const SkISize &size, const SkMatrix &transformation)
 
static FlutterBackingStoreConfig MakeBackingStoreConfig (const SkISize &backing_store_size)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (double opacity)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const SkRect &rect)
 
static FlutterSize VectorToSize (const SkVector &vector)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const SkRRect &rrect)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const SkMatrix &matrix)
 
static std::pair< bool, fml::RefPtr< EmbedderTaskRunner > > CreateEmbedderTaskRunner (const FlutterTaskRunnerDescription *description)
 Attempts to create a task runner from an embedder task runner description. The first boolean in the pair indicate whether the embedder specified an invalid task runner description. In this case, engine launch must be aborted. If the embedder did not specify any task runner, an engine managed task runner and thread must be selected instead. More...
 
static fml::RefPtr< fml::TaskRunnerGetCurrentThreadTaskRunner ()
 
 TEST (FlutterEngineTest, CreateDestroy)
 
 TEST (FlutterEngineTest, ExplicitShutDown)
 
 TEST (FlutterEngineTest, RunloopTimeoutTranslation)
 
 TEST (FlutterViewControllerTest, CreateDestroy)
 
 TEST (FlutterWindowTest, SetSizeLimits)
 
 TEST (PluginRegistrarGlfwTest, GetView)
 
 TEST (PluginRegistrarGlfwTest, PluginDestroyedBeforeRegistrar)
 
 TEST_F (DartProjectTest, StandardProjectFormat)
 
 TEST (FlutterEngineTest, ProcessMessages)
 
 TEST (FlutterEngineTest, ReloadFonts)
 
 TEST (FlutterEngineTest, GetMessenger)
 
 TEST (FlutterViewControllerTest, GetEngine)
 
 TEST (FlutterViewControllerTest, GetView)
 
 TEST (FlutterViewTest, HwndAccessPassesThrough)
 
 TEST (PluginRegistrarWindowsTest, GetView)
 
 TEST (PluginRegistrarWindowsTest, PluginDestroyedBeforeRegistrar)
 
 TEST (PluginRegistrarWindowsTest, RegisterUnregister)
 
 TEST (PluginRegistrarWindowsTest, CallsRegisteredDelegates)
 
 TEST (PluginRegistrarWindowsTest, StopsOnceHandled)
 
std::string Utf8FromUtf16 (const std::wstring &utf16_string)
 
std::wstring Utf16FromUtf8 (const std::string &utf8_string)
 
std::vector< LanguageInfoGetPreferredLanguageInfo ()
 
std::vector< std::wstring > GetPreferredLanguages ()
 
LanguageInfo ParseLanguageName (std::wstring language_name)
 
UINT GetDpiForHWND (HWND hwnd)
 
UINT GetDpiForMonitor (HMONITOR monitor)
 
static uint64_t ConvertWinButtonToFlutterButton (UINT button)
 
static void UnblockSIGPROF ()
 
int RunTester (const flutter::Settings &settings, bool run_forever, bool multithreaded)
 
const char * GetFlutterEngineVersion ()
 
const char * GetSkiaVersion ()
 
const char * GetDartVersion ()
 

Variables

constexpr double kMegaByteSizeInBytes = (1 << 20)
 
static std::string gGoldenDir
 
static std::string gFontFile
 
static const size_t kMaxSamples = 120
 
static const size_t kMaxFrameMarkers = 8
 
static constexpr SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F)
 
const int kDisplayRasterizerStatistics = 1 << 0
 
const int kVisualizeRasterizerStatistics = 1 << 1
 
const int kDisplayEngineStatistics = 1 << 2
 
const int kVisualizeEngineStatistics = 1 << 3
 
const SkScalar kLightHeight = 600
 
const SkScalar kLightRadius = 800
 
constexpr float kOneMinusEpsilon = 1 - FLT_EPSILON
 
constexpr float kScenicZElevationBetweenLayers = 10.f
 
static const tonic::DartWrapperInfo kDartWrapperInfo_ui_Image
 
static const int kSkMatrixIndexToMatrix4Index []
 
constexpr int kIsAntiAliasIndex = 0
 
constexpr int kColorIndex = 1
 
constexpr int kBlendModeIndex = 2
 
constexpr int kStyleIndex = 3
 
constexpr int kStrokeWidthIndex = 4
 
constexpr int kStrokeCapIndex = 5
 
constexpr int kStrokeJoinIndex = 6
 
constexpr int kStrokeMiterLimitIndex = 7
 
constexpr int kFilterQualityIndex = 8
 
constexpr int kMaskFilterIndex = 9
 
constexpr int kMaskFilterBlurStyleIndex = 10
 
constexpr int kMaskFilterSigmaIndex = 11
 
constexpr int kInvertColorIndex = 12
 
constexpr int kDitherIndex = 13
 
constexpr size_t kDataByteCount = 56
 
constexpr int kShaderIndex = 0
 
constexpr int kColorFilterIndex = 1
 
constexpr int kImageFilterIndex = 2
 
constexpr int kObjectCount = 3
 
constexpr uint32_t kColorDefault = 0xFF000000
 
constexpr uint32_t kBlendModeDefault
 
constexpr double kStrokeMiterLimitDefault = 4.0
 
constexpr float invert_colors [20]
 
static const char * kHandleKey = "handle"
 
static const char * kRepresentationKey = "representation"
 
static const char * kNameKey = "name"
 
static const char * kClassNameKey = "class_name"
 
static const char * kLibraryPathKey = "library_path"
 
static const char * kCacheName = "flutter_callback_cache.json"
 
constexpr int32_t kMinPlatformViewId = -1
 
const int kScrollableSemanticsActions
 
const int kScrollableSemanticsFlags
 
static constexpr int kPointerDataFieldCount = 29
 
static constexpr int kBytesPerField = sizeof(int64_t)
 
static const char * kDartLanguageArgs []
 
static const char * kDartPrecompilationArgs []
 
static FML_ALLOW_UNUSED_TYPE const char * kDartWriteProtectCodeArgs []
 
static FML_ALLOW_UNUSED_TYPE const char * kDartDisableIntegerDivisionArgs []
 
static const char * kDartAssertArgs []
 
static const char * kDartStartPausedArgs []
 
static const char * kDartDisableServiceAuthCodesArgs []
 
static const char * kDartTraceStartupArgs []
 
static const char * kDartEndlessTraceBufferArgs []
 
static const char * kDartSystraceTraceBufferArgs []
 
static const char *kDartFuchsiaTraceArgs [] FML_ALLOW_UNUSED_TYPE
 
static const char * kDartTraceStreamsArgs []
 
constexpr char kFileUriPrefix [] = "file://"
 
constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1
 
static const char kStdoutStreamId [] = "Stdout"
 
static const char kStderrStreamId [] = "Stderr"
 
static std::atomic_size_t gVMLaunchCount
 
static std::mutex gVMMutex
 
static std::weak_ptr< DartVMgVM
 
static std::shared_ptr< DartVM > * gVMLeak
 
static std::mutex gVMDependentsMutex
 
static std::weak_ptr< const DartVMDatagVMData
 
static std::weak_ptr< ServiceProtocolgVMServiceProtocol
 
static std::weak_ptr< IsolateNameServergVMIsolateNameServer
 
static constexpr std::string_view kViewIdPrefx = "_flutterView/"
 
static constexpr std::string_view kListViewsExtensionName
 
static constexpr double kUnknownDisplayRefreshRate = 0
 To be used when the display refresh rate is unknown. More...
 
static constexpr char kAssetChannel [] = "flutter/assets"
 
static constexpr char kLifecycleChannel [] = "flutter/lifecycle"
 
static constexpr char kNavigationChannel [] = "flutter/navigation"
 
static constexpr char kLocalizationChannel [] = "flutter/localization"
 
static constexpr char kSettingsChannel [] = "flutter/settings"
 
static constexpr char kIsolateChannel [] = "flutter/isolate"
 
constexpr char kSkiaChannel [] = "flutter/skia"
 
constexpr char kSystemChannel [] = "flutter/system"
 
constexpr char kTypeKey [] = "type"
 
constexpr char kFontChange [] = "fontsChange"
 
enum flutter::DartErrorCode __attribute__
 
DEF_SWITCHES_START snapshot asset path
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotData
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot instr
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol prefix
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart flags
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory port
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory publication
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication enable dart profiling
 
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication enable dart Enable Dart profiling Profiling information can be viewed from the observatory enable software rendering
 
static constexpr const char * kVsyncFlowName = "VsyncFlow"
 
static constexpr const char * kVsyncTraceName = "VsyncProcessCallback"
 
static const int kGrCacheMaxCount = 8192
 
static const size_t kGrCacheMaxByteSize = 24 * (1 << 20)
 
const uint8_t kPlatformStrongDill []
 
const intptr_t kPlatformStrongDillSize
 
static std::unique_ptr< FlutterMaing_flutter_main
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_callback_info_class
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_jni_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_texture_wrapper_class = nullptr
 
static jmethodID g_flutter_callback_info_constructor = nullptr
 
static jmethodID g_handle_platform_message_method = nullptr
 
static jmethodID g_handle_platform_message_response_method = nullptr
 
static jmethodID g_update_semantics_method = nullptr
 
static jmethodID g_update_custom_accessibility_actions_method = nullptr
 
static jmethodID g_on_first_frame_method = nullptr
 
static jmethodID g_on_engine_restart_method = nullptr
 
static jmethodID g_create_overlay_surface_method = nullptr
 
static jmethodID g_destroy_overlay_surfaces_method = nullptr
 
static jmethodID g_on_begin_frame_method = nullptr
 
static jmethodID g_on_end_frame_method = nullptr
 
static jmethodID g_attach_to_gl_context_method = nullptr
 
static jmethodID g_update_tex_image_method = nullptr
 
static jmethodID g_get_transform_matrix_method = nullptr
 
static jmethodID g_detach_from_gl_context_method = nullptr
 
static jmethodID g_compute_platform_resolved_locale_method = nullptr
 
static jmethodID g_on_display_platform_view_method = nullptr
 
static jmethodID g_on_display_overlay_surface_method = nullptr
 
static jmethodID g_overlay_surface_id_method = nullptr
 
static jmethodID g_overlay_surface_surface_method = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_mutators_stack_class = nullptr
 
static jmethodID g_mutators_stack_init_method = nullptr
 
static jmethodID g_mutators_stack_push_transform_method = nullptr
 
static jmethodID g_mutators_stack_push_cliprect_method = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_vsync_waiter_class = nullptr
 
static jmethodID g_async_wait_for_vsync_method_ = nullptr
 
const char *const kOrientationUpdateNotificationName
 
const char *const kOrientationUpdateNotificationKey
 
const char *const kOverlayStyleUpdateNotificationName
 
const char *const kOverlayStyleUpdateNotificationKey
 
constexpr const char * kFlutterThreadName = "io.flutter"
 
const int kShift = 1 << 0
 
const int kShiftLeft = 1 << 1
 
const int kShiftRight = 1 << 2
 
const int kControl = 1 << 3
 
const int kControlLeft = 1 << 4
 
const int kControlRight = 1 << 5
 
const int kAlt = 1 << 6
 
const int kAltLeft = 1 << 7
 
const int kAltRight = 1 << 8
 
const int kWinLeft = 1 << 9
 
const int kWinRight = 1 << 10
 
const int kCapsLock = 1 << 11
 
const int kNumLock = 1 << 12
 
const int kScrollLock = 1 << 13
 

Detailed Description

Note
Deprecated MOCK_METHOD macros used until this issue is resolved:

Typedef Documentation

◆ BinaryMessageHandler

typedef std::function< void(const uint8_t* message, size_t message_size, BinaryReply reply)> flutter::BinaryMessageHandler

Definition at line 24 of file binary_messenger.h.

◆ BinaryReply

typedef std::function<void(const uint8_t* reply, size_t reply_size)> flutter::BinaryReply

Definition at line 17 of file binary_messenger.h.

◆ ChildIsolatePreparer

Definition at line 20 of file dart_isolate_group_data.h.

◆ CustomAccessibilityActionUpdates

using flutter::CustomAccessibilityActionUpdates = typedef std::unordered_map<int32_t, CustomAccessibilityAction>

Definition at line 32 of file custom_accessibility_action.h.

◆ DisplayId

typedef uint64_t flutter::DisplayId

Unique ID per display that is stable until the Flutter application restarts. See also: flutter::Display

Definition at line 14 of file display.h.

◆ EGLResult

template<class T >
using flutter::EGLResult = typedef std::pair<bool, T>

Definition at line 16 of file android_context_gl.cc.

◆ EncodableList

using flutter::EncodableList = typedef std::vector<EncodableValue>

Definition at line 92 of file encodable_value.h.

◆ EncodableMap

Definition at line 93 of file encodable_value.h.

◆ FrameRasterizedCallback

Definition at line 60 of file settings.h.

◆ Gradient

Definition at line 15 of file gradient.cc.

◆ Image

Definition at line 15 of file image.cc.

◆ JavaWeakGlobalRef

using flutter::JavaWeakGlobalRef = typedef std::nullptr_t

Definition at line 25 of file platform_view_android_jni.h.

◆ LayerRasterCacheKey

using flutter::LayerRasterCacheKey = typedef RasterCacheKey<uint64_t>

Definition at line 58 of file raster_cache_key.h.

◆ MappingCallback

using flutter::MappingCallback = typedef std::function<std::unique_ptr<fml::Mapping>(void)>

Definition at line 56 of file settings.h.

◆ Mappings

using flutter::Mappings = typedef std::vector<std::unique_ptr<const fml::Mapping> >

Definition at line 57 of file settings.h.

◆ MappingsCallback

Definition at line 58 of file settings.h.

◆ MessageHandler

template<typename T >
using flutter::MessageHandler = typedef std::function<void(const T& message, const MessageReply<T>& reply)>

Definition at line 30 of file basic_message_channel.h.

◆ MessageReply

template<typename T >
using flutter::MessageReply = typedef std::function<void(const T& reply)>

Definition at line 22 of file basic_message_channel.h.

◆ MethodCallHandler

template<typename T >
using flutter::MethodCallHandler = typedef std::function<void(const MethodCall<T>& call, std::unique_ptr<MethodResult<T> > result)>

Definition at line 28 of file method_channel.h.

◆ Path

Definition at line 20 of file path.cc.

◆ PathMeasure

Definition at line 20 of file path_measure.cc.

◆ PictureRasterCacheKey

Definition at line 53 of file raster_cache_key.h.

◆ PointerDataDispatcherMaker

Signature for constructing PointerDataDispatcher.

Parameters
[in]delegatethe Flutter::Engine

Definition at line 172 of file pointer_data_dispatcher.h.

◆ ResultHandlerError

template<typename T >
using flutter::ResultHandlerError = typedef std::function<void(const std::string& error_code, const std::string& error_message, const T* error_details)>

Definition at line 23 of file method_result_functions.h.

◆ ResultHandlerNotImplemented

template<typename T >
using flutter::ResultHandlerNotImplemented = typedef std::function<void()>

Definition at line 25 of file method_result_functions.h.

◆ ResultHandlerSuccess

template<typename T >
using flutter::ResultHandlerSuccess = typedef std::function<void(const T* result)>

Definition at line 19 of file method_result_functions.h.

◆ Sampler

Sampler is run during SamplingProfiler::SampleRepeatedly. Each platform should implement its version of a Sampler if they decide to participate in gathering profiling metrics.

See also
flutter::SamplingProfiler::SampleRepeatedly

Definition at line 72 of file sampling_profiler.h.

◆ SemanticsNodeUpdates

using flutter::SemanticsNodeUpdates = typedef std::unordered_map<int32_t, SemanticsNode>

Definition at line 133 of file semantics_node.h.

◆ StreamHandlerCancel

template<typename T >
using flutter::StreamHandlerCancel = typedef std::function<std::unique_ptr<StreamHandlerError<T> >(const T* arguments)>

Definition at line 27 of file event_stream_handler_functions.h.

◆ StreamHandlerListen

template<typename T >
using flutter::StreamHandlerListen = typedef std::function<std::unique_ptr<StreamHandlerError<T> >( const T* arguments, std::unique_ptr<EventSink<T> >&& events)>

Definition at line 23 of file event_stream_handler_functions.h.

◆ TaskObserverAdd

using flutter::TaskObserverAdd = typedef std::function<void(intptr_t , fml::closure )>

Definition at line 48 of file settings.h.

◆ TaskObserverRemove

using flutter::TaskObserverRemove = typedef std::function<void(intptr_t )>

Definition at line 49 of file settings.h.

◆ UnhandledExceptionCallback

using flutter::UnhandledExceptionCallback = typedef std::function<bool(const std::string& , const std::string& )>

Definition at line 52 of file settings.h.

◆ UniqueAotDataPtr

Definition at line 22 of file flutter_project_bundle.h.

◆ WindowProcDelegate

using flutter::WindowProcDelegate = typedef std::function<std::optional< LRESULT>(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)>

Definition at line 24 of file plugin_registrar_windows.h.

◆ WindowsRenderTarget

using flutter::WindowsRenderTarget = typedef std::variant< HWND>

Definition at line 27 of file window_binding_handler.h.

Enumeration Type Documentation

◆ AccessibilityFeatureFlag

enum flutter::AccessibilityFeatureFlag : int32_t
strong

An enum for defining the different kinds of accessibility features that can be enabled by the platform.

Must match the AccessibilityFeatureFlag enum in framework.

Enumerator
kAccessibleNavigation 
kInvertColors 
kDisableAnimations 
kBoldText 
kReduceMotion 
kHighContrast 

Definition at line 30 of file platform_configuration.h.

◆ AndroidRenderingAPI

Enumerator
kSoftware 
kOpenGLES 
kVulkan 

Definition at line 12 of file android_context.h.

◆ Clip

Enumerator
none 
hardEdge 
antiAlias 
antiAliasWithSaveLayer 

Definition at line 41 of file layer.h.

◆ DartErrorCode

Error exit codes for the Dart isolate.

Enumerator
NoError 

No error has occurred.

ApiError 

The Dart error code for an API error.

CompilationError 

The Dart error code for a compilation error.

UnknownError 

The Dart error code for an unkonwn error.

Definition at line 43 of file shell.h.

43  {
44  /// No error has occurred.
45  NoError = 0,
46  /// The Dart error code for an API error.
47  ApiError = 253,
48  /// The Dart error code for a compilation error.
49  CompilationError = 254,
50  /// The Dart error code for an unkonwn error.
51  UnknownError = 255
52 };
The Dart error code for an API error.
The Dart error code for an unkonwn error.
The Dart error code for a compilation error.
No error has occurred.

◆ DisplayUpdateType

The update type parameter that is passed to DisplayManager::HandleDisplayUpdates.

Enumerator
kStartup 

flutter::Displays that were active during start-up. A display is considered active if:

  1. The frame buffer hardware is connected.
  2. The display is drawable, e.g. it isn't being mirrored from another connected display or sleeping.

Definition at line 17 of file display_manager.h.

17  {
18  /// `flutter::Display`s that were active during start-up. A display is
19  /// considered active if:
20  /// 1. The frame buffer hardware is connected.
21  /// 2. The display is drawable, e.g. it isn't being mirrored from another
22  /// connected display or sleeping.
23  kStartup
24 };

◆ IOSRenderingAPI

Enumerator
kSoftware 
kOpenGLES 
kMetal 

Definition at line 14 of file rendering_api_selection.h.

◆ MaskFilterType

Enumerator
Null 
Blur 

Definition at line 66 of file paint.cc.

66 { Null, Blur };

◆ MutatorType

Enumerator
clip_rect 
clip_rrect 
clip_path 
transform 
opacity 

Definition at line 24 of file embedded_views.h.

◆ PipelineConsumeResult

◆ PointerButtonMouse

Enumerator
kPointerButtonMousePrimary 
kPointerButtonMouseSecondary 
kPointerButtonMouseMiddle 
kPointerButtonMouseBack 
kPointerButtonMouseForward 

Definition at line 16 of file pointer_data.h.

◆ PointerButtonStylus

Enumerator
kPointerButtonStylusContact 
kPointerButtonStylusPrimary 
kPointerButtonStylusSecondary 

Definition at line 28 of file pointer_data.h.

◆ PointerButtonTouch

Enumerator
kPointerButtonTouchContact 

Definition at line 24 of file pointer_data.h.

24  : int64_t {
26 };

◆ PostPrerollResult

Enumerator
kSuccess 
kResubmitFrame 
kSkipAndRetryFrame 

Definition at line 245 of file embedded_views.h.

245  {
246  // Frame has successfully rasterized.
247  kSuccess,
248  // Frame is submitted twice. This is currently only used when
249  // thread configuration change occurs.
251  // Frame is dropped and a new frame with the same layer tree is
252  // attempted. This is currently only used when thread configuration
253  // change occurs.
255 };

◆ RasterStatus

enum flutter::RasterStatus
strong
Enumerator
kSuccess 
kResubmit 
kSkipAndRetry 
kEnqueuePipeline 
kFailed 
kDiscarded 

Definition at line 24 of file compositor_context.h.

24  {
25  // Frame has successfully rasterized.
26  kSuccess,
27  // Frame is submitted twice. This is only used on Android when
28  // switching the background surface to FlutterImageView.
29  //
30  // On Android, the first frame doesn't make the image available
31  // to the ImageReader right away. The second frame does.
32  //
33  // TODO(egarciad): https://github.com/flutter/flutter/issues/65652
34  kResubmit,
35  // Frame is dropped and a new frame with the same layer tree is
36  // attempted.
37  //
38  // This is currently used to wait for the thread merger to merge
39  // the raster and platform threads.
40  //
41  // Since the thread merger may be disabled,
43  // Frame has been successfully rasterized, but "there are additional items in
44  // the pipeline waiting to be consumed. This is currently
45  // only used when thread configuration change occurs.
47  // Failed to rasterize the frame.
48  kFailed,
49  // Layer tree was discarded due to LayerTreeDiscardCallback
51 };

◆ SemanticsAction

enum flutter::SemanticsAction : int32_t
strong
Enumerator
kTap 
kLongPress 
kScrollLeft 
kScrollRight 
kScrollUp 
kScrollDown 
kIncrease 
kDecrease 
kShowOnScreen 
kMoveCursorForwardByCharacter 
kMoveCursorBackwardByCharacter 
kSetSelection 
kCopy 
kCut 
kPaste 
kDidGainAccessibilityFocus 
kDidLoseAccessibilityFocus 
kCustomAction 
kDismiss 
kMoveCursorForwardByWordIndex 
kMoveCursorBackwardByWordIndex 

Definition at line 20 of file semantics_node.h.

20  : int32_t {
21  kTap = 1 << 0,
22  kLongPress = 1 << 1,
23  kScrollLeft = 1 << 2,
24  kScrollRight = 1 << 3,
25  kScrollUp = 1 << 4,
26  kScrollDown = 1 << 5,
27  kIncrease = 1 << 6,
28  kDecrease = 1 << 7,
29  kShowOnScreen = 1 << 8,
32  kSetSelection = 1 << 11,
33  kCopy = 1 << 12,
34  kCut = 1 << 13,
35  kPaste = 1 << 14,
38  kCustomAction = 1 << 17,
39  kDismiss = 1 << 18,
42 };

◆ SemanticsFlags

enum flutter::SemanticsFlags : int32_t
strong

C/C++ representation of SemanticsFlags defined in lib/ui/semantics.dart.

Warning
This must match the SemanticsFlags enum in lib/ui/semantics.dart. See also:
Enumerator
kHasCheckedState 
kIsChecked 
kIsSelected 
kIsButton 
kIsTextField 
kIsFocused 
kHasEnabledState 
kIsEnabled 
kIsInMutuallyExclusiveGroup 
kIsHeader 
kIsObscured 
kScopesRoute 
kNamesRoute 
kIsHidden 
kIsImage 
kIsLiveRegion 
kHasToggledState 
kIsToggled 
kHasImplicitScrolling 
kIsReadOnly 
kIsFocusable 
kIsLink 
kIsSlider 

Definition at line 56 of file semantics_node.h.

56  : int32_t {
57  kHasCheckedState = 1 << 0,
58  kIsChecked = 1 << 1,
59  kIsSelected = 1 << 2,
60  kIsButton = 1 << 3,
61  kIsTextField = 1 << 4,
62  kIsFocused = 1 << 5,
63  kHasEnabledState = 1 << 6,
64  kIsEnabled = 1 << 7,
66  kIsHeader = 1 << 9,
67  kIsObscured = 1 << 10,
68  kScopesRoute = 1 << 11,
69  kNamesRoute = 1 << 12,
70  kIsHidden = 1 << 13,
71  kIsImage = 1 << 14,
72  kIsLiveRegion = 1 << 15,
73  kHasToggledState = 1 << 16,
74  kIsToggled = 1 << 17,
75  kHasImplicitScrolling = 1 << 18,
76  // The Dart API defines the following flag but it isn't used in iOS.
77  // kIsMultiline = 1 << 19,
78  kIsReadOnly = 1 << 20,
79  kIsFocusable = 1 << 21,
80  kIsLink = 1 << 22,
81  kIsSlider = 1 << 23,
82 };

◆ TextDirection

Enumerator
rtl 
ltr 

Definition at line 14 of file text_box.h.

◆ TracingResult

Enumerator
kNotAttempted 
kEnabled 
kNotNecessary 
kDisabled 

Definition at line 17 of file ptrace_check.h.

Function Documentation

◆ __attribute__()

struct flutter::ImageMetaData flutter::__attribute__ ( (packed)  )

◆ _ComputePlatformResolvedLocale()

static void flutter::_ComputePlatformResolvedLocale ( Dart_NativeArguments  args)
static

Definition at line 410 of file platform_configuration.cc.

References ComputePlatformResolvedLocale(), and flutter::UIDartState::ThrowIfUIOperationsProhibited().

Referenced by flutter::PlatformConfiguration::RegisterNatives().

410  {
411  UIDartState::ThrowIfUIOperationsProhibited();
412  Dart_Handle result =
413  ComputePlatformResolvedLocale(Dart_GetNativeArgument(args, 1));
414  Dart_SetReturnValue(args, result);
415 }
G_BEGIN_DECLS FlValue * args
Dart_Handle ComputePlatformResolvedLocale(Dart_Handle supportedLocalesHandle)

◆ AttachJNI()

static jlong flutter::AttachJNI ( JNIEnv *  env,
jclass  clazz,
jobject  flutterJNI,
jboolean  is_background_view 
)
static

Definition at line 121 of file platform_view_android_jni_impl.cc.

References flutter::FlutterMain::Get(), and flutter::FlutterMain::GetSettings().

Referenced by RegisterApi().

124  {
125  fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterJNI);
126  std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
127  std::make_shared<PlatformViewAndroidJNIImpl>(java_object);
128  auto shell_holder = std::make_unique<AndroidShellHolder>(
129  FlutterMain::Get().GetSettings(), jni_facade, is_background_view);
130  if (shell_holder->IsValid()) {
131  return reinterpret_cast<jlong>(shell_holder.release());
132  } else {
133  return 0;
134  }
135 }

◆ BENCHMARK() [1/3]

◆ BENCHMARK() [2/3]

flutter::BENCHMARK ( BM_ShellShutdown  )

◆ BENCHMARK() [3/3]

flutter::BENCHMARK ( BM_ShellInitializationAndShutdown  )

◆ BM_PlatformMessageResponseDartComplete()

static void flutter::BM_PlatformMessageResponseDartComplete ( benchmark::State &  state)
static

Definition at line 21 of file ui_benchmarks.cc.

References BENCHMARK(), flutter::DartVMRef::Create(), flutter::testing::FixtureTest::CreateSettingsForFixture(), FML_CHECK, flutter::testing::GetFixturesPath(), flutter::ThreadHost::io_thread, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, flutter::testing::RunDartCodeInIsolate(), and flutter::ThreadHost::ui_thread.

22  { // NOLINT
23  ThreadHost thread_host("test",
24  ThreadHost::Type::Platform | ThreadHost::Type::GPU |
25  ThreadHost::Type::IO | ThreadHost::Type::UI);
26  TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
27  thread_host.raster_thread->GetTaskRunner(),
28  thread_host.ui_thread->GetTaskRunner(),
29  thread_host.io_thread->GetTaskRunner());
30  Fixture fixture;
31  auto settings = fixture.CreateSettingsForFixture();
32  auto vm_ref = DartVMRef::Create(settings);
33  auto isolate =
34  testing::RunDartCodeInIsolate(vm_ref, settings, task_runners, "main", {},
36 
37  while (state.KeepRunning()) {
38  state.PauseTiming();
39  bool successful = isolate->RunInIsolateScope([&]() -> bool {
40  // Simulate a message of 3 MB
41  std::vector<uint8_t> data(3 << 20, 0);
42  std::unique_ptr<fml::Mapping> mapping =
43  std::make_unique<fml::DataMapping>(data);
44 
45  Dart_Handle library = Dart_RootLibrary();
46  Dart_Handle closure =
47  Dart_GetField(library, Dart_NewStringFromCString("messageCallback"));
48 
49  auto message = fml::MakeRefCounted<PlatformMessageResponseDart>(
50  tonic::DartPersistentValue(isolate->get(), closure),
51  thread_host.ui_thread->GetTaskRunner());
52 
53  message->Complete(std::move(mapping));
54 
55  return true;
56  });
57  FML_CHECK(successful);
58  state.ResumeTiming();
59 
60  // We skip timing everything above because the copy triggered by
61  // message->Complete is a task posted on the UI thread. The following wait
62  // for a UI task would let us know when that copy is done.
63  std::promise<bool> completed;
64  task_runners.GetUITaskRunner()->PostTask(
65  [&completed] { completed.set_value(true); });
66  completed.get_future().wait();
67  }
68 }
std::function< void()> closure
Definition: closure.h:14
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
#define FML_CHECK(condition)
Definition: logging.h:68
std::unique_ptr< AutoIsolateShutdown > RunDartCodeInIsolate(DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &fixtures_path, fml::WeakPtr< IOManager > io_manager)

◆ BM_ShellInitialization()

static void flutter::BM_ShellInitialization ( benchmark::State &  state)
static

Definition at line 98 of file shell_benchmarks.cc.

References BENCHMARK(), and StartupAndShutdownShell().

98  {
99  while (state.KeepRunning()) {
100  StartupAndShutdownShell(state, true, false);
101  }
102 }
static void StartupAndShutdownShell(benchmark::State &state, bool measure_startup, bool measure_shutdown)

◆ BM_ShellInitializationAndShutdown()

static void flutter::BM_ShellInitializationAndShutdown ( benchmark::State &  state)
static

Definition at line 114 of file shell_benchmarks.cc.

References BENCHMARK(), and StartupAndShutdownShell().

114  {
115  while (state.KeepRunning()) {
116  StartupAndShutdownShell(state, true, true);
117  }
118 }
static void StartupAndShutdownShell(benchmark::State &state, bool measure_startup, bool measure_shutdown)

◆ BM_ShellShutdown()

static void flutter::BM_ShellShutdown ( benchmark::State &  state)
static

Definition at line 106 of file shell_benchmarks.cc.

References BENCHMARK(), and StartupAndShutdownShell().

106  {
107  while (state.KeepRunning()) {
108  StartupAndShutdownShell(state, false, true);
109  }
110 }
static void StartupAndShutdownShell(benchmark::State &state, bool measure_startup, bool measure_shutdown)

◆ BUILTIN_NATIVE_LIST()

flutter::BUILTIN_NATIVE_LIST ( DECLARE_FUNCTION  )

◆ CanRasterizePicture()

static bool flutter::CanRasterizePicture ( SkPicture *  picture)
static

Definition at line 44 of file raster_cache.cc.

Referenced by IsPictureWorthRasterizing().

44  {
45  if (picture == nullptr) {
46  return false;
47  }
48 
49  const SkRect cull_rect = picture->cullRect();
50 
51  if (cull_rect.isEmpty()) {
52  // No point in ever rasterizing an empty picture.
53  return false;
54  }
55 
56  if (!cull_rect.isFinite()) {
57  // Cannot attempt to rasterize into an infinitely large surface.
58  return false;
59  }
60 
61  return true;
62 }

◆ Canvas_constructor()

static void flutter::Canvas_constructor ( Dart_NativeArguments  args)
static

Definition at line 27 of file canvas.cc.

References flutter::Canvas::Create(), tonic::DartCallConstructor(), IMPLEMENT_WRAPPERTYPEINFO(), and flutter::UIDartState::ThrowIfUIOperationsProhibited().

Referenced by flutter::Canvas::RegisterNatives().

27  {
28  UIDartState::ThrowIfUIOperationsProhibited();
29  DartCallConstructor(&Canvas::Create, args);
30 }
G_BEGIN_DECLS FlValue * args
void DartCallConstructor(Sig func, Dart_NativeArguments args)
Definition: dart_args.h:218

◆ CastToGLContext()

static IOSContextGL* flutter::CastToGLContext ( const std::shared_ptr< IOSContext > &  context)
static

Definition at line 13 of file ios_surface_gl.mm.

Referenced by flutter::IOSSurfaceGL::IOSSurfaceGL().

13  {
14  return reinterpret_cast<IOSContextGL*>(context.get());
15 }

◆ CastToMetalContext()

static IOSContextMetal* flutter::CastToMetalContext ( const std::shared_ptr< IOSContext > &  context)
static

Definition at line 12 of file ios_surface_metal.mm.

Referenced by flutter::IOSSurfaceMetal::IOSSurfaceMetal().

12  {
13  return reinterpret_cast<IOSContextMetal*>(context.get());
14 }

◆ CheckEncodeDecode()

static void flutter::CheckEncodeDecode ( const EncodableValue value,
const std::vector< uint8_t > &  expected_encoding,
const StandardCodecSerializer serializer = nullptr,
std::function< bool(const EncodableValue &a, const EncodableValue &b)>  custom_comparator = nullptr 
)
static

Definition at line 21 of file standard_message_codec_unittests.cc.

References flutter::MessageCodec< T >::DecodeMessage(), flutter::MessageCodec< T >::EncodeMessage(), and flutter::StandardMessageCodec::GetInstance().

Referenced by TEST().

26  {
27  const StandardMessageCodec& codec =
28  StandardMessageCodec::GetInstance(serializer);
29  auto encoded = codec.EncodeMessage(value);
30  ASSERT_TRUE(encoded);
31  EXPECT_EQ(*encoded, expected_encoding);
32 
33  auto decoded = codec.DecodeMessage(*encoded);
34  if (custom_comparator) {
35  EXPECT_TRUE(custom_comparator(value, *decoded));
36  } else {
37  EXPECT_EQ(value, *decoded);
38  }
39 }
uint8_t value

◆ CheckEncodeDecodeWithEncodePrefix()

static void flutter::CheckEncodeDecodeWithEncodePrefix ( const EncodableValue value,
const std::vector< uint8_t > &  expected_encoding_prefix,
size_t  expected_encoding_length 
)
static

Definition at line 46 of file standard_message_codec_unittests.cc.

References flutter::MessageCodec< T >::DecodeMessage(), flutter::MessageCodec< T >::EncodeMessage(), and flutter::StandardMessageCodec::GetInstance().

Referenced by TEST().

49  {
50  EXPECT_TRUE(std::holds_alternative<EncodableMap>(value));
51  const StandardMessageCodec& codec = StandardMessageCodec::GetInstance();
52  auto encoded = codec.EncodeMessage(value);
53  ASSERT_TRUE(encoded);
54 
55  EXPECT_EQ(encoded->size(), expected_encoding_length);
56  ASSERT_GT(encoded->size(), expected_encoding_prefix.size());
57  EXPECT_TRUE(std::equal(
58  encoded->begin(), encoded->begin() + expected_encoding_prefix.size(),
59  expected_encoding_prefix.begin(), expected_encoding_prefix.end()));
60 
61  auto decoded = codec.DecodeMessage(*encoded);
62 
63  EXPECT_EQ(value, *decoded);
64 }
uint8_t value

◆ ChooseEGLConfiguration()

static EGLResult<EGLConfig> flutter::ChooseEGLConfiguration ( EGLDisplay  display)
static

Definition at line 72 of file android_context_gl.cc.

References eglChooseConfig().

Referenced by flutter::AndroidContextGL::AndroidContextGL().

72  {
73  EGLint attributes[] = {
74  // clang-format off
75  EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
76  EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
77  EGL_RED_SIZE, 8,
78  EGL_GREEN_SIZE, 8,
79  EGL_BLUE_SIZE, 8,
80  EGL_ALPHA_SIZE, 8,
81  EGL_DEPTH_SIZE, 0,
82  EGL_STENCIL_SIZE, 0,
83  EGL_NONE, // termination sentinel
84  // clang-format on
85  };
86 
87  EGLint config_count = 0;
88  EGLConfig egl_config = nullptr;
89 
90  if (eglChooseConfig(display, attributes, &egl_config, 1, &config_count) !=
91  EGL_TRUE) {
92  return {false, nullptr};
93  }
94 
95  bool success = config_count > 0 && egl_config != nullptr;
96 
97  return {success, success ? egl_config : nullptr};
98 }
EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
Definition: mock_egl.cc:95

◆ ColorFilter_constructor()

static void flutter::ColorFilter_constructor ( Dart_NativeArguments  args)
static

Definition at line 17 of file color_filter.cc.

References flutter::ColorFilter::Create(), tonic::DartCallConstructor(), IMPLEMENT_WRAPPERTYPEINFO(), and flutter::UIDartState::ThrowIfUIOperationsProhibited().

Referenced by flutter::ColorFilter::RegisterNatives().

17  {
18  UIDartState::ThrowIfUIOperationsProhibited();
19  DartCallConstructor(&ColorFilter::Create, args);
20 }
G_BEGIN_DECLS FlValue * args
void DartCallConstructor(Sig func, Dart_NativeArguments args)
Definition: dart_args.h:218

◆ CommandLineFromNSProcessInfo()

fml::CommandLine flutter::CommandLineFromNSProcessInfo ( )

Definition at line 11 of file command_line.mm.

References fml::CommandLineFromIterators().

Referenced by DefaultSettingsForProcess().

11  {
12  std::vector<std::string> args_vector;
13 
14  for (NSString* arg in [NSProcessInfo processInfo].arguments) {
15  args_vector.emplace_back(arg.UTF8String);
16  }
17 
18  return fml::CommandLineFromIterators(args_vector.begin(), args_vector.end());
19 }
CommandLine CommandLineFromIterators(InputIterator first, InputIterator last)
Definition: command_line.h:201

◆ ComputePlatformResolvedLocale()

Dart_Handle flutter::ComputePlatformResolvedLocale ( Dart_Handle  supportedLocalesHandle)

Definition at line 396 of file platform_configuration.cc.

References flutter::PlatformConfiguration::client(), flutter::PlatformConfigurationClient::ComputePlatformResolvedLocale(), flutter::UIDartState::Current(), flutter::UIDartState::platform_configuration(), and tonic::ToDart().

Referenced by _ComputePlatformResolvedLocale(), and flutter::Engine::InitialRoute().

396  {
397  std::vector<std::string> supportedLocales =
399  supportedLocalesHandle);
400 
401  std::vector<std::string> results =
402  *UIDartState::Current()
403  ->platform_configuration()
404  ->client()
405  ->ComputePlatformResolvedLocale(supportedLocales);
406 
408 }
Dart_Handle ToDart(const T &object)

◆ ConvertMutation() [1/4]

static std::unique_ptr<FlutterPlatformViewMutation> flutter::ConvertMutation ( double  opacity)
static

Definition at line 41 of file embedder_layers.cc.

References kFlutterPlatformViewMutationTypeOpacity, opacity, FlutterPlatformViewMutation::opacity, and FlutterPlatformViewMutation::type.

Referenced by flutter::EmbedderLayers::PushPlatformViewLayer().

42  {
43  FlutterPlatformViewMutation mutation = {};
45  mutation.opacity = opacity;
46  return std::make_unique<FlutterPlatformViewMutation>(mutation);
47 }
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807

◆ ConvertMutation() [2/4]

static std::unique_ptr<FlutterPlatformViewMutation> flutter::ConvertMutation ( const SkRect &  rect)
static

Definition at line 49 of file embedder_layers.cc.

References FlutterRect::bottom, FlutterPlatformViewMutation::clip_rect, kFlutterPlatformViewMutationTypeClipRect, FlutterRect::left, FlutterRect::right, FlutterRect::top, and FlutterPlatformViewMutation::type.

50  {
51  FlutterPlatformViewMutation mutation = {};
53  mutation.clip_rect.left = rect.left();
54  mutation.clip_rect.top = rect.top();
55  mutation.clip_rect.right = rect.right();
56  mutation.clip_rect.bottom = rect.bottom();
57  return std::make_unique<FlutterPlatformViewMutation>(mutation);
58 }
double right
Definition: embedder.h:327
double top
Definition: embedder.h:326
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807

◆ ConvertMutation() [3/4]

static std::unique_ptr<FlutterPlatformViewMutation> flutter::ConvertMutation ( const SkRRect &  rrect)
static

Definition at line 67 of file embedder_layers.cc.

References FlutterRect::bottom, FlutterPlatformViewMutation::clip_rounded_rect, kFlutterPlatformViewMutationTypeClipRoundedRect, FlutterRect::left, FlutterRoundedRect::lower_left_corner_radius, FlutterRoundedRect::lower_right_corner_radius, FlutterRoundedRect::rect, FlutterRect::right, FlutterRect::top, FlutterPlatformViewMutation::type, FlutterRoundedRect::upper_left_corner_radius, FlutterRoundedRect::upper_right_corner_radius, and VectorToSize().

68  {
69  FlutterPlatformViewMutation mutation = {};
71  const auto& rect = rrect.rect();
72  mutation.clip_rounded_rect.rect.left = rect.left();
73  mutation.clip_rounded_rect.rect.top = rect.top();
74  mutation.clip_rounded_rect.rect.right = rect.right();
75  mutation.clip_rounded_rect.rect.bottom = rect.bottom();
77  VectorToSize(rrect.radii(SkRRect::Corner::kUpperLeft_Corner));
79  VectorToSize(rrect.radii(SkRRect::Corner::kUpperRight_Corner));
81  VectorToSize(rrect.radii(SkRRect::Corner::kLowerRight_Corner));
83  VectorToSize(rrect.radii(SkRRect::Corner::kLowerLeft_Corner));
84  return std::make_unique<FlutterPlatformViewMutation>(mutation);
85 }
static FlutterSize VectorToSize(const SkVector &vector)
FlutterSize upper_left_corner_radius
Definition: embedder.h:340
FlutterSize upper_right_corner_radius
Definition: embedder.h:341
double right
Definition: embedder.h:327
FlutterSize lower_right_corner_radius
Definition: embedder.h:342
double top
Definition: embedder.h:326
double left
Definition: embedder.h:325
double bottom
Definition: embedder.h:328
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:811
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807
FlutterSize lower_left_corner_radius
Definition: embedder.h:343
FlutterRect rect
Definition: embedder.h:339

◆ ConvertMutation() [4/4]

static std::unique_ptr<FlutterPlatformViewMutation> flutter::ConvertMutation ( const SkMatrix &  matrix)
static

Definition at line 87 of file embedder_layers.cc.

References kFlutterPlatformViewMutationTypeTransformation, FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterPlatformViewMutation::transformation, FlutterTransformation::transX, FlutterTransformation::transY, and FlutterPlatformViewMutation::type.

88  {
89  FlutterPlatformViewMutation mutation = {};
91  mutation.transformation.scaleX = matrix[SkMatrix::kMScaleX];
92  mutation.transformation.skewX = matrix[SkMatrix::kMSkewX];
93  mutation.transformation.transX = matrix[SkMatrix::kMTransX];
94  mutation.transformation.skewY = matrix[SkMatrix::kMSkewY];
95  mutation.transformation.scaleY = matrix[SkMatrix::kMScaleY];
96  mutation.transformation.transY = matrix[SkMatrix::kMTransY];
97  mutation.transformation.pers0 = matrix[SkMatrix::kMPersp0];
98  mutation.transformation.pers1 = matrix[SkMatrix::kMPersp1];
99  mutation.transformation.pers2 = matrix[SkMatrix::kMPersp2];
100  return std::make_unique<FlutterPlatformViewMutation>(mutation);
101 }
double skewY
vertical skew factor
Definition: embedder.h:230
double skewX
horizontal skew factor
Definition: embedder.h:226
double pers1
input y-axis perspective factor
Definition: embedder.h:238
double pers2
perspective scale factor
Definition: embedder.h:240
FlutterTransformation transformation
Definition: embedder.h:812
double pers0
input x-axis perspective factor
Definition: embedder.h:236
double scaleY
vertical scale factor
Definition: embedder.h:232
double transX
horizontal translation
Definition: embedder.h:228
double transY
vertical translation
Definition: embedder.h:234
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:807
double scaleX
horizontal scale factor
Definition: embedder.h:224

◆ ConvertWinButtonToFlutterButton()

static uint64_t flutter::ConvertWinButtonToFlutterButton ( UINT  button)
static

Definition at line 96 of file win32_flutter_window.cc.

References kFlutterPointerButtonMouseBack, kFlutterPointerButtonMouseForward, kFlutterPointerButtonMouseMiddle, kFlutterPointerButtonMousePrimary, and kFlutterPointerButtonMouseSecondary.

Referenced by flutter::Win32FlutterWindow::OnPointerDown(), and flutter::Win32FlutterWindow::OnPointerUp().

96  {
97  switch (button) {
98  case WM_LBUTTONDOWN:
99  case WM_LBUTTONUP:
101  case WM_RBUTTONDOWN:
102  case WM_RBUTTONUP:
104  case WM_MBUTTONDOWN:
105  case WM_MBUTTONUP:
107  case XBUTTON1:
109  case XBUTTON2:
111  }
112  std::cerr << "Mouse button not recognized: " << button << std::endl;
113  return 0;
114 }

◆ CopyToBitmap()

static bool flutter::CopyToBitmap ( SkBitmap *  dst,
SkColorType  dstColorType,
const SkBitmap &  src 
)
static

Definition at line 45 of file multi_frame_codec.cc.

References flutter::CanvasImage::Create(), FML_DLOG, FML_LOG, fml::WeakPtr< T >::get(), InvokeNextFrameCallback(), fml::MakeCopyable(), and fml::TaskRunner::PostTask().

47  {
48  SkPixmap srcPM;
49  if (!src.peekPixels(&srcPM)) {
50  return false;
51  }
52 
53  SkBitmap tmpDst;
54  SkImageInfo dstInfo = srcPM.info().makeColorType(dstColorType);
55  if (!tmpDst.setInfo(dstInfo)) {
56  return false;
57  }
58 
59  if (!tmpDst.tryAllocPixels()) {
60  return false;
61  }
62 
63  SkPixmap dstPM;
64  if (!tmpDst.peekPixels(&dstPM)) {
65  return false;
66  }
67 
68  if (!srcPM.readPixels(dstPM)) {
69  return false;
70  }
71 
72  dst->swap(tmpDst);
73  return true;
74 }

◆ CreateContext()

static EGLResult<EGLContext> flutter::CreateContext ( EGLDisplay  display,
EGLConfig  config,
EGLContext  share = EGL_NO_CONTEXT 
)
static

Definition at line 62 of file android_context_gl.cc.

References eglCreateContext().

Referenced by flutter::AndroidContextGL::AndroidContextGL(), and flutter::AndroidContextGL::CreateNewContext().

64  {
65  EGLint attributes[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
66 
67  EGLContext context = eglCreateContext(display, config, share, attributes);
68 
69  return {context != EGL_NO_CONTEXT, context};
70 }
EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
Definition: mock_egl.cc:121

◆ CreateEmbedderTaskRunner()

static std::pair<bool, fml::RefPtr<EmbedderTaskRunner> > flutter::CreateEmbedderTaskRunner ( const FlutterTaskRunnerDescription description)
static

Attempts to create a task runner from an embedder task runner description. The first boolean in the pair indicate whether the embedder specified an invalid task runner description. In this case, engine launch must be aborted. If the embedder did not specify any task runner, an engine managed task runner and thread must be selected instead.

Parameters
[in]descriptionThe description
Returns
A pair that returns if the embedder has specified a task runner (null otherwise) and whether to terminate further engine launch.

Definition at line 30 of file embedder_thread_host.cc.

References FML_LOG, FlutterTaskRunnerDescription::post_task_callback, FlutterTaskRunnerDescription::runs_task_on_current_thread_callback, SAFE_ACCESS, and user_data.

30  {
31  if (description == nullptr) {
32  // This is not embedder error. The embedder API will just have to create a
33  // plain old task runner (and create a thread for it) instead of using a
34  // task runner provided to us by the embedder.
35  return {true, {}};
36  }
37 
38  if (SAFE_ACCESS(description, runs_task_on_current_thread_callback, nullptr) ==
39  nullptr) {
40  FML_LOG(ERROR) << "FlutterTaskRunnerDescription.runs_task_on_current_"
41  "thread_callback was nullptr.";
42  return {false, {}};
43  }
44 
45  if (SAFE_ACCESS(description, post_task_callback, nullptr) == nullptr) {
46  FML_LOG(ERROR)
47  << "FlutterTaskRunnerDescription.post_task_callback was nullptr.";
48  return {false, {}};
49  }
50 
51  auto user_data = SAFE_ACCESS(description, user_data, nullptr);
52 
53  // ABI safety checks have been completed.
54  auto post_task_callback_c = description->post_task_callback;
55  auto runs_task_on_current_thread_callback_c =
57 
58  EmbedderTaskRunner::DispatchTable task_runner_dispatch_table = {
59  // .post_task_callback
60  [post_task_callback_c, user_data](EmbedderTaskRunner* task_runner,
61  uint64_t task_baton,
62  fml::TimePoint target_time) -> void {
63  FlutterTask task = {
64  // runner
65  reinterpret_cast<FlutterTaskRunner>(task_runner),
66  // task
67  task_baton,
68  };
69  post_task_callback_c(task, target_time.ToEpochDelta().ToNanoseconds(),
70  user_data);
71  },
72  // runs_task_on_current_thread_callback
73  [runs_task_on_current_thread_callback_c, user_data]() -> bool {
74  return runs_task_on_current_thread_callback_c(user_data);
75  }};
76 
77  return {true, fml::MakeRefCounted<EmbedderTaskRunner>(
78  task_runner_dispatch_table,
79  SAFE_ACCESS(description, identifier, 0u))};
80 }
#define FML_LOG(severity)
Definition: logging.h:65
#define SAFE_ACCESS(pointer, member, default_value)
G_BEGIN_DECLS FlValue gpointer user_data
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition: embedder.h:739
BoolCallback runs_task_on_current_thread_callback
Definition: embedder.h:728

◆ CreateFlutterCallbackInformation()

jobject flutter::CreateFlutterCallbackInformation ( JNIEnv *  env,
const std::string &  callbackName,
const std::string &  callbackClassName,
const std::string &  callbackLibraryPath 
)

Definition at line 61 of file platform_view_android_jni_impl.cc.

References g_flutter_callback_info_constructor, and fml::jni::JavaRef< T >::obj().

Referenced by LookupCallbackInformation().

65  {
66  return env->NewObject(g_flutter_callback_info_class->obj(),
68  env->NewStringUTF(callbackName.c_str()),
69  env->NewStringUTF(callbackClassName.c_str()),
70  env->NewStringUTF(callbackLibraryPath.c_str()));
71 }
static jmethodID g_flutter_callback_info_constructor
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_callback_info_class

◆ CreateFlutterViewID()

static std::string flutter::CreateFlutterViewID ( intptr_t  handler)
static

Definition at line 226 of file service_protocol.cc.

Referenced by flutter::ServiceProtocol::Handler::Description::Write().

226  {
227  std::stringstream stream;
228  stream << kViewIdPrefx << "0x" << std::hex << handler;
229  return stream.str();
230 }
static constexpr std::string_view kViewIdPrefx

◆ CreateGLInterface()

static sk_sp<const GrGLInterface> flutter::CreateGLInterface ( GPUSurfaceGLDelegate::GLProcResolver  proc_resolver)
static

Definition at line 57 of file gpu_surface_gl_delegate.cc.

References FML_LOG, and IsProcResolverOpenGLES().

Referenced by flutter::GPUSurfaceGLDelegate::GetDefaultPlatformGLInterface(), and flutter::GPUSurfaceGLDelegate::GetGLInterface().

58  {
59  if (proc_resolver == nullptr) {
60  // If there is no custom proc resolver, ask Skia to guess the native
61  // interface. This often leads to interesting results on most platforms.
62  return GrGLMakeNativeInterface();
63  }
64 
65  struct ProcResolverContext {
66  GPUSurfaceGLDelegate::GLProcResolver resolver;
67  };
68 
69  ProcResolverContext context = {proc_resolver};
70 
71  GrGLGetProc gl_get_proc = [](void* context,
72  const char gl_proc_name[]) -> GrGLFuncPtr {
73  auto proc_resolver_context =
74  reinterpret_cast<ProcResolverContext*>(context);
75  return reinterpret_cast<GrGLFuncPtr>(
76  proc_resolver_context->resolver(gl_proc_name));
77  };
78 
79  // glGetString indicates an OpenGL ES interface.
80  if (IsProcResolverOpenGLES(proc_resolver)) {
81  return GrGLMakeAssembledGLESInterface(&context, gl_get_proc);
82  }
83 
84  // Fallback to OpenGL.
85  if (auto interface = GrGLMakeAssembledGLInterface(&context, gl_get_proc)) {
86  return interface;
87  }
88 
89  FML_LOG(ERROR) << "Could not create a valid GL interface.";
90  return nullptr;
91 }
static bool IsProcResolverOpenGLES(GPUSurfaceGLDelegate::GLProcResolver proc_resolver)
#define FML_LOG(severity)
Definition: logging.h:65

◆ CreateIsolateID()

static std::string flutter::CreateIsolateID ( int64_t  isolate)
static

Definition at line 232 of file service_protocol.cc.

Referenced by flutter::ServiceProtocol::Handler::Description::Write().

232  {
233  std::stringstream stream;
234  stream << "isolates/" << isolate;
235  return stream.str();
236 }

◆ CreateMetalGrContextOptions()

static GrContextOptions flutter::CreateMetalGrContextOptions ( )
static

Definition at line 14 of file ios_context_metal.mm.

References flutter::PersistentCache::cache_sksl(), flutter::PersistentCache::GetCacheForProcess(), and flutter::PersistentCache::MarkStrategySet().

Referenced by flutter::IOSContextMetal::IOSContextMetal().

14  {
15  GrContextOptions options = {};
16  if (PersistentCache::cache_sksl()) {
17  options.fShaderCacheStrategy = GrContextOptions::ShaderCacheStrategy::kSkSL;
18  }
19  PersistentCache::MarkStrategySet();
20  options.fPersistentCache = PersistentCache::GetCacheForProcess();
21  return options;
22 }

◆ CreateObject()

static SemanticsObject* flutter::CreateObject ( const flutter::SemanticsNode node,
fml::WeakPtr< AccessibilityBridge weak_ptr 
)
static

Definition at line 266 of file accessibility_bridge.mm.

References flutter::SemanticsNode::HasFlag(), flutter::SemanticsNode::id, kHasCheckedState, kHasToggledState, kIsReadOnly, and kIsTextField.

Referenced by DidFlagChange().

267  {
270  // Text fields are backed by objects that implement UITextInput.
271  return [[[TextInputSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease];
274  SemanticsObject* delegateObject =
275  [[[FlutterSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease];
277  initWithSemanticsObject:delegateObject] autorelease];
278  } else {
279  return [[[FlutterSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease];
280  }
281 }
bool HasFlag(SemanticsFlags flag) const

◆ CreateSnapshotSurface()

static sk_sp<SkSurface> flutter::CreateSnapshotSurface ( GrDirectContext *  surface_context,
const SkISize &  size 
)
static

Definition at line 521 of file rasterizer.cc.

References FML_LOG, and flutter::LayerTree::frame_size().

522  {
523  const auto image_info = SkImageInfo::MakeN32Premul(
524  size.width(), size.height(), SkColorSpace::MakeSRGB());
525  if (surface_context) {
526  // There is a rendering surface that may contain textures that are going to
527  // be referenced in the layer tree about to be drawn.
528  return SkSurface::MakeRenderTarget(surface_context, //
529  SkBudgeted::kNo, //
530  image_info //
531  );
532  }
533 
534  // There is no rendering surface, assume no GPU textures are present and
535  // create a raster surface.
536  return SkSurface::MakeRaster(image_info);
537 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ DartFileModifiedCallback()

bool flutter::DartFileModifiedCallback ( const char *  source_url,
int64_t  since_ms 
)

Definition at line 124 of file dart_vm.cc.

References fml::TimeDelta::FromMilliseconds(), fml::TimeDelta::FromSeconds(), kFileUriPrefixLength, and path.

Referenced by flutter::DartVM::GetVMLaunchCount().

124  {
125  if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) {
126  // Assume modified.
127  return true;
128  }
129 
130  const char* path = source_url + kFileUriPrefixLength;
131  struct stat info;
132  if (stat(path, &info) < 0) {
133  return true;
134  }
135 
136  // If st_mtime is zero, it's more likely that the file system doesn't support
137  // mtime than that the file was actually modified in the 1970s.
138  if (!info.st_mtime) {
139  return true;
140  }
141 
142  // It's very unclear what time bases we're with here. The Dart API doesn't
143  // document the time base for since_ms. Reading the code, the value varies by
144  // platform, with a typical source being something like gettimeofday.
145  //
146  // We add one to st_mtime because st_mtime has less precision than since_ms
147  // and we want to treat the file as modified if the since time is between
148  // ticks of the mtime.
149  fml::TimeDelta mtime = fml::TimeDelta::FromSeconds(info.st_mtime + 1);
151 
152  return mtime > since;
153 }
DEF_SWITCHES_START snapshot asset path
Definition: switches.h:32
static constexpr TimeDelta FromSeconds(int64_t seconds)
Definition: time_delta.h:49
constexpr char kFileUriPrefix[]
Definition: dart_vm.cc:121
constexpr size_t kFileUriPrefixLength
Definition: dart_vm.cc:122
static constexpr TimeDelta FromMilliseconds(int64_t millis)
Definition: time_delta.h:46

◆ DartOldGenHeapSizeArgs()

static std::string flutter::DartOldGenHeapSizeArgs ( uint64_t  heap_size)
static

Definition at line 115 of file dart_vm.cc.

Referenced by flutter::DartVM::GetVMLaunchCount().

115  {
116  std::ostringstream oss;
117  oss << "--old_gen_heap_size=" << heap_size;
118  return oss.str();
119 }

◆ decodeFontFeatures()

void flutter::decodeFontFeatures ( Dart_Handle  font_features_data,
txt::FontFeatures font_features 
)

Definition at line 335 of file paragraph_builder.cc.

References tonic::DartByteData::data(), FML_CHECK, tonic::DartByteData::length_in_bytes(), txt::FontFeatures::SetFeature(), and value.

Referenced by flutter::ParagraphBuilder::pushStyle().

336  { // NOLINT
337  tonic::DartByteData byte_data(font_features_data);
338  FML_CHECK(byte_data.length_in_bytes() % kBytesPerFontFeature == 0);
339 
340  size_t feature_count = byte_data.length_in_bytes() / kBytesPerFontFeature;
341  for (size_t feature_index = 0; feature_index < feature_count;
342  ++feature_index) {
343  size_t feature_offset = feature_index * kBytesPerFontFeature;
344  const char* feature_bytes =
345  static_cast<const char*>(byte_data.data()) + feature_offset;
346  std::string tag(feature_bytes, kFontFeatureTagLength);
347  int32_t value = *(reinterpret_cast<const int32_t*>(feature_bytes +
348  kFontFeatureTagLength));
349  font_features.SetFeature(tag, value);
350  }
351 }
uint8_t value
void SetFeature(std::string tag, int value)
#define FML_CHECK(condition)
Definition: logging.h:68

◆ decodeStrut()

void flutter::decodeStrut ( Dart_Handle  strut_data,
const std::vector< std::string > &  strut_font_families,
txt::ParagraphStyle paragraph_style 
)

Definition at line 172 of file paragraph_builder.cc.

References flutter::PlatformConfiguration::client(), flutter::UIDartState::Current(), tonic::DartByteData::data(), txt::ParagraphStyle::ellipsis, FLUTTER_PARAGRAPH_BUILDER, txt::ParagraphStyle::font_family, txt::ParagraphStyle::font_size, txt::ParagraphStyle::font_style, txt::ParagraphStyle::font_weight, txt::ParagraphStyle::force_strut_height, flutter::FontCollection::GetFontCollection(), flutter::PlatformConfigurationClient::GetFontCollection(), txt::ParagraphStyle::has_height_override, height, txt::ParagraphStyle::height, tonic::DartByteData::length_in_bytes(), txt::ParagraphStyle::locale, txt::ParagraphStyle::max_lines, flutter::UIDartState::platform_configuration(), txt::ParagraphStyle::strut_enabled, txt::ParagraphStyle::strut_font_families, txt::ParagraphStyle::strut_font_size, txt::ParagraphStyle::strut_font_style, txt::ParagraphStyle::strut_font_weight, txt::ParagraphStyle::strut_has_height_override, txt::ParagraphStyle::strut_height, txt::ParagraphStyle::strut_leading, txt::ParagraphStyle::text_align, txt::ParagraphStyle::text_direction, txt::ParagraphStyle::text_height_behavior, and flutter::ParagraphBuilder::~ParagraphBuilder().

174  { // NOLINT
175  if (strut_data == Dart_Null()) {
176  return;
177  }
178 
179  tonic::DartByteData byte_data(strut_data);
180  if (byte_data.length_in_bytes() == 0) {
181  return;
182  }
183  paragraph_style.strut_enabled = true;
184 
185  const uint8_t* uint8_data = static_cast<const uint8_t*>(byte_data.data());
186  uint8_t mask = uint8_data[0];
187 
188  // Data is stored in order of increasing size, eg, 8 bit ints will be before
189  // any 32 bit ints. In addition, the order of decoding is the same order
190  // as it is encoded, and the order is used to maintain consistency.
191  size_t byte_count = 1;
192  if (mask & sFontWeightMask) {
193  paragraph_style.strut_font_weight =
194  static_cast<txt::FontWeight>(uint8_data[byte_count++]);
195  }
196  if (mask & sFontStyleMask) {
197  paragraph_style.strut_font_style =
198  static_cast<txt::FontStyle>(uint8_data[byte_count++]);
199  }
200 
201  std::vector<float> float_data;
202  float_data.resize((byte_data.length_in_bytes() - byte_count) / 4);
203  memcpy(float_data.data(),
204  static_cast<const char*>(byte_data.data()) + byte_count,
205  byte_data.length_in_bytes() - byte_count);
206  size_t float_count = 0;
207  if (mask & sFontSizeMask) {
208  paragraph_style.strut_font_size = float_data[float_count++];
209  }
210  if (mask & sHeightMask) {
211  paragraph_style.strut_height = float_data[float_count++];
212  paragraph_style.strut_has_height_override = true;
213  }
214  if (mask & sLeadingMask) {
215  paragraph_style.strut_leading = float_data[float_count++];
216  }
217  if (mask & sForceStrutHeightMask) {
218  // The boolean is stored as the last bit in the bitmask.
219  paragraph_style.force_strut_height = (mask & 1 << 7) != 0;
220  }
221 
222  if (mask & sFontFamilyMask) {
223  paragraph_style.strut_font_families = strut_font_families;
224  } else {
225  // Provide an empty font name so that the platform default font will be
226  // used.
227  paragraph_style.strut_font_families.push_back("");
228  }
229 }
FontStyle
Definition: font_style.h:22
std::vector< std::string > strut_font_families
FontWeight strut_font_weight
FontWeight
Definition: font_weight.h:22
FontStyle strut_font_style

◆ decodeTextShadows()

void flutter::decodeTextShadows ( Dart_Handle  shadows_data,
std::vector< txt::TextShadow > &  decoded_shadows 
)

Definition at line 310 of file paragraph_builder.cc.

References tonic::DartByteData::data(), FML_CHECK, kColorDefault, and tonic::DartByteData::length_in_bytes().

Referenced by flutter::ParagraphBuilder::pushStyle().

312  { // NOLINT
313  decoded_shadows.clear();
314 
315  tonic::DartByteData byte_data(shadows_data);
316  FML_CHECK(byte_data.length_in_bytes() % kBytesPerShadow == 0);
317 
318  const uint32_t* uint_data = static_cast<const uint32_t*>(byte_data.data());
319  const float* float_data = static_cast<const float*>(byte_data.data());
320 
321  size_t shadow_count = byte_data.length_in_bytes() / kBytesPerShadow;
322  size_t shadow_count_offset = 0;
323  for (size_t shadow_index = 0; shadow_index < shadow_count; ++shadow_index) {
324  shadow_count_offset = shadow_index * kShadowPropertiesCount;
325  SkColor color =
326  uint_data[shadow_count_offset + kColorOffset] ^ kColorDefault;
327  decoded_shadows.emplace_back(
328  color,
329  SkPoint::Make(float_data[shadow_count_offset + kXOffset],
330  float_data[shadow_count_offset + kYOffset]),
331  float_data[shadow_count_offset + kBlurOffset]);
332  }
333 }
constexpr uint32_t kColorDefault
Definition: paint.cc:45
#define FML_CHECK(condition)
Definition: logging.h:68

◆ DEF_SWITCH() [1/9]

DEF_SWITCHES_START flutter::DEF_SWITCH ( AotSharedLibraryName  ,
"aot-shared-library-name ,
"Name of the *.so containing AOT compiled Dart assets."   
)

◆ DEF_SWITCH() [2/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions flutter::DEF_SWITCH ( VmSnapshotData  ,
"vm-snapshot-data"  ,
"The VM snapshot data that will be memory mapped as read-only. " "SnapshotAssetPath must be present."   
)

◆ DEF_SWITCH() [3/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present flutter::DEF_SWITCH ( IsolateSnapshotData  ,
"isolate-snapshot-data"  ,
"The isolate snapshot data that will be memory mapped as read-only. " "SnapshotAssetPath must be present."   
)

◆ DEF_SWITCH() [4/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present flutter::DEF_SWITCH ( CacheDirPath  ,
"cache-dir-path ,
"Path to the cache directory. " "This is different from the persistent_cache_path in embedder.  h,
" "which is used for Skia shader cache."   
)

◆ DEF_SWITCH() [5/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library flutter::DEF_SWITCH ( ICUNativeLibPath  ,
"icu-native-lib-path ,
"Path to the library file that exports the ICU data."   
)

◆ DEF_SWITCH() [6/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell flutter::DEF_SWITCH ( DeviceObservatoryHost  ,
"observatory-host"  ,
"The hostname/IP address on which the Dart Observatory should " "be served. If not  set,
defaults to 127.0.0.1 or ::1 depending on " "whether --ipv6 is specified."   
)

◆ DEF_SWITCH() [7/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port flutter::DEF_SWITCH ( DisableObservatory  ,
"disable-observatory"  ,
"Disable the Dart Observatory. The observatory is never available " "in release mode."   
)

◆ DEF_SWITCH() [8/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication flutter::DEF_SWITCH ( IPv6  ,
"ipv6"  ,
"Bind to the IPv6 localhost address for the Dart Observatory. " "Ignored if --observatory-host is set."   
)

◆ DEF_SWITCH() [9/9]

DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart Flags passed directly to the Dart VM without being interpreted by the Flutter shell observatory A custom Dart Observatory port The default is to pick a randomly available open port disable observatory Disable mDNS Dart Observatory publication enable dart Enable Dart profiling Profiling information can be viewed from the observatory flutter::DEF_SWITCH ( EndlessTraceBuffer  ,
"endless-trace-buffer"  ,
"Enable an endless trace buffer. The default is a ring buffer. " "This is useful when very old events need to viewed. For  example,
" "during application launch. Memory usage will continue to grow " "indefinitely however."   
)

◆ DeserializeImageWithoutData()

sk_sp< SkImage > flutter::DeserializeImageWithoutData ( const void *  data,
size_t  length,
void *  ctx 
)

Definition at line 49 of file serialization_callbacks.cc.

References FML_CHECK.

51  {
52  FML_CHECK(length >= sizeof(ImageMetaData));
53  auto metadata = static_cast<const ImageMetaData*>(data);
54  sk_sp<SkColorSpace> color_space = nullptr;
55  if (metadata->has_color_space) {
56  color_space = SkColorSpace::Deserialize(
57  static_cast<const uint8_t*>(data) + sizeof(ImageMetaData),
58  length - sizeof(ImageMetaData));
59  }
60 
61  auto image_size = SkISize::Make(metadata->width, metadata->height);
62  auto info = SkImageInfo::Make(
63  image_size, static_cast<SkColorType>(metadata->color_type),
64  static_cast<SkAlphaType>(metadata->alpha_type), color_space);
65  sk_sp<SkData> image_data =
66  SkData::MakeUninitialized(image_size.width() * image_size.height() * 4);
67  memset(image_data->writable_data(), 0x0f, image_data->size());
68  sk_sp<SkImage> image =
69  SkImage::MakeRasterData(info, image_data, image_size.width() * 4);
70 
71  return image;
72 };
size_t length
#define FML_CHECK(condition)
Definition: logging.h:68

◆ DestroyJNI()

static void flutter::DestroyJNI ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder 
)
static

Definition at line 137 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

137  {
138  delete ANDROID_SHELL_HOLDER;
139 }
#define ANDROID_SHELL_HOLDER

◆ DidFlagChange()

static bool flutter::DidFlagChange ( const flutter::SemanticsNode oldNode,
const flutter::SemanticsNode newNode,
SemanticsFlags  flag 
)
static

◆ DispatchEmptyPlatformMessage()

static void flutter::DispatchEmptyPlatformMessage ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jstring  channel,
jint  responseId 
)
static

Definition at line 368 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER, and fml::jni::JavaStringToString().

Referenced by RegisterApi().

372  {
373  ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage(
374  env, //
375  fml::jni::JavaStringToString(env, channel), //
376  responseId //
377  );
378 }
#define ANDROID_SHELL_HOLDER
std::string JavaStringToString(JNIEnv *env, jstring str)
Definition: jni_util.cc:58

◆ DispatchPlatformMessage()

static void flutter::DispatchPlatformMessage ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jstring  channel,
jobject  message,
jint  position,
jint  responseId 
)
static

Definition at line 352 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER, and fml::jni::JavaStringToString().

Referenced by flutter::PlatformConfiguration::client(), RegisterApi(), and TEST_F().

358  {
359  ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage(
360  env, //
361  fml::jni::JavaStringToString(env, channel), //
362  message, //
363  position, //
364  responseId //
365  );
366 }
#define ANDROID_SHELL_HOLDER
std::string JavaStringToString(JNIEnv *env, jstring str)
Definition: jni_util.cc:58

◆ DispatchPointerDataPacket()

static void flutter::DispatchPointerDataPacket ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jobject  buffer,
jint  position 
)
static

Definition at line 380 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER.

Referenced by FlutterEngineSendPointerEvent(), and RegisterApi().

384  {
385  uint8_t* data = static_cast<uint8_t*>(env->GetDirectBufferAddress(buffer));
386  auto packet = std::make_unique<flutter::PointerDataPacket>(data, position);
387  ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPointerDataPacket(
388  std::move(packet));
389 }
#define ANDROID_SHELL_HOLDER

◆ DispatchSemanticsAction()

static void flutter::DispatchSemanticsAction ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jint  id,
jint  action,
jobject  args,
jint  args_position 
)
static

Definition at line 391 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER.

Referenced by flutter::PlatformConfiguration::client(), and RegisterApi().

397  {
398  ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction(
399  env, //
400  id, //
401  action, //
402  args, //
403  args_position //
404  );
405 }
G_BEGIN_DECLS FlValue * args
#define ANDROID_SHELL_HOLDER
SemanticsAction action

◆ DrawCheckerboard() [1/2]

void flutter::DrawCheckerboard ( SkCanvas *  canvas,
SkColor  c1,
SkColor  c2,
int  size 
)

Definition at line 28 of file paint_utils.cc.

Referenced by DrawCheckerboard(), flutter::ClipRectLayer::Paint(), flutter::ClipPathLayer::Paint(), flutter::ClipRRectLayer::Paint(), flutter::PhysicalShapeLayer::Paint(), Rasterize(), and flutter::Layer::AutoSaveLayer::~AutoSaveLayer().

28  {
29  SkPaint paint;
30  paint.setShader(CreateCheckerboardShader(c1, c2, size));
31  canvas->drawPaint(paint);
32 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ DrawCheckerboard() [2/2]

void flutter::DrawCheckerboard ( SkCanvas *  canvas,
const SkRect &  rect 
)

Definition at line 34 of file paint_utils.cc.

References DrawCheckerboard().

34  {
35  // Draw a checkerboard
36  canvas->save();
37  canvas->clipRect(rect);
38 
39  auto checkerboard_color =
40  SkColorSetARGB(64, rand() % 256, rand() % 256, rand() % 256);
41 
42  DrawCheckerboard(canvas, checkerboard_color, 0x00000000, 12);
43  canvas->restore();
44 
45  // Stroke the drawn area
46  SkPaint debugPaint;
47  debugPaint.setStrokeWidth(8);
48  debugPaint.setColor(SkColorSetA(checkerboard_color, 255));
49  debugPaint.setStyle(SkPaint::kStroke_Style);
50  canvas->drawRect(rect, debugPaint);
51 }
void DrawCheckerboard(SkCanvas *canvas, const SkRect &rect)
Definition: paint_utils.cc:34

◆ elementSizeForFlutterStandardDataType()

UInt8 flutter::elementSizeForFlutterStandardDataType ( FlutterStandardDataType  type)

Definition at line 35 of file FlutterStandardCodec_Internal.h.

Referenced by FlutterStandardReader::readAlignment:, and FlutterStandardTypedData::typedDataWithFloat64:.

35  {
36  switch (type) {
37  case FlutterStandardDataTypeUInt8:
38  return 1;
39  case FlutterStandardDataTypeInt32:
40  return 4;
41  case FlutterStandardDataTypeInt64:
42  return 8;
43  case FlutterStandardDataTypeFloat64:
44  return 8;
45  }
46 }

◆ EmbedderInformationCallback()

static void flutter::EmbedderInformationCallback ( Dart_EmbedderInformation *  info)
static

Definition at line 233 of file dart_vm.cc.

References FML_LOG.

Referenced by dart_runner::CreateServiceIsolate(), and flutter::DartVM::GetVMLaunchCount().

233  {
234  info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION;
235  dart::bin::GetIOEmbedderInformation(info);
236  info->name = "Flutter";
237 }

◆ enableSkiaTracingCallback()

bool flutter::enableSkiaTracingCallback ( const char *  method,
const char **  param_keys,
const char **  param_values,
intptr_t  num_params,
void *  user_data,
const char **  json_object 
)

Definition at line 239 of file skia_event_tracer_impl.cc.

References flutter::FlutterEventTracer::enable(), fml::strdup(), and user_data.

Referenced by InitSkiaEventTracer().

244  {
245  FlutterEventTracer* tracer = static_cast<FlutterEventTracer*>(user_data);
246  tracer->enable();
247  *json_object = fml::strdup("{\"type\":\"Success\"}");
248  return true;
249 }
G_BEGIN_DECLS FlValue gpointer user_data
char * strdup(const char *str1)

◆ EnableTracingIfNecessary()

bool flutter::EnableTracingIfNecessary ( const Settings vm_settings)
inline

Enables tracing in the process so that JIT mode VMs may be launched. Explicitly enabling tracing is not required on all platforms. On platforms where it is not required, calling this method will return true. If tracing is required but cannot be enabled, it is the responsibility of the caller to display the appropriate error message to the user as subsequent attempts to launch the VM in JIT mode will cause process termination.

This method may be called multiple times and will return the same result. There are no threading restrictions.

Parameters
[in]vm_settingsThe settings used to launch the VM.
Returns
If tracing was enabled.

Definition at line 45 of file ptrace_check.h.

Referenced by flutter::DartVM::GetVMLaunchCount(), and FlutterEngine::initWithName:.

45  {
46 #if TRACING_CHECKS_NECESSARY
47  return EnableTracingIfNecessaryImpl(vm_settings);
48 #else // TRACING_CHECKS_NECESSARY
49  return true;
50 #endif // TRACING_CHECKS_NECESSARY
51 }

◆ EncodeImage()

Dart_Handle flutter::EncodeImage ( CanvasImage canvas_image,
int  format,
Dart_Handle  callback_handle 
)

Definition at line 250 of file image_encoding.cc.

References flutter::UIDartState::Current(), tonic::DartState::Current(), flutter::UIDartState::GetIOManager(), flutter::TaskRunners::GetIOTaskRunner(), flutter::UIDartState::GetSnapshotDelegate(), flutter::UIDartState::GetTaskRunners(), flutter::CanvasImage::image(), fml::MakeCopyable(), fml::TaskRunner::PostTask(), and tonic::ToDart().

Referenced by flutter::testing::TEST_F(), and flutter::CanvasImage::toByteData().

252  {
253  if (!canvas_image) {
254  return ToDart("encode called with non-genuine Image.");
255  }
256 
257  if (!Dart_IsClosure(callback_handle)) {
258  return ToDart("Callback must be a function.");
259  }
260 
261  ImageByteFormat image_format = static_cast<ImageByteFormat>(format);
262 
263  auto callback = std::make_unique<DartPersistentValue>(
264  tonic::DartState::Current(), callback_handle);
265 
266  const auto& task_runners = UIDartState::Current()->GetTaskRunners();
267 
268  task_runners.GetIOTaskRunner()->PostTask(fml::MakeCopyable(
269  [callback = std::move(callback), image = canvas_image->image(),
270  image_format, ui_task_runner = task_runners.GetUITaskRunner(),
271  raster_task_runner = task_runners.GetRasterTaskRunner(),
272  io_task_runner = task_runners.GetIOTaskRunner(),
273  io_manager = UIDartState::Current()->GetIOManager(),
274  snapshot_delegate =
275  UIDartState::Current()->GetSnapshotDelegate()]() mutable {
276  EncodeImageAndInvokeDataCallback(
277  std::move(image), std::move(callback), image_format,
278  std::move(ui_task_runner), std::move(raster_task_runner),
279  std::move(io_task_runner), io_manager->GetResourceContext().get(),
280  std::move(snapshot_delegate));
281  }));
282 
283  return Dart_Null();
284 }
static DartState * Current()
Definition: dart_state.cc:55
internal::CopyableLambda< T > MakeCopyable(T lambda)
Definition: make_copyable.h:57
Dart_Handle ToDart(const T &object)

◆ EncodeTextBoxes()

static tonic::Float32List flutter::EncodeTextBoxes ( const std::vector< txt::Paragraph::TextBox > &  boxes)
static

Definition at line 98 of file paragraph.cc.

References txt::Paragraph::TextBox::direction, and txt::Paragraph::TextBox::rect.

Referenced by flutter::Paragraph::getRectsForPlaceholders(), and flutter::Paragraph::getRectsForRange().

99  {
100  // Layout:
101  // First value is the number of values.
102  // Then there are boxes.size() groups of 5 which are LTRBD, where D is the
103  // text direction index.
104  tonic::Float32List result(
105  Dart_NewTypedData(Dart_TypedData_kFloat32, boxes.size() * 5));
106  uint64_t position = 0;
107  for (uint64_t i = 0; i < boxes.size(); i++) {
108  const txt::Paragraph::TextBox& box = boxes[i];
109  result[position++] = box.rect.fLeft;
110  result[position++] = box.rect.fTop;
111  result[position++] = box.rect.fRight;
112  result[position++] = box.rect.fBottom;
113  result[position++] = static_cast<float>(box.direction);
114  }
115  return result;
116 }
TextDirection direction
Definition: paragraph.h:81

◆ FirstSupportedColorType()

static SkColorType flutter::FirstSupportedColorType ( GrDirectContext *  context,
GrGLenum *  format 
)
static

Definition at line 141 of file gpu_surface_gl.cc.

References GPU_GL_RGB565, GPU_GL_RGBA4, GPU_GL_RGBA8, and RETURN_IF_RENDERABLE.

Referenced by WrapOnscreenSurface().

142  {
143 #define RETURN_IF_RENDERABLE(x, y) \
144  if (context->colorTypeSupportedAsSurface((x))) { \
145  *format = (y); \
146  return (x); \
147  }
148  RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GPU_GL_RGBA8);
149  RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GPU_GL_RGBA4);
150  RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GPU_GL_RGB565);
151  return kUnknown_SkColorType;
152 }
#define RETURN_IF_RENDERABLE(x, y)
#define GPU_GL_RGBA4
#define GPU_GL_RGB565
#define GPU_GL_RGBA8

◆ FlagForSwitch()

const std::string_view flutter::FlagForSwitch ( Switch  swtch)

Definition at line 147 of file switches.cc.

References SwitchDesc::sw.

Referenced by GetSwitchValue(), main(), and SettingsFromCommandLine().

147  {
148  for (uint32_t i = 0; i < static_cast<uint32_t>(Switch::Sentinel); i++) {
149  if (gSwitchDescs[i].sw == swtch) {
150  return gSwitchDescs[i].flag;
151  }
152  }
153  return std::string_view();
154 }

◆ FlutterStandardDataTypeForField()

FlutterStandardDataType flutter::FlutterStandardDataTypeForField ( FlutterStandardField  field)

Definition at line 32 of file FlutterStandardCodec_Internal.h.

32  {
33  return (FlutterStandardDataType)(field - FlutterStandardFieldUInt8Data);
34 }

◆ FlutterStandardFieldForDataType()

FlutterStandardField flutter::FlutterStandardFieldForDataType ( FlutterStandardDataType  type)

Definition at line 29 of file FlutterStandardCodec_Internal.h.

29  {
30  return (FlutterStandardField)(type + FlutterStandardFieldUInt8Data);
31 }

◆ FlutterTextUtilsIsEmoji()

static jboolean flutter::FlutterTextUtilsIsEmoji ( JNIEnv *  env,
jobject  obj,
jint  codePoint 
)
static

Definition at line 482 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi().

484  {
485  return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
486 }

◆ FlutterTextUtilsIsEmojiModifier()

static jboolean flutter::FlutterTextUtilsIsEmojiModifier ( JNIEnv *  env,
jobject  obj,
jint  codePoint 
)
static

Definition at line 488 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi().

490  {
491  return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
492 }

◆ FlutterTextUtilsIsEmojiModifierBase()

static jboolean flutter::FlutterTextUtilsIsEmojiModifierBase ( JNIEnv *  env,
jobject  obj,
jint  codePoint 
)
static

Definition at line 494 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi().

496  {
497  return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
498 }

◆ FlutterTextUtilsIsRegionalIndicator()

static jboolean flutter::FlutterTextUtilsIsRegionalIndicator ( JNIEnv *  env,
jobject  obj,
jint  codePoint 
)
static

Definition at line 506 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi().

508  {
509  return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
510 }

◆ FlutterTextUtilsIsVariationSelector()

static jboolean flutter::FlutterTextUtilsIsVariationSelector ( JNIEnv *  env,
jobject  obj,
jint  codePoint 
)
static

Definition at line 500 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi().

502  {
503  return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
504 }

◆ FxlToDartOrEarlier()

static int64_t flutter::FxlToDartOrEarlier ( fml::TimePoint  time)
static

◆ GetBitmap()

static jobject flutter::GetBitmap ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder 
)
static

Definition at line 279 of file platform_view_android_jni_impl.cc.

References ANDROID_SHELL_HOLDER, fml::swap(), and flutter::Rasterizer::UncompressedImage.

Referenced by RegisterApi().

279  {
280  auto screenshot = ANDROID_SHELL_HOLDER->Screenshot(
281  Rasterizer::ScreenshotType::UncompressedImage, false);
282  if (screenshot.data == nullptr) {
283  return nullptr;
284  }
285 
286  const SkISize& frame_size = screenshot.frame_size;
287  jsize pixels_size = frame_size.width() * frame_size.height();
288  jintArray pixels_array = env->NewIntArray(pixels_size);
289  if (pixels_array == nullptr) {
290  return nullptr;
291  }
292 
293  jint* pixels = env->GetIntArrayElements(pixels_array, nullptr);
294  if (pixels == nullptr) {
295  return nullptr;
296  }
297 
298  auto* pixels_src = static_cast<const int32_t*>(screenshot.data->data());
299 
300  // Our configuration of Skia does not support rendering to the
301  // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap.
302  // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888).
303  for (int i = 0; i < pixels_size; i++) {
304  int32_t src_pixel = pixels_src[i];
305  uint8_t* src_bytes = reinterpret_cast<uint8_t*>(&src_pixel);
306  std::swap(src_bytes[0], src_bytes[2]);
307  pixels[i] = src_pixel;
308  }
309 
310  env->ReleaseIntArrayElements(pixels_array, pixels, 0);
311 
312  jclass bitmap_class = env->FindClass("android/graphics/Bitmap");
313  if (bitmap_class == nullptr) {
314  return nullptr;
315  }
316 
317  jmethodID create_bitmap = env->GetStaticMethodID(
318  bitmap_class, "createBitmap",
319  "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
320  if (create_bitmap == nullptr) {
321  return nullptr;
322  }
323 
324  jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config");
325  if (bitmap_config_class == nullptr) {
326  return nullptr;
327  }
328 
329  jmethodID bitmap_config_value_of = env->GetStaticMethodID(
330  bitmap_config_class, "valueOf",
331  "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
332  if (bitmap_config_value_of == nullptr) {
333  return nullptr;
334  }
335 
336  jstring argb = env->NewStringUTF("ARGB_8888");
337  if (argb == nullptr) {
338  return nullptr;
339  }
340 
341  jobject bitmap_config = env->CallStaticObjectMethod(
342  bitmap_config_class, bitmap_config_value_of, argb);
343  if (bitmap_config == nullptr) {
344  return nullptr;
345  }
346 
347  return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array,
348  frame_size.width(), frame_size.height(),
349  bitmap_config);
350 }
#define ANDROID_SHELL_HOLDER
void swap(scoped_nsprotocol< C > &p1, scoped_nsprotocol< C > &p2)

◆ GetCallbackFromHandle()

void flutter::GetCallbackFromHandle ( Dart_NativeArguments  args)

Definition at line 360 of file dart_runtime_hooks.cc.

References flutter::DartCallbackCache::GetCallback().

360  {
361  Dart_Handle h = Dart_GetNativeArgument(args, 0);
362  int64_t handle = DartConverter<int64_t>::FromDart(h);
363  Dart_SetReturnValue(args, DartCallbackCache::GetCallback(handle));
364 }
G_BEGIN_DECLS FlValue * args

◆ GetCallbackHandle()

void flutter::GetCallbackHandle ( Dart_NativeArguments  args)

Definition at line 341 of file dart_runtime_hooks.cc.

References flutter::DartCallbackCache::GetCallbackHandle(), GetFunctionClassName(), GetFunctionLibraryUrl(), GetFunctionName(), and name.

Referenced by flutter::DartCallbackCache::GetCachePath().

341  {
342  Dart_Handle func = Dart_GetNativeArgument(args, 0);
343  std::string name = GetFunctionName(func);
344  std::string class_name = GetFunctionClassName(func);
345  std::string library_path = GetFunctionLibraryUrl(func);
346 
347  // `name` is empty if `func` can't be used as a callback. This is the case
348  // when `func` is not a function object or is not a static function. Anonymous
349  // closures (e.g. `(int a, int b) => a + b;`) also cannot be used as
350  // callbacks, so `func` must be a tear-off of a named static function.
351  if (!Dart_IsTearOff(func) || name.empty()) {
352  Dart_SetReturnValue(args, Dart_Null());
353  return;
354  }
355  Dart_SetReturnValue(
357  name, class_name, library_path)));
358 }
G_BEGIN_DECLS FlValue * args
static std::string GetFunctionLibraryUrl(Dart_Handle closure)
static std::string GetFunctionName(Dart_Handle func)
static std::string GetFunctionClassName(Dart_Handle closure)
void GetCallbackHandle(Dart_NativeArguments args)
const char * name
Definition: fuchsia.cc:50

◆ GetCATransform3DFromSkMatrix()

CATransform3D flutter::GetCATransform3DFromSkMatrix ( const SkMatrix &  matrix)

Definition at line 36 of file FlutterPlatformViews_Internal.mm.

References transform.

Referenced by flutter::FlutterPlatformViewsController::GetCurrentCanvases.

36  {
37  // Skia only supports 2D transform so we don't map z.
38  CATransform3D transform = CATransform3DIdentity;
39  transform.m11 = matrix.getScaleX();
40  transform.m21 = matrix.getSkewX();
41  transform.m41 = matrix.getTranslateX();
42  transform.m14 = matrix.getPerspX();
43 
44  transform.m12 = matrix.getSkewY();
45  transform.m22 = matrix.getScaleY();
46  transform.m42 = matrix.getTranslateY();
47  transform.m24 = matrix.getPerspY();
48  return transform;
49 }

◆ GetCoreAnimationLayerClassForRenderingAPI()

Class flutter::GetCoreAnimationLayerClassForRenderingAPI ( IOSRenderingAPI  rendering_api)

Definition at line 58 of file rendering_api_selection.mm.

References FML_CHECK, kMetal, kOpenGLES, kSoftware, and METAL_IOS_VERSION_BASELINE.

58  {
59  switch (rendering_api) {
61  return [CALayer class];
62  case IOSRenderingAPI::kOpenGLES:
63  return [CAEAGLLayer class];
64  case IOSRenderingAPI::kMetal:
65  if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
66  return [CAMetalLayer class];
67  }
68  FML_CHECK(false) << "Metal availability should already have been checked";
69  break;
70  default:
71  break;
72  }
73  FML_CHECK(false) << "Unknown client rendering API";
74  return [CALayer class];
75 }
#define METAL_IOS_VERSION_BASELINE
#define FML_CHECK(condition)
Definition: logging.h:68

◆ GetCurrentThreadTaskRunner()

static fml::RefPtr<fml::TaskRunner> flutter::GetCurrentThreadTaskRunner ( )
static

Definition at line 106 of file embedder_thread_host.cc.

References fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::MessageLoop::GetCurrent(), and fml::MessageLoop::GetTaskRunner().

106  {
109 }
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
Definition: message_loop.cc:19
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: message_loop.cc:56

◆ GetDartVersion()

const char * flutter::GetDartVersion ( )

Definition at line 19 of file version.cc.

Referenced by PrintUsage().

19  {
20  return DART_VERSION;
21 }

◆ GetDefaultPlatformData()

static PlatformData flutter::GetDefaultPlatformData ( )
static

Definition at line 25 of file android_shell_holder.cc.

References flutter::PlatformData::lifecycle_state.

Referenced by flutter::AndroidShellHolder::AndroidShellHolder().

25  {
26  PlatformData platform_data;
27  platform_data.lifecycle_state = "AppLifecycleState.detached";
28  return platform_data;
29 }

◆ GetDpiForHWND()

UINT flutter::GetDpiForHWND ( HWND  hwnd)

Returns the DPI for |hwnd|. Supports all DPI awareness modes, and is backward compatible down to Windows Vista. If |hwnd| is nullptr, returns the DPI for the primary monitor. If Per-Monitor DPI awareness is not available, returns the system's DPI.

Definition at line 126 of file win32_dpi_utils.cc.

Referenced by FlutterDesktopGetDpiForHWND(), flutter::Win32Window::HandleMessage(), flutter::testing::TEST(), and flutter::Win32Window::Win32Window().

126  {
127  return GetHelper()->GetDpiForWindow(hwnd);
128 }

◆ GetDpiForMonitor()

UINT flutter::GetDpiForMonitor ( HMONITOR  monitor)

Returns the DPI of a given monitor. Defaults to 96 if the API is not available.

Definition at line 130 of file win32_dpi_utils.cc.

Referenced by FlutterDesktopGetDpiForMonitor(), and flutter::testing::TEST().

130  {
131  return GetHelper()->GetDpiForMonitor(monitor);
132 }

◆ GetExecutableDirectory()

std::filesystem::path flutter::GetExecutableDirectory ( )

Definition at line 16 of file path_utils.cc.

References length, and path.

Referenced by flutter::FlutterProjectBundle::FlutterProjectBundle(), RunFlutterEngine(), and TEST().

16  {
17 #if defined(_WIN32)
18  wchar_t buffer[MAX_PATH];
19  if (GetModuleFileName(nullptr, buffer, MAX_PATH) == 0) {
20  return std::filesystem::path();
21  }
22  std::filesystem::path executable_path(buffer);
23  return executable_path.remove_filename();
24 #elif defined(__linux__)
25  char buffer[PATH_MAX + 1];
26  ssize_t length = readlink("/proc/self/exe", buffer, sizeof(buffer));
27  if (length > PATH_MAX) {
28  return std::filesystem::path();
29  }
30  std::filesystem::path executable_path(std::string(buffer, length));
31  return executable_path.remove_filename();
32 #else
33  return std::filesystem::path();
34 #endif
35 }
DEF_SWITCHES_START snapshot asset path
Definition: switches.h:32
size_t length

◆ GetFileMapping()

static std::unique_ptr<const fml::Mapping> flutter::GetFileMapping ( const std::string &  path,
bool  executable 
)
static

Definition at line 32 of file dart_snapshot.cc.

References fml::FileMapping::CreateReadExecute(), and fml::FileMapping::CreateReadOnly().

Referenced by SearchMapping().

34  {
35  if (executable) {
37  } else {
39  }
40 }
DEF_SWITCHES_START snapshot asset path
Definition: switches.h:32
static std::unique_ptr< FileMapping > CreateReadExecute(const std::string &path)
Definition: mapping.cc:42
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
Definition: mapping.cc:18

◆ GetFlutterEngineVersion()

const char * flutter::GetFlutterEngineVersion ( )

Definition at line 11 of file version.cc.

References FLUTTER_ENGINE_VERSION.

Referenced by PrintUsage(), flutter::PersistentCache::Purge(), and flutter::testing::TEST_F().

11  {
13 }
#define FLUTTER_ENGINE_VERSION
Definition: embedder.h:63

◆ GetFontFile()

const std::string & flutter::GetFontFile ( )

Definition at line 20 of file flow_test_utils.cc.

References gFontFile.

20  {
21  return gFontFile;
22 }
static std::string gFontFile

◆ GetFunctionClassName()

static std::string flutter::GetFunctionClassName ( Dart_Handle  closure)
static

Definition at line 290 of file dart_runtime_hooks.cc.

References PropagateIfError().

Referenced by GetCallbackHandle().

290  {
291  Dart_Handle result;
292 
293  if (Dart_IsClosure(closure)) {
294  closure = Dart_ClosureFunction(closure);
296  }
297 
298  if (!Dart_IsFunction(closure)) {
299  return "";
300  }
301 
302  bool is_static = false;
303  result = Dart_FunctionIsStatic(closure, &is_static);
304  PropagateIfError(result);
305  if (!is_static) {
306  return "";
307  }
308 
309  result = Dart_FunctionOwner(closure);
310  PropagateIfError(result);
311 
312  if (Dart_IsLibrary(result) || !Dart_IsInstance(result)) {
313  return "";
314  }
315  return DartConverter<std::string>::FromDart(Dart_ClassName(result));
316 }
static void PropagateIfError(Dart_Handle result)
std::function< void()> closure
Definition: closure.h:14

◆ GetFunctionLibraryUrl()

static std::string flutter::GetFunctionLibraryUrl ( Dart_Handle  closure)
static

Definition at line 268 of file dart_runtime_hooks.cc.

References PropagateIfError().

Referenced by GetCallbackHandle().

268  {
269  if (Dart_IsClosure(closure)) {
270  closure = Dart_ClosureFunction(closure);
272  }
273 
274  if (!Dart_IsFunction(closure)) {
275  return "";
276  }
277 
278  Dart_Handle url = Dart_Null();
279  Dart_Handle owner = Dart_FunctionOwner(closure);
280  if (Dart_IsInstance(owner)) {
281  owner = Dart_ClassLibrary(owner);
282  }
283  if (Dart_IsLibrary(owner)) {
284  url = Dart_LibraryUrl(owner);
285  PropagateIfError(url);
286  }
288 }
static void PropagateIfError(Dart_Handle result)
std::function< void()> closure
Definition: closure.h:14

◆ GetFunctionName()

static std::string flutter::GetFunctionName ( Dart_Handle  func)
static

Definition at line 318 of file dart_runtime_hooks.cc.

References PropagateIfError().

Referenced by GetCallbackHandle().

318  {
319  if (Dart_IsClosure(func)) {
320  func = Dart_ClosureFunction(func);
321  PropagateIfError(func);
322  }
323 
324  if (!Dart_IsFunction(func)) {
325  return "";
326  }
327 
328  bool is_static = false;
329  Dart_Handle result = Dart_FunctionIsStatic(func, &is_static);
330  PropagateIfError(result);
331  if (!is_static) {
332  return "";
333  }
334 
335  result = Dart_FunctionName(func);
336  PropagateIfError(result);
337 
339 }
static void PropagateIfError(Dart_Handle result)

◆ GetGoldenDir()

const std::string & flutter::GetGoldenDir ( )

Definition at line 12 of file flow_test_utils.cc.

References gGoldenDir.

12  {
13  return gGoldenDir;
14 }
static std::string gGoldenDir

◆ GetIsSoftwareRendering()

static jboolean flutter::GetIsSoftwareRendering ( JNIEnv *  env,
jobject  jcaller 
)
static

Definition at line 421 of file platform_view_android_jni_impl.cc.

References flutter::Settings::enable_software_rendering, flutter::FlutterMain::Get(), and flutter::FlutterMain::GetSettings().

Referenced by RegisterApi().

421  {
422  return FlutterMain::Get().GetSettings().enable_software_rendering;
423 }

◆ GetMappingFromNSData()

std::unique_ptr< fml::Mapping > flutter::GetMappingFromNSData ( NSData *  data)

Definition at line 18 of file buffer_conversions.mm.

References GetVectorFromNSData().

Referenced by flutter::PlatformMessageRouter::HandlePlatformMessage().

18  {
19  return std::make_unique<fml::DataMapping>(GetVectorFromNSData(data));
20 }
std::vector< uint8_t > GetVectorFromNSData(NSData *data)

◆ GetNextPipelineTraceID()

size_t flutter::GetNextPipelineTraceID ( )

Definition at line 9 of file pipeline.cc.

Referenced by flutter::Pipeline< R >::Produce(), and flutter::Pipeline< R >::ProduceIfEmpty().

9  {
10  static std::atomic_size_t PipelineLastTraceID = {0};
11  return ++PipelineLastTraceID;
12 }

◆ GetNSDataFromMapping()

NSData * flutter::GetNSDataFromMapping ( std::unique_ptr< fml::Mapping mapping)

Definition at line 22 of file buffer_conversions.mm.

References length.

Referenced by flutter::PlatformMessageResponseDarwin::Complete().

22  {
23  return [NSData dataWithBytes:mapping->GetMapping() length:mapping->GetSize()];
24 }
size_t length

◆ GetNSDataFromVector()

NSData * flutter::GetNSDataFromVector ( const std::vector< uint8_t > &  buffer)

Definition at line 14 of file buffer_conversions.mm.

References length.

Referenced by flutter::PlatformMessageRouter::HandlePlatformMessage().

14  {
15  return [NSData dataWithBytes:buffer.data() length:buffer.size()];
16 }
size_t length

◆ GetPreferredLanguageInfo()

std::vector< LanguageInfo > flutter::GetPreferredLanguageInfo ( )

Definition at line 15 of file system_utils_win32.cc.

References GetPreferredLanguages(), and ParseLanguageName().

Referenced by flutter::FlutterWindowsEngine::HandlePlatformMessage(), and flutter::testing::TEST().

15  {
16  std::vector<std::wstring> languages = GetPreferredLanguages();
17  std::vector<LanguageInfo> language_info;
18  language_info.reserve(languages.size());
19 
20  for (auto language : languages) {
21  language_info.push_back(ParseLanguageName(language));
22  }
23  return language_info;
24 }
std::vector< std::wstring > GetPreferredLanguages()
LanguageInfo ParseLanguageName(std::wstring language_name)

◆ GetPreferredLanguages()

std::vector< std::wstring > flutter::GetPreferredLanguages ( )

Definition at line 26 of file system_utils_win32.cc.

References flags.

Referenced by GetPreferredLanguageInfo(), and flutter::testing::TEST().

26  {
27  std::vector<std::wstring> languages;
28  DWORD flags = MUI_LANGUAGE_NAME | MUI_UI_FALLBACK;
29 
30  // Get buffer length.
31  ULONG count = 0;
32  ULONG buffer_size = 0;
33  if (!::GetThreadPreferredUILanguages(flags, &count, nullptr, &buffer_size)) {
34  return languages;
35  }
36 
37  // Get the list of null-separated languages.
38  std::wstring buffer(buffer_size, '\0');
39  if (!::GetThreadPreferredUILanguages(flags, &count, buffer.data(),
40  &buffer_size)) {
41  return languages;
42  }
43 
44  // Extract the individual languages from the buffer.
45  size_t start = 0;
46  while (true) {
47  // The buffer is terminated by an empty string (i.e., a double null).
48  if (buffer[start] == L'\0') {
49  break;
50  }
51  // Read the next null-terminated language.
52  std::wstring language(buffer.c_str() + start);
53  if (language.size() == 0) {
54  break;
55  }
56  languages.push_back(language);
57  // Skip past that language and its terminating null in the buffer.
58  start += language.size() + 1;
59  }
60  return languages;
61 }
DEF_SWITCHES_START snapshot asset Path to the directory containing the four files specified by VmSnapshotInstructions and IsolateSnapshotInstructions vm snapshot The VM instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present isolate snapshot The isolate instructions snapshot that will be memory mapped as read and executable SnapshotAssetPath must be present icu symbol Prefix for the symbols representing ICU data linked into the Flutter library dart flags
Definition: switches.h:66

◆ GetRenderingAPIForProcess()

IOSRenderingAPI flutter::GetRenderingAPIForProcess ( bool  force_software)

Definition at line 30 of file rendering_api_selection.mm.

References FML_LOG, kMetal, kOpenGLES, and kSoftware.

Referenced by FlutterEngine::destroyContext.

30  {
31 #if TARGET_OS_SIMULATOR
32  if (force_software) {
34  }
35 #else
36  if (force_software) {
37  FML_LOG(WARNING) << "The --enable-software-rendering is only supported on Simulator targets "
38  "and will be ignored.";
39  }
40 #endif // TARGET_OS_SIMULATOR
41 
42 #if FLUTTER_SHELL_ENABLE_METAL
43  static bool should_use_metal = ShouldUseMetalRenderer();
44  if (should_use_metal) {
45  return IOSRenderingAPI::kMetal;
46  }
47 #endif // FLUTTER_SHELL_ENABLE_METAL
48 
49  // OpenGL will be emulated using software rendering by Apple on the simulator, so we use the
50  // Skia software rendering since it performs a little better than the emulated OpenGL.
51 #if TARGET_OS_SIMULATOR
53 #else
54  return IOSRenderingAPI::kOpenGLES;
55 #endif // TARGET_OS_SIMULATOR
56 }
#define FML_LOG(severity)
Definition: logging.h:65

◆ GetSkiaVersion()

const char * flutter::GetSkiaVersion ( )

Definition at line 15 of file version.cc.

Referenced by PrintUsage(), flutter::PersistentCache::Purge(), and flutter::testing::TEST_F().

15  {
16  return SKIA_VERSION;
17 }

◆ GetSwitchesFromEnvironment()

std::vector< std::string > flutter::GetSwitchesFromEnvironment ( )

Definition at line 14 of file engine_switches.cc.

Referenced by fl_dart_project_get_switches(), flutter::FlutterProjectBundle::GetSwitches(), and TEST().

14  {
15  std::vector<std::string> switches;
16  // Read engine switches from the environment in debug/profile. If release mode
17  // support is needed in the future, it should likely use a whitelist.
18 #ifndef FLUTTER_RELEASE
19  const char* switch_count_key = "FLUTTER_ENGINE_SWITCHES";
20  const int kMaxSwitchCount = 50;
21  const char* switch_count_string = std::getenv(switch_count_key);
22  int switch_count = std::min(
23  kMaxSwitchCount, switch_count_string ? atoi(switch_count_string) : 0);
24  for (int i = 1; i <= switch_count; ++i) {
25  std::ostringstream switch_key;
26  switch_key << "FLUTTER_ENGINE_SWITCH_" << i;
27  const char* switch_value = std::getenv(switch_key.str().c_str());
28  if (switch_value) {
29  std::ostringstream switch_value_as_flag;
30  switch_value_as_flag << "--" << switch_value;
31  switches.push_back(switch_value_as_flag.str());
32  } else {
33  std::cerr << switch_count << " keys expected from " << switch_count_key
34  << ", but " << switch_key.str() << " is missing." << std::endl;
35  }
36  }
37 #endif // !FLUTTER_RELEASE
38  return switches;
39 }

◆ GetSwitchValue()

template<typename T >
static bool flutter::GetSwitchValue ( const fml::CommandLine command_line,
Switch  sw,
T *  result 
)
static

Definition at line 170 of file switches.cc.

References FlagForSwitch(), fml::CommandLine::GetOptionValue(), and value.

Referenced by SettingsFromCommandLine().

172  {
173  std::string switch_string;
174 
175  if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) {
176  return false;
177  }
178 
179  std::stringstream stream(switch_string);
180  T value = 0;
181  if (stream >> value) {
182  *result = value;
183  return true;
184  }
185 
186  return false;
187 }
bool GetOptionValue(std::string_view name, std::string *value) const
Definition: command_line.cc:51
const std::string_view FlagForSwitch(Switch swtch)
Definition: switches.cc:147
uint8_t value

◆ GetSymbolMapping()

std::unique_ptr<fml::Mapping> flutter::GetSymbolMapping ( std::string  symbol_prefix,
std::string  native_lib_path 
)

Definition at line 189 of file switches.cc.

References fml::NativeLibrary::Create(), fml::NativeLibrary::CreateForCurrentProcess(), FML_CHECK, and fml::size().

Referenced by SettingsFromCommandLine().

190  {
191  const uint8_t* mapping;
192  intptr_t size;
193 
194  auto lookup_symbol = [&mapping, &size, symbol_prefix](
195  const fml::RefPtr<fml::NativeLibrary>& library) {
196  mapping = library->ResolveSymbol((symbol_prefix + "_start").c_str());
197  size = reinterpret_cast<intptr_t>(
198  library->ResolveSymbol((symbol_prefix + "_size").c_str()));
199  };
200 
203  lookup_symbol(library);
204 
205  if (!(mapping && size)) {
206  // Symbol lookup for the current process fails on some devices. As a
207  // fallback, try doing the lookup based on the path to the Flutter library.
208  library = fml::NativeLibrary::Create(native_lib_path.c_str());
209  lookup_symbol(library);
210  }
211 
212  FML_CHECK(mapping && size) << "Unable to resolve symbols: " << symbol_prefix;
213  return std::make_unique<fml::NonOwnedMapping>(mapping, size);
214 }
static fml::RefPtr< NativeLibrary > CreateForCurrentProcess()
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
static fml::RefPtr< NativeLibrary > Create(const char *path)
#define FML_CHECK(condition)
Definition: logging.h:68

◆ GetTestFontData()

std::vector< std::unique_ptr< SkStreamAsset > > flutter::GetTestFontData ( )

Definition at line 1375 of file test_font_data.cc.

References kAhemFont, kAhemFontLength, kCoughFont, and kCoughFontLength.

Referenced by flutter::FontCollection::RegisterTestFonts().

1375  {
1376  std::vector<std::unique_ptr<SkStreamAsset>> data;
1377  if (kAhemFontLength == 0) {
1378  data.push_back(nullptr);
1379  } else {
1380  data.push_back(std::make_unique<SkMemoryStream>(kAhemFont, kAhemFontLength,
1381  false /* copy data */));
1382  }
1383 
1384  if (kCoughFontLength == 0) {
1385  data.push_back(nullptr);
1386  } else {
1387  data.push_back(std::make_unique<SkMemoryStream>(
1388  kCoughFont, kCoughFontLength, false /* copy data */));
1389  }
1390  return data;
1391 }
static const unsigned int kCoughFontLength
static const unsigned char kCoughFont[]
static const unsigned int kAhemFontLength
static const unsigned char kAhemFont[]

◆ GetTestFontFamilyName()

std::string flutter::GetTestFontFamilyName ( )

Definition at line 1393 of file test_font_data.cc.

1393  {
1394  return "Ahem";
1395 }

◆ GetTestFontFamilyNames()

std::vector< std::string > flutter::GetTestFontFamilyNames ( )

Definition at line 1397 of file test_font_data.cc.

Referenced by flutter::FontCollection::RegisterTestFonts().

1397  {
1398  std::vector<std::string> names = {"Ahem", "Cough"};
1399&#