Flutter Engine
The Flutter Engine
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
flutter Namespace Reference

Namespaces

namespace  egl
 
namespace  gpu
 
namespace  internal
 
namespace  math
 
namespace  runtime
 
namespace  testing
 

Classes

class  AccessibilityBridge
 
class  AccessibilityBridgeIos
 Interface that represents an accessibility bridge for iOS. More...
 
class  AccessibilityBridgeMac
 
class  AccessibilityBridgeWindows
 
class  AccessibilityPlugin
 
class  AccumulationRect
 
class  AlertPlatformNodeDelegate
 
class  AndroidContext
 Holds state that is shared across Android surfaces. More...
 
class  AndroidContextGLImpeller
 
class  AndroidContextGLSkia
 
class  AndroidContextVulkanImpeller
 
class  AndroidDisplay
 A |Display| that listens to refresh rate changes. More...
 
class  AndroidEGLSurface
 
class  AndroidEGLSurfaceDamage
 
class  AndroidEnvironmentGL
 
class  AndroidExternalViewEmbedder
 
class  AndroidImageGenerator
 
class  AndroidNativeWindow
 
class  AndroidShellHolder
 This is the Android owner of the core engine Shell. More...
 
class  AndroidSnapshotSurfaceProducer
 
class  AndroidSurface
 
class  AndroidSurfaceFactory
 
class  AndroidSurfaceFactoryImpl
 
class  AndroidSurfaceGLImpeller
 
class  AndroidSurfaceGLSkia
 
class  AndroidSurfaceMock
 
class  AndroidSurfaceSoftware
 
class  AndroidSurfaceVulkanImpeller
 
class  Animator
 
class  APKAssetMapping
 
class  APKAssetProvider
 
class  APKAssetProviderImpl
 
class  APKAssetProviderInternal
 
class  APNGImageGenerator
 
class  AppSnapshotIsolateConfiguration
 
class  AssetManager
 
class  AssetManagerFontProvider
 
class  AssetManagerFontStyleSet
 
class  AssetResolver
 
class  AutoCache
 
class  BackdropFilterEntry
 
class  BackdropFilterLayer
 
struct  BackingStoreLayer
 
struct  Base64
 
class  BasicMessageChannel
 
class  BinaryMessenger
 
class  BinaryMessengerImpl
 
class  BuiltinSkiaCodecImageGenerator
 
class  BuiltinSkiaImageGenerator
 
class  ByteBufferStreamReader
 
class  ByteBufferStreamWriter
 
class  ByteStreamReader
 
class  ByteStreamWriter
 
class  CacheableContainerLayer
 
class  Canvas
 
class  CanvasGradient
 
class  CanvasImage
 
class  CanvasPath
 
class  CanvasPathMeasure
 
class  CanvasSpy
 
class  ClipPathEntry
 
class  ClipPathLayer
 
class  ClipRectEntry
 
class  ClipRectLayer
 
class  ClipRRectEntry
 
class  ClipRRectLayer
 
class  ClipShapeLayer
 
class  Codec
 
class  ColorFilter
 
class  ColorFilterEntry
 
class  ColorFilterLayer
 
class  ComplexityCalculatorHelper
 
class  Compositor
 
class  CompositorContext
 
class  CompositorOpenGL
 
class  CompositorSoftware
 
class  ConnectionCollection
 Maintains a current integer assigned to a name (connections). More...
 
class  ContainerLayer
 
class  ContextListener
 
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  Culler
 
class  CursorHandler
 
struct  CustomAccessibilityAction
 
class  CustomEncodableValue
 
struct  Damage
 
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  DartTimestampProvider
 TimestampProvider implementation that is backed by Dart_TimelineGetTicks. 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
 
struct  DecompressResult
 
class  DefaultPointerDataDispatcher
 
class  DidDrawCanvas
 
class  DiffContext
 
class  DirectManipulationEventHandler
 
class  DirectManipulationOwner
 
class  DirectoryAssetBundle
 
struct  DispatchContext
 
class  Display
 
struct  DisplayData
 
class  DisplayList
 
class  DisplayListAttributeFlags
 
class  DisplayListBuilder
 
class  DisplayListComplexityCalculator
 
class  DisplayListEmbedderViewSlice
 
class  DisplayListFlags
 
class  DisplayListFlagsBase
 
class  DisplayListGLComplexityCalculator
 
class  DisplayListLayer
 
class  DisplayListMatrixClipState
 
class  DisplayListMetalComplexityCalculator
 
class  DisplayListNaiveComplexityCalculator
 
class  DisplayListOpFlags
 
class  DisplayListRasterCacheItem
 
class  DisplayListSpecialGeometryFlags
 
class  DisplayListStorage
 
class  DisplayManager
 Manages lifecycle of the connected displays. This class is thread-safe. More...
 
class  DlAttribute
 
class  DlAutoCanvasRestore
 
class  DlBlendColorFilter
 
class  DlBlurImageFilter
 
class  DlBlurMaskFilter
 
class  DlCanvas
 Developer-facing API for rendering anything within the engine. More...
 
class  DlCanvasDelegate
 
struct  DlColor
 
class  DlColorColorSource
 
class  DlColorFilter
 
class  DlColorFilterImageFilter
 
class  DlColorSource
 
class  DlComposeImageFilter
 
class  DlConicalGradientColorSource
 
class  DlDeferredImageGPUImpeller
 
class  DlDeferredImageGPUSkia
 
class  DlDilateImageFilter
 
class  DlErodeImageFilter
 
class  DlGradientColorSourceBase
 
class  DlImage
 Represents an image whose allocation is (usually) resident on device memory. More...
 
class  DlImageColorSource
 
class  DlImageFilter
 
class  DlImageGPU
 
class  DlImageSkia
 
class  DlLinearGradientColorSource
 
class  DlLinearToSrgbGammaColorFilter
 
class  DlLocalMatrixImageFilter
 
class  DlMaskFilter
 
class  DlMatrixColorFilter
 
class  DlMatrixColorSourceBase
 
class  DlMatrixImageFilter
 
struct  DLOp
 
class  DlOpReceiver
 Internal API for rendering recorded display lists to backends. More...
 
class  DlOpSpy
 
class  DlPaint
 
class  DlRadialGradientColorSource
 
class  DlRegion
 
class  DlRTree
 
class  DlRuntimeEffect
 
class  DlRuntimeEffectColorSource
 
class  DlRuntimeEffectImpeller
 
class  DlRuntimeEffectSkia
 
class  DlSkCanvasAdapter
 Backend implementation of |DlCanvas| for |SkCanvas|. More...
 
class  DlSkCanvasDispatcher
 Backend implementation of |DlOpReceiver| for |SkCanvas|. More...
 
class  DlSkPaintDispatchHelper
 
class  DlSrgbToLinearGammaColorFilter
 
class  DlStopwatchVisualizer
 
class  DlSweepGradientColorSource
 
class  DlVertexPainter
 Provides canvas-like painting methods that actually build vertices. More...
 
class  DlVertices
 Holds all of the data (both required and optional) for a DisplayList drawVertices call. More...
 
struct  DrawArcOp
 
struct  DrawAtlasBaseOp
 
struct  DrawAtlasCulledOp
 
struct  DrawAtlasOp
 
struct  DrawColorOp
 
struct  DrawDashedLineOp
 
struct  DrawDisplayListOp
 
struct  DrawImageRectOp
 
struct  DrawOpBase
 
struct  DrawPaintOp
 
struct  DrawPathOp
 
struct  DrawTextBlobOp
 
struct  DrawTextFrameOp
 
struct  DrawVerticesOp
 
class  DummyDelegate
 
class  EmbeddedViewParams
 
class  EmbedderEngine
 
class  EmbedderExternalTextureGL
 
class  EmbedderExternalTextureMetal
 
class  EmbedderExternalTextureResolver
 
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  EmbedderRenderTargetImpeller
 
class  EmbedderRenderTargetSkia
 
class  EmbedderResources
 
class  EmbedderSemanticsUpdate
 
class  EmbedderSemanticsUpdate2
 
class  EmbedderSurface
 
class  EmbedderSurfaceGLImpeller
 
class  EmbedderSurfaceGLSkia
 
class  EmbedderSurfaceMetalImpeller
 
class  EmbedderSurfaceMetalSkia
 
class  EmbedderSurfaceSoftware
 
class  EmbedderSurfaceVulkan
 
class  EmbedderTaskRunner
 
class  EmbedderThreadHost
 
class  EmbedderViewSlice
 
class  EncodableValue
 
class  Engine
 
class  EngineLayer
 
class  EngineMethodResult
 
class  EngineModifier
 
class  EventChannel
 
class  EventLoop
 
class  EventSink
 
class  EventWatcher
 
class  ExternalTexture
 
class  ExternalTextureD3d
 
class  ExternalTexturePixelBuffer
 
class  ExternalViewEmbedder
 
class  FixedRefreshRateStopwatch
 Used for fixed refresh rate cases. More...
 
class  FixedRefreshRateUpdater
 Used for fixed refresh rate query cases. More...
 
class  Fixture
 
class  FlutterCompositor
 
class  FlutterDesktopMessenger
 
class  FlutterEngine
 
class  FlutterEventTracer
 
class  FlutterGpuTestClass
 
class  FlutterMain
 
class  FlutterPlatformNodeDelegate
 
class  FlutterPlatformNodeDelegateMac
 
class  FlutterPlatformNodeDelegateWindows
 
struct  FlutterPlatformViewLayer
 
class  FlutterPlatformViewLayerPool
 
class  FlutterPlatformViewsController
 
class  FlutterProjectBundle
 
class  FlutterSkiaVulkanMemoryAllocator
 
class  FlutterTextPlatformNode
 The ax platform node for a text field. More...
 
class  FlutterView
 
class  FlutterViewController
 
class  FlutterWindow
 
class  FlutterWindowController
 
class  FlutterWindowsEngine
 
class  FlutterWindowsTextureRegistrar
 
class  FlutterWindowsView
 
class  FlutterWindowsViewController
 Controls a view that displays Flutter content. More...
 
class  FontCollection
 
class  FragmentProgram
 
class  FrameDamage
 
struct  FrameItem
 
class  FrameTiming
 
class  FrameTimingsRecorder
 
class  GLContextDefaultResult
 
class  GLContextResult
 
class  GLContextSwitch
 
struct  GLFBOInfo
 
struct  GLFrameInfo
 
class  GLFWEventLoop
 
struct  GLPresentInfo
 
struct  GPUMTLTextureInfo
 
class  GPUSurfaceGLDelegate
 
class  GPUSurfaceGLImpeller
 
class  GPUSurfaceGLSkia
 
class  GPUSurfaceMetalDelegate
 Interface implemented by all platform surfaces that can present a metal 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  GPUSurfaceMetalImpeller
 
class  GPUSurfaceMetalSkia
 
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  GpuSurfaceTexture
 
class  GPUSurfaceVulkan
 A GPU surface backed by VkImages provided by a GPUSurfaceVulkanDelegate. More...
 
class  GPUSurfaceVulkanDelegate
 Interface implemented by all platform surfaces that can present a Vulkan 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 Vulkan backing store. More...
 
class  GPUSurfaceVulkanImpeller
 
struct  GpuUsageInfo
 Polled information related to the usage of the GPU. More...
 
class  GTestActivity
 A native activity subclass an in implementation of flutter::NativeActivityMain that return it. More...
 
class  HeadlessEventLoop
 
class  IgnoreAttributeDispatchHelper
 
class  IgnoreClipDispatchHelper
 
class  IgnoreDrawDispatchHelper
 
class  IgnoreTransformDispatchHelper
 
class  ImageDecoder
 
class  ImageDecoderImpeller
 
class  ImageDecoderSkia
 
class  ImageDescriptor
 Creates an image descriptor for encoded or decoded image data, describing the width, height, and bytes per pixel for that image. This class will hold a reference on the underlying image data, and in the case of compressed data, an ImageGenerator for the data. The Codec initialization actually happens in initEncoded, making initstantiateCodec a lightweight operation. More...
 
class  ImageEncodingImpeller
 
class  ImageExternalTexture
 
class  ImageExternalTextureGL
 
class  ImageExternalTextureGLImpeller
 
class  ImageExternalTextureGLSkia
 
class  ImageExternalTextureVK
 
class  ImageFilter
 
class  ImageFilterEntry
 
class  ImageFilterLayer
 
class  ImageFilterMutation
 
class  ImageGenerator
 The minimal interface necessary for defining a decoder that can be used for both single and multi-frame image decoding. Image generators can also optionally support decoding into a subscaled buffer. Implementers of ImageGenerator regularly keep internal state which is not thread safe, and so aliasing and parallel access should never be done with ImageGenerators. More...
 
class  ImageGeneratorRegistry
 Keeps a priority-ordered registry of image generator builders to be used when decoding images. This object must be created, accessed, and collected on the UI thread (typically the engine or its runtime controller). More...
 
class  ImageLRU
 
struct  ImageMetaData
 
class  ImageShader
 
class  ImmContext
 
class  ImmutableBuffer
 
class  ImpellerAllocator
 
class  IncomingMessageDispatcher
 
class  IntegralTransformEntry
 
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 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  IOSContextMetalImpeller
 
class  IOSContextMetalSkia
 
class  IOSContextSoftware
 
class  IOSExternalTextureMetal
 
class  IOSExternalViewEmbedder
 
class  IOSSurface
 
class  IOSSurfaceMetalImpeller
 
class  IOSSurfaceMetalSkia
 
class  IOSSurfaceSoftware
 
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  KeyboardHandlerBase
 
class  KeyboardHookHandler
 
class  KeyboardKeyChannelHandler
 
class  KeyboardKeyEmbedderHandler
 
class  KeyboardKeyHandler
 
class  KeyboardManager
 
struct  KeyData
 
class  KeyDataPacket
 
class  KeyEventHandler
 
struct  LanguageInfo
 
class  Layer
 
class  LayerRasterCacheItem
 
class  LayerSnapshotData
 
class  LayerSnapshotStore
 Collects snapshots of layers during frame rasterization. More...
 
class  LayerStateStack
 
class  LayerTree
 
struct  LayerTreeTask
 
struct  LayoutClue
 
struct  LayoutGoal
 
struct  LocaleStringAttribute
 
struct  MemoryUsageInfo
 Memory usage stats. dirty_memory_usage is 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 physical memory for shared memory, including loaded frameworks and executables. On iOS, it's physical memory - dirty memory. More...
 
class  MessageCodec
 
class  MethodCall
 
class  MethodChannel
 
class  MethodCodec
 
class  MethodResult
 
class  MethodResultFunctions
 
class  MockPlatformViewManager
 
class  MultiFrameCodec
 
class  Mutator
 
class  MutatorsStack
 
class  NativeActivity
 An instance of a native activity. Users of the native_activity_apk are meant to subclass this and return an instance of this subclass from flutter::NativeActivityMain. More...
 
class  NativeStringAttribute
 The peer class for all of the StringAttribute subclasses in semantics.dart. More...
 
class  NopCuller
 
class  OffscreenSurface
 
class  OpacityEntry
 
class  OpacityLayer
 
struct  OverlayLayer
 
class  Paint
 
struct  PaintContext
 
class  PaintData
 
class  PaintRegion
 
class  Paragraph
 
class  ParagraphBuilder
 
struct  PathData
 
class  PerformanceOverlayLayer
 
class  PersistentCache
 
struct  PhysicalWindowBounds
 
class  Picture
 
class  PictureRecorder
 
class  Pipeline
 
struct  PipelineProduceResult
 
class  PixelBufferTexture
 
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...
 
class  PlatformConfigurationNativeApi
 
struct  PlatformData
 
class  PlatformHandler
 
class  PlatformIsolateManager
 
class  PlatformIsolateNativeApi
 
class  PlatformMessage
 
class  PlatformMessageHandler
 
class  PlatformMessageHandlerAndroid
 
class  PlatformMessageHandlerIos
 
class  PlatformMessageHandlerStorage
 
class  PlatformMessageResponse
 
class  PlatformMessageResponseAndroid
 
class  PlatformMessageResponseDart
 
class  PlatformMessageResponseDartPort
 A PlatformMessageResponse that will respond over a Dart port. More...
 
class  PlatformMessageResponseDarwin
 
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
 Represents a platform view layer, including all mutations. More...
 
class  PlatformViewManager
 
class  PlatformViewPlugin
 
class  Plugin
 
class  PluginRegistrar
 
class  PluginRegistrarGlfw
 
class  PluginRegistrarManager
 
class  PluginRegistrarWindows
 
class  PluginRegistry
 
class  Point
 
struct  PointerData
 
class  PointerDataDispatcher
 
class  PointerDataPacket
 
class  PointerDataPacketConverter
 
struct  PointerLocation
 
struct  PointerState
 
class  PointExtensionSerializer
 
struct  PrerollContext
 
class  PrerollDelegate
 
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  RasterCacheItem
 
class  RasterCacheKey
 
class  RasterCacheKeyID
 
struct  RasterCacheMetrics
 
class  RasterCacheResult
 
struct  RasterCacheUtil
 
class  Rasterizer
 
class  ReactorWorker
 
class  Rect
 
class  RefCountedDartWrappable
 
class  ResourceCacheLimitCalculator
 
class  ResourceCacheLimitItem
 
struct  RestoreOp
 
class  ReusableFragmentShader
 
struct  RotateOp
 
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 Dart VM Service timeline. More...
 
class  SaveEntry
 
struct  SaveLayerBackdropOp
 
class  SaveLayerEntry
 
struct  SaveLayerOp
 
struct  SaveLayerOpBase
 
class  SaveLayerOptions
 
struct  SaveOp
 
struct  SaveOpBase
 
struct  ScaleOp
 
class  Scene
 
class  SceneBuilder
 
class  SceneNode
 A scene node, which may be a deserialized ipscene asset. This node can be safely added as a child to multiple scene nodes, whether they're in the same scene or a different scene. The deserialized node itself is treated as immutable on the IO thread. More...
 
class  SceneShader
 
class  ScopedClipboardInterface
 
class  ScriptCompletionTaskObserver
 
struct  SemanticsNode
 
class  SemanticsUpdate
 
class  SemanticsUpdateBuilder
 
class  SequentialIdGenerator
 
class  ServiceProtocol
 
struct  SetBlendModeOp
 
struct  SetColorOp
 
struct  SetImageColorSourceOp
 
struct  SetRuntimeEffectColorSourceOp
 
struct  SetSharedImageFilterOp
 
struct  SetStrokeMiterOp
 
struct  SetStrokeWidthOp
 
struct  SetStyleOp
 
struct  Settings
 
class  SettingsPlugin
 
class  Shader
 
class  ShaderMaskLayer
 
class  Shell
 
struct  ShellArgs
 
class  ShellIOManager
 
class  ShellTestExternalViewEmbedder
 The external view embedder used by |ShellTestPlatformViewGL|. More...
 
class  SingleFrameCodec
 
class  Size
 
struct  SkewOp
 
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  SkOptionalPaint
 
class  SkStopwatchVisualizer
 
class  SmoothPointerDataDispatcher
 
class  SnapshotController
 
class  SnapshotControllerImpeller
 
class  SnapshotControllerSkia
 
class  SnapshotDelegate
 
class  SnapshotSurfaceProducer
 
class  SomeData
 
class  SomeDataExtensionSerializer
 
struct  SpellOutStringAttribute
 
class  StandardCodecSerializer
 
class  StandardMessageCodec
 
class  StandardMethodCodec
 
class  Stopwatch
 
class  StopwatchVisualizer
 Abstract class for visualizing (i.e. drawing) a stopwatch. More...
 
class  StreamHandler
 
struct  StreamHandlerError
 
class  StreamHandlerFunctions
 
struct  StringAttribute
 
class  Surface
 Abstract Base Class that represents where we will be rendering content. More...
 
class  SurfaceFrame
 
class  SurfacePool
 
class  SurfaceTextureExternalTexture
 
class  SurfaceTextureExternalTextureGL
 
class  SurfaceTextureExternalTextureImpellerGL
 
class  SwitchableGLContext
 
class  TaskRunner
 
class  TaskRunners
 
class  TaskRunnerWindow
 
class  TestAccessibilityBridge
 
class  TestBinaryMessenger
 
class  TestCustomValue
 
class  TesterExternalViewEmbedder
 
class  TesterGPUSurfaceSoftware
 
class  TesterPlatformView
 
class  TestMetalContext
 
class  TestMetalSurface
 Creates a MTLTexture backed SkSurface and context that can be used to render to in unit-tests. More...
 
class  TestMetalSurfaceImpl
 
struct  TextEditingDelta
 A change in the state of an input field. More...
 
class  TextInputManager
 
class  TextInputModel
 
class  TextInputPlugin
 
class  TextRange
 
class  Texture
 
class  TextureLayer
 
class  TextureRegistrar
 
class  TextureRegistrarImpl
 
class  TextureRegistry
 
struct  ThreadHost
 The collection of all the threads used by the engine. More...
 
class  ThreadSnapshot
 
struct  Transform2DAffineOp
 
struct  TransformClipOpBase
 
struct  TransformFullPerspectiveOp
 
class  TransformLayer
 
class  TransformM44Entry
 
class  TransformMatrixEntry
 
struct  TransformResetOp
 
class  TranslateEntry
 
struct  TranslateOp
 
class  UIDartState
 
class  UnrefQueue
 
class  VariableRefreshRateDisplay
 A Display where the refresh rate can change over time. More...
 
class  VariableRefreshRateReporter
 
class  VectorCuller
 
class  Vertices
 
class  ViewModifier
 
struct  ViewportMetrics
 
class  VolatilePathTracker
 
class  VsyncWaiter
 
class  VsyncWaiterAndroid
 
class  VsyncWaiterEmbedder
 
class  VsyncWaiterFallback
 A |VsyncWaiter| that will fire at 60 fps irrespective of the vsync. More...
 
class  VsyncWaiterIOS
 
class  WindowBindingHandler
 
class  WindowBindingHandlerDelegate
 
struct  WindowFrame
 
class  WindowProcDelegateManager
 
struct  WindowProperties
 
class  WindowsLifecycleManager
 
class  WindowsProcTable
 

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 LogMessageCallback = std::function< void(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 Flags = DlVertices::Builder::Flags
 
using DlScalar = impeller::Scalar
 
using DlDegrees = impeller::Degrees
 
using DlRadians = impeller::Radians
 
using DlPoint = impeller::Point
 
using DlIPoint = impeller::IPoint32
 
using DlSize = impeller::Size
 
using DlISize = impeller::ISize32
 
using DlRect = impeller::Rect
 
using DlIRect = impeller::IRect32
 
using DlMatrix = impeller::Matrix
 
using PaintRegionMap = std::map< uint64_t, PaintRegion >
 
using MutatorContext = LayerStateStack::MutatorContext
 
using SkiaUnrefQueue = UnrefQueue< GrDirectContext >
 
typedef CanvasImage Image
 
typedef CanvasPathMeasure PathMeasure
 
typedef CanvasGradient Gradient
 
typedef CanvasPath Path
 
using ImageGeneratorFactory = std::function< std::shared_ptr< ImageGenerator >(sk_sp< SkData > buffer)>
 ImageGeneratorFactory is the top level primitive for specifying an image decoder in Flutter. When called, it should return an ImageGenerator that typically compatible with the given input data. More...
 
using CustomAccessibilityActionUpdates = std::unordered_map< int32_t, CustomAccessibilityAction >
 
using SemanticsNodeUpdates = std::unordered_map< int32_t, SemanticsNode >
 
using StringAttributePtr = std::shared_ptr< flutter::StringAttribute >
 
using StringAttributes = std::vector< StringAttributePtr >
 
using ChildIsolatePreparer = std::function< bool(DartIsolate *)>
 
typedef size_t DisplayId
 
using PointerDataDispatcherMaker = std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)>
 Signature for constructing PointerDataDispatcher. More...
 
using FramePipeline = Pipeline< FrameItem >
 
using ThreadConfig = fml::Thread::ThreadConfig
 
using ThreadConfigSetter = fml::Thread::ThreadConfigSetter
 
typedef void * GPUMTLDeviceHandle
 
typedef void * GPUMTLCommandQueueHandle
 
typedef void * GPUCAMetalLayerHandle
 
typedef const void * GPUMTLTextureHandle
 
typedef void(* GPUMTLDestructionCallback) (void *)
 
template<class T >
using EGLResult = std::pair< bool, T >
 
using HardwareBufferKey = uint64_t
 
using JavaLocalRef = 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()>
 
typedef std::variant< PixelBufferTexture, GpuSurfaceTextureTextureVariant
 
typedef ui::AXNode::AXID AccessibilityNodeId
 
using ProductVersion = std::tuple< int32_t, int32_t, int32_t >
 
using LayerVariant = std::variant< PlatformViewLayer, BackingStoreLayer >
 
typedef void(^ KeyboardLayoutNotifier) ()
 
using FlutterViewId = int64_t
 
using WindowProcDelegate = std::function< std::optional< LRESULT >(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)>
 
using UniqueAotDataPtr = std::unique_ptr< _FlutterEngineAOTData, FlutterEngineCollectAOTDataFnPtr >
 
typedef uint64_t(* CurrentTimeProc) ()
 
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 class  AndroidRenderingAPI { kSoftware , kImpellerOpenGLES , kImpellerVulkan , kSkiaOpenGLES }
 
enum class  DisplayListOpType
 
enum class  DlBlendMode {
  kClear , kSrc , kDst , kSrcOver ,
  kDstOver , kSrcIn , kDstIn , kSrcOut ,
  kDstOut , kSrcATop , kDstATop , kXor ,
  kPlus , kModulate , kScreen , kOverlay ,
  kDarken , kLighten , kColorDodge , kColorBurn ,
  kHardLight , kSoftLight , kDifference , kExclusion ,
  kMultiply , kHue , kSaturation , kColor ,
  kLuminosity , kLastCoeffMode = kScreen , kLastSeparableMode , kLastMode = kLuminosity ,
  kDefaultMode = kSrcOver
}
 
enum class  DisplayListCompare { kUseBulkCompare , kNotEqual , kEqual }
 
enum class  DlDrawStyle {
  kFill , kStroke , kStrokeAndFill , kLastStyle = kStrokeAndFill ,
  kDefaultStyle = kFill
}
 
enum class  DlStrokeCap {
  kButt , kRound , kSquare , kLastCap = kSquare ,
  kDefaultCap = kButt
}
 
enum class  DlStrokeJoin {
  kMiter , kRound , kBevel , kLastJoin = kBevel ,
  kDefaultJoin = kMiter
}
 
enum class  DlFilterMode { kNearest , kLinear , kLast = kLinear }
 
enum class  DlImageSampling { kNearestNeighbor , kLinear , kMipmapLinear , kCubic }
 
enum class  DlTileMode { kClamp , kRepeat , kMirror , kDecal }
 
enum class  DlVertexMode { kTriangles , kTriangleStrip , kTriangleFan }
 Defines the way in which the vertices of a DlVertices object are separated into triangles into which to render. More...
 
enum class  DlColorFilterType { kBlend , kMatrix , kSrgbToLinearGamma , kLinearToSrgbGamma }
 
enum class  DlColorSourceType {
  kColor , kImage , kLinearGradient , kRadialGradient ,
  kConicalGradient , kSweepGradient , kRuntimeEffect
}
 
enum class  DlImageFilterType {
  kBlur , kDilate , kErode , kMatrix ,
  kCompose , kColorFilter , kLocalMatrix
}
 
enum class  DlMaskFilterType { kBlur }
 
enum class  DlBlurStyle { kNormal , kSolid , kOuter , kInner }
 
enum class  RasterStatus { kSuccess , kResubmit , kSkipAndRetry }
 
enum  MutatorType {
  kClipRect , kClipRRect , kClipPath , kTransform ,
  kOpacity , kBackdropFilter
}
 
enum class  PostPrerollResult { kSuccess , kResubmitFrame , kSkipAndRetryFrame }
 
enum  Clip { kNone , kHardEdge , kAntiAlias , kAntiAliasWithSaveLayer }
 
enum class  RasterCacheLayerStrategy { kLayer , kLayerChildren }
 
enum class  RasterCacheKeyType { kLayer , kDisplayList , kLayerChildren }
 
enum class  RasterCacheKeyKind { kLayerMetrics , kDisplayListMetrics }
 
enum  ColorSpace { kSRGB , kExtendedSRGB }
 
enum  ImageByteFormat {
  kRawRGBA , kRawStraightRGBA , kRawUnmodified , kRawExtendedRgba128 ,
  kPNG
}
 
enum  MaskFilterType { kNull , kBlur }
 
enum class  SemanticsAction : int32_t {
  kTap = 1 << 0 , kLongPress = 1 << 1 , kScrollLeft = 1 << 2 , kScrollRight = 1 << 3 ,
  kScrollUp = 1 << 4 , kScrollDown = 1 << 5 , kIncrease = 1 << 6 , kDecrease = 1 << 7 ,
  kShowOnScreen = 1 << 8 , kMoveCursorForwardByCharacter = 1 << 9 , kMoveCursorBackwardByCharacter = 1 << 10 , kSetSelection = 1 << 11 ,
  kCopy = 1 << 12 , kCut = 1 << 13 , kPaste = 1 << 14 , kDidGainAccessibilityFocus = 1 << 15 ,
  kDidLoseAccessibilityFocus = 1 << 16 , kCustomAction = 1 << 17 , kDismiss = 1 << 18 , kMoveCursorForwardByWord = 1 << 19 ,
  kMoveCursorBackwardByWord = 1 << 20 , kSetText = 1 << 21 , kFocus = 1 << 22
}
 
enum class  SemanticsFlags : int32_t {
  kHasCheckedState = 1 << 0 , kIsChecked = 1 << 1 , kIsSelected = 1 << 2 , kIsButton = 1 << 3 ,
  kIsTextField = 1 << 4 , kIsFocused = 1 << 5 , kHasEnabledState = 1 << 6 , kIsEnabled = 1 << 7 ,
  kIsInMutuallyExclusiveGroup = 1 << 8 , kIsHeader = 1 << 9 , kIsObscured = 1 << 10 , kScopesRoute = 1 << 11 ,
  kNamesRoute = 1 << 12 , kIsHidden = 1 << 13 , kIsImage = 1 << 14 , kIsLiveRegion = 1 << 15 ,
  kHasToggledState = 1 << 16 , kIsToggled = 1 << 17 , kHasImplicitScrolling = 1 << 18 , kIsMultiline = 1 << 19 ,
  kIsReadOnly = 1 << 20 , kIsFocusable = 1 << 21 , kIsLink = 1 << 22 , kIsSlider = 1 << 23 ,
  kIsKeyboardKey = 1 << 24 , kIsCheckStateMixed = 1 << 25 , kHasExpandedState = 1 << 26 , kIsExpanded = 1 << 27
}
 
enum class  StringAttributeType : int32_t { kSpellOut , kLocale }
 
enum class  KeyEventType : int64_t { kDown = 0 , kUp , kRepeat }
 
enum class  KeyEventDeviceType : int64_t {
  kKeyboard = 0 , kDirectionalPad , kGamepad , kJoystick ,
  kHdmi
}
 
enum class  AccessibilityFeatureFlag : int32_t {
  kAccessibleNavigation = 1 << 0 , kInvertColors = 1 << 1 , kDisableAnimations = 1 << 2 , kBoldText = 1 << 3 ,
  kReduceMotion = 1 << 4 , kHighContrast = 1 << 5 , kOnOffSwitchLabels = 1 << 6
}
 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 class  IsolateLaunchType { kNewGroup , kExistingGroup }
 
enum class  TracingResult { kNotAttempted , kEnabled , kNotNecessary = kEnabled , kDisabled }
 
enum class  ContextType { kRender , kResource }
 
enum class  PipelineConsumeResult { NoneAvailable , Done , MoreAvailable }
 
enum class  DrawStatus {
  kDone , kNotSetUp , kYielded , kPipelineEmpty ,
  kGpuUnavailable
}
 
enum class  DrawSurfaceStatus { kSuccess , kRetry , kFailed , kDiscarded }
 
enum class  DartErrorCode { NoError = 0 , ApiError = 253 , CompilationError = 254 , UnknownError = 255 }
 Error exit codes for the Dart isolate. More...
 
enum class  GpuAvailability { kAvailable = 0 , kFlushAndMakeUnavailable = 1 , kUnavailable = 2 }
 Values for |Shell::SetGpuAvailability|. More...
 
enum class  MTLRenderTargetType { kMTLTexture , kCAMetalLayer }
 
enum class  AndroidEGLSurfaceMakeCurrentStatus { kSuccessAlreadyCurrent , kSuccessMadeCurrent , kFailure }
 Result of calling MakeCurrent on AndroidEGLSurface. More...
 
enum class  AppLifecycleState {
  kDetached , kResumed , kInactive , kHidden ,
  kPaused
}
 
enum class  PlatformProvidedMenu {
  kAbout , kQuit , kServicesSubmenu , kHide ,
  kHideOtherApplications , kShowAllApplications , kStartSpeaking , kStopSpeaking ,
  kToggleFullScreen , kMinimizeWindow , kZoomWindow , kArrangeWindowsInFront
}
 
enum class  IOSRenderingAPI { kSoftware , kMetal }
 
enum class  IOSRenderingBackend { kSkia , kImpeller }
 
enum  ModifierFlag {
  kModifierFlagControlLeft = 0x1 , kModifierFlagShiftLeft = 0x2 , kModifierFlagShiftRight = 0x4 , kModifierFlagMetaLeft = 0x8 ,
  kModifierFlagMetaRight = 0x10 , kModifierFlagAltLeft = 0x20 , kModifierFlagAltRight = 0x40 , kModifierFlagControlRight = 0x200
}
 
enum class  AppExitType { required , cancelable }
 
enum class  FocusChangeDirection { kProgrammatic , kForward , kBackward }
 
enum class  WindowStateEvent { kShow , kHide , kFocus , kUnfocus }
 An event representing a change in window state that may update the. More...
 

Functions

sk_sp< SkDataParseBase32 (const std::string &input)
 
sk_sp< SkDataParseBase64 (const std::string &input)
 
static void PersistentCacheStore (const fml::RefPtr< fml::TaskRunner > &worker, const std::shared_ptr< fml::UniqueFD > &cache_directory, std::string key, std::unique_ptr< fml::Mapping > value)
 
DlOpReceiverDisplayListBuilderBenchmarkAccessor (DisplayListBuilder &builder)
 
static void BM_DisplayListBuilderDefault (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithScaleAndTranslate (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithPerspective (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithClipRect (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithGlobalSaveLayer (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithSaveLayer (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
static void BM_DisplayListBuilderWithSaveLayerAndImageFilter (benchmark::State &state, DisplayListBuilderBenchmarkType type)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderDefault, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderDefault, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderDefault, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderDefault, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithScaleAndTranslate, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithScaleAndTranslate, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithScaleAndTranslate, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithScaleAndTranslate, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithPerspective, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithPerspective, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithPerspective, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithPerspective, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithClipRect, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithClipRect, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithClipRect, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithClipRect, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithGlobalSaveLayer, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithGlobalSaveLayer, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithGlobalSaveLayer, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithGlobalSaveLayer, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayer, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayer, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayer, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayer, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayerAndImageFilter, kDefault, DisplayListBuilderBenchmarkType::kDefault) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayerAndImageFilter, kBounds, DisplayListBuilderBenchmarkType::kBounds) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayerAndImageFilter, kRtree, DisplayListBuilderBenchmarkType::kRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListBuilderWithSaveLayerAndImageFilter, kBoundsAndRtree, DisplayListBuilderBenchmarkType::kBoundsAndRtree) -> Unit(benchmark::kMicrosecond)
 
static void BM_DlRegion_FromRects (benchmark::State &state, int maxSize)
 
static void BM_SkRegion_FromRects (benchmark::State &state, int maxSize)
 
static void BM_DlRegion_GetRects (benchmark::State &state, int maxSize)
 
static void BM_SkRegion_GetRects (benchmark::State &state, int maxSize)
 
static void BM_DlRegion_Operation (benchmark::State &state, RegionOp op, bool withSingleRect, int maxSize, double sizeFactor)
 
static void BM_SkRegion_Operation (benchmark::State &state, RegionOp op, bool withSingleRect, int maxSize, double sizeFactor)
 
static void BM_DlRegion_IntersectsRegion (benchmark::State &state, int maxSize, double sizeFactor)
 
static void BM_SkRegion_IntersectsRegion (benchmark::State &state, int maxSize, double sizeFactor)
 
static void BM_DlRegion_IntersectsSingleRect (benchmark::State &state, int maxSize)
 
static void BM_SkRegion_IntersectsSingleRect (benchmark::State &state, int maxSize)
 
 Unit (benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_IntersectsRegion, TinyAsymmetric, 30, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_IntersectsRegion, TinyAsymmetric, 30, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_IntersectsRegion, SmallAsymmetric, 100, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_IntersectsRegion, SmallAsymmetric, 100, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_IntersectsRegion, MediumAsymmetric, 400, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_IntersectsRegion, MediumAsymmetric, 400, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_IntersectsRegion, LargeAsymmetric, 1500, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_IntersectsRegion, LargeAsymmetric, 1500, kSizeFactorSmall) -> Unit(benchmark::kNanosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_Tiny, RegionOp::kUnion, false, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_Tiny, RegionOp::kUnion, false, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_Small, RegionOp::kUnion, false, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_Small, RegionOp::kUnion, false, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_Medium, RegionOp::kUnion, false, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_Medium, RegionOp::kUnion, false, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_Large, RegionOp::kUnion, false, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_Large, RegionOp::kUnion, false, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_TinyAsymmetric, RegionOp::kUnion, false, 30, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_TinyAsymmetric, RegionOp::kUnion, false, 30, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_SmallAsymmetric, RegionOp::kUnion, false, 100, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_SmallAsymmetric, RegionOp::kUnion, false, 100, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_MediumAsymmetric, RegionOp::kUnion, false, 400, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_MediumAsymmetric, RegionOp::kUnion, false, 400, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Union_LargeAsymmetric, RegionOp::kUnion, false, 1500, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Union_LargeAsymmetric, RegionOp::kUnion, false, 1500, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_Tiny, RegionOp::kIntersection, false, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_Tiny, RegionOp::kIntersection, false, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_Small, RegionOp::kIntersection, false, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_Small, RegionOp::kIntersection, false, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_Medium, RegionOp::kIntersection, false, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_Medium, RegionOp::kIntersection, false, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_Large, RegionOp::kIntersection, false, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_Large, RegionOp::kIntersection, false, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_TinyAsymmetric, RegionOp::kIntersection, false, 30, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_TinyAsymmetric, RegionOp::kIntersection, false, 30, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_SmallAsymmetric, RegionOp::kIntersection, false, 100, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_SmallAsymmetric, RegionOp::kIntersection, false, 100, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_MediumAsymmetric, RegionOp::kIntersection, false, 400, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_MediumAsymmetric, RegionOp::kIntersection, false, 400, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_LargeAsymmetric, RegionOp::kIntersection, false, 1500, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_LargeAsymmetric, RegionOp::kIntersection, false, 1500, kSizeFactorSmall) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_SingleRect_Tiny, RegionOp::kIntersection, true, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_SingleRect_Tiny, RegionOp::kIntersection, true, 30, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_SingleRect_Small, RegionOp::kIntersection, true, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_SingleRect_Small, RegionOp::kIntersection, true, 100, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_SingleRect_Medium, RegionOp::kIntersection, true, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_SingleRect_Medium, RegionOp::kIntersection, true, 400, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DlRegion_Operation, Intersection_SingleRect_Large, RegionOp::kIntersection, true, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_SkRegion_Operation, Intersection_SingleRect_Large, RegionOp::kIntersection, true, 1500, 1.0) -> Unit(benchmark::kMicrosecond)
 
 Unit (benchmark::kMicrosecond)
 
static void BM_AdapterDispatchOverhead (benchmark::State &state, AdapterType type)
 
static void BM_SetIdentity (benchmark::State &state, AdapterType type)
 
static void BM_SetPerspective (benchmark::State &state, AdapterType type)
 
static void BM_Translate (benchmark::State &state, AdapterType type, float tx, float ty)
 
static void BM_Scale (benchmark::State &state, AdapterType type, float scale)
 
static void BM_Rotate (benchmark::State &state, AdapterType type, float radians)
 
static void BM_Concat (benchmark::State &state, AdapterType type, const SetupFunction &a_setup, const SetupFunction &b_setup)
 
static void BM_TransformPoint (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
static void BM_TransformPoints (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
static void BM_TransformRectFast (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
static void BM_TransformAndClipRect (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
static void BM_InvertUnchecked (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
static void BM_InvertAndCheck (benchmark::State &state, AdapterType type, const SetupFunction &setup)
 
 BENCHMARK_CAPTURE_ALL (BM_AdapterDispatchOverhead)
 
 BENCHMARK_CAPTURE_ALL (BM_SetIdentity)
 
 BENCHMARK_CAPTURE_ALL (BM_SetPerspective)
 
 BENCHMARK_CAPTURE_ALL_ARGS (BM_Translate, 10.0f, 15.0f)
 
 BENCHMARK_CAPTURE_ALL_ARGS (BM_Scale, 2.0f)
 
 BENCHMARK_CAPTURE_ALL_ARGS (BM_Rotate, kPiOver4)
 
 BENCHMARK_CAPTURE_ALL_SETUP2 (BM_Concat, Scale, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP2 (BM_Concat, ScaleTranslate, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP2 (BM_Concat, ScaleTranslate, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP2 (BM_Concat, ScaleTranslate, Perspective)
 
 BENCHMARK_CAPTURE_ALL_SETUP2 (BM_Concat, Perspective, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertUnchecked, Perspective)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_InvertAndCheck, Perspective)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoint, Perspective)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformPoints, Perspective)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, PerspectiveClipNone)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, PerspectiveClipOne)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, PerspectiveClipTwo)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, PerspectiveClipThree)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformRectFast, PerspectiveClipFour)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, Identity)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, Translate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, Scale)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, ScaleTranslate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, Rotate)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, PerspectiveClipNone)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, PerspectiveClipOne)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, PerspectiveClipTwo)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, PerspectiveClipThree)
 
 BENCHMARK_CAPTURE_ALL_SETUP (BM_TransformAndClipRect, PerspectiveClipFour)
 
static bool CompareOps (const uint8_t *ptrA, const uint8_t *endA, const uint8_t *ptrB, const uint8_t *endB)
 
DlOpReceiverDisplayListBuilderTestingAccessor (DisplayListBuilder &builder)
 
DlPaint DisplayListBuilderTestingAttributes (DisplayListBuilder &builder)
 
int DisplayListBuilderTestingLastOpIndex (DisplayListBuilder &builder)
 
static void CopyV (void *dst)
 
template<typename S , typename... Rest>
static void CopyV (void *dst, const S *src, int n, Rest &&... rest)
 
static constexpr bool is_power_of_two (int value)
 
static const DlRectProtectEmpty (const SkRect &rect)
 
 DEFINE_DRAW_POINTS_OP (Points, kPoints)
 
 DEFINE_DRAW_POINTS_OP (Lines, kLines)
 
 DEFINE_DRAW_POINTS_OP (Polygon, kPolygon)
 
static void DlVerticesDeleter (void *p)
 
static size_t bytes_needed (int vertex_count, Flags flags, int index_count)
 
static SkRect compute_bounds (const SkPoint *points, int count)
 
static void store_points (char *dst, int offset, const float *src, int count)
 
static void DlGradientDeleter (void *p)
 
const DlPointToDlPoint (const SkPoint &point)
 
const DlRectToDlRect (const SkRect &rect)
 
const DlISizeToDlISize (const SkISize &size)
 
constexpr DlMatrix ToDlMatrix (const SkMatrix &matrix)
 
constexpr DlMatrix ToDlMatrix (const SkM44 &matrix)
 
const SkPointToSkPoint (const DlPoint &point)
 
const SkRectToSkRect (const DlRect &rect)
 
const SkISizeToSkISize (const DlISize &size)
 
constexpr SkMatrix ToSkMatrix (const DlMatrix &matrix)
 
constexpr SkM44 ToSkM44 (const DlMatrix &matrix)
 
SkPaint ToSk (const DlPaint &paint)
 
SkPaint ToStrokedSk (const DlPaint &paint)
 
SkPaint ToNonShaderSk (const DlPaint &paint)
 
sk_sp< SkShaderToSk (const DlColorSource *source)
 
sk_sp< SkImageFilterToSk (const DlImageFilter *filter)
 
sk_sp< SkColorFilterToSk (const DlColorFilter *filter)
 
sk_sp< SkMaskFilterToSk (const DlMaskFilter *filter)
 
sk_sp< SkVerticesToSk (const DlVertices *vertices)
 
SkBlendMode ToSk (DlBlendMode mode)
 
SkColor ToSk (DlColor color)
 
SkPaint::Style ToSk (DlDrawStyle style)
 
SkPaint::Cap ToSk (DlStrokeCap cap)
 
SkPaint::Join ToSk (DlStrokeJoin join)
 
SkTileMode ToSk (DlTileMode dl_mode)
 
SkBlurStyle ToSk (const DlBlurStyle blur_style)
 
SkFilterMode ToSk (const DlFilterMode filter_mode)
 
SkVertices::VertexMode ToSk (DlVertexMode dl_mode)
 
SkSamplingOptions ToSk (DlImageSampling sampling)
 
SkCanvas::SrcRectConstraint ToSk (DlCanvas::SrcRectConstraint constraint)
 
SkClipOp ToSk (DlCanvas::ClipOp op)
 
SkCanvas::PointMode ToSk (DlCanvas::PointMode mode)
 
sk_sp< SkShaderToSk (const std::shared_ptr< const DlColorSource > &source)
 
sk_sp< SkShaderToSk (const DlColorSource &source)
 
sk_sp< SkImageFilterToSk (const std::shared_ptr< const DlImageFilter > &filter)
 
sk_sp< SkImageFilterToSk (const DlImageFilter &filter)
 
sk_sp< SkColorFilterToSk (const std::shared_ptr< const DlColorFilter > &filter)
 
sk_sp< SkColorFilterToSk (const DlColorFilter &filter)
 
sk_sp< SkMaskFilterToSk (const std::shared_ptr< const DlMaskFilter > &filter)
 
sk_sp< SkMaskFilterToSk (const DlMaskFilter &filter)
 
sk_sp< SkVerticesToSk (const std::shared_ptr< const DlVertices > &vertices)
 
sk_sp< SkVerticesToSk (const DlVertices &vertices)
 
template<class T >
bool Equals (const T *a, const T *b)
 
template<class T >
bool Equals (std::shared_ptr< const T > a, const T *b)
 
template<class T >
bool Equals (const T *a, std::shared_ptr< const T > b)
 
template<class T >
bool Equals (std::shared_ptr< const T > a, std::shared_ptr< const T > b)
 
template<class T >
bool NotEquals (const T *a, const T *b)
 
template<class T >
bool NotEquals (std::shared_ptr< const T > a, const T *b)
 
template<class T >
bool NotEquals (const T *a, std::shared_ptr< const T > b)
 
template<class T >
bool NotEquals (std::shared_ptr< const T > a, std::shared_ptr< const T > b)
 
static const DlRectProtectEmpty (const SkRect &rect)
 
static const DlRectProtectEmpty (const DlRect &rect)
 
const std::string & GetGoldenDir ()
 
void SetGoldenDir (const std::string &dir)
 
const std::string & GetFontFile ()
 
void SetFontFile (const std::string &file)
 
 TEST (FrameTimingsRecorderTest, RecordVsync)
 
 TEST (FrameTimingsRecorderTest, RecordBuildTimes)
 
 TEST (FrameTimingsRecorderTest, RecordRasterTimes)
 
 TEST (FrameTimingsRecorderTest, RecordRasterTimesWithCache)
 
 TEST (FrameTimingsRecorderTest, ThrowWhenRecordBuildBeforeVsync)
 
 TEST (FrameTimingsRecorderTest, ThrowWhenRecordRasterBeforeBuildEnd)
 
 TEST (FrameTimingsRecorderTest, RecordersHaveUniqueFrameNumbers)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameFrameNumber)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameVsyncStartAndTarget)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameBuildStart)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameBuildEnd)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterStart)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterEnd)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterEndWithCache)
 
 TEST (FrameTimingsRecorderTest, FrameNumberTraceArgIsValid)
 
static bool safe_intersection_test (const SkRect *rect1, const SkRect &rect2)
 
static bool IsDisplayListWorthRasterizing (const DisplayList *display_list, bool will_change, bool is_complex, DisplayListComplexityCalculator *complexity_calculator)
 
bool Rasterize (RasterCacheItem::CacheState cache_state, Layer *layer, const PaintContext &paint_context, DlCanvas *canvas)
 
SkColorSpaceGetColorSpace (DlCanvas *canvas)
 
static sk_sp< SkSurfaceCreateSnapshotSurface (GrDirectContext *surface_context, const SkISize &size)
 
static sk_sp< SkDataGetRasterData (const sk_sp< SkSurface > &offscreen_surface, bool compressed)
 
void DrawCheckerboard (DlCanvas *canvas, const SkRect &rect)
 
 TEST (FlowTest, SurfaceFrameDoesNotSubmitInDtor)
 
 TEST (FlowTest, SurfaceFrameDoesNotHaveEmptyCanvas)
 
 TEST (FlowTest, SurfaceFrameDoesNotPrepareRtree)
 
 IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, FlutterGpuTestClass)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Scene)
 
static sk_sp< DlImageCreateDeferredImage (bool impeller, std::unique_ptr< LayerTree > layer_tree, fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate, fml::RefPtr< fml::TaskRunner > raster_task_runner, fml::RefPtr< SkiaUnrefQueue > unref_queue)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SceneBuilder)
 
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)
 
static std::string GetFunctionLibraryUrl (Dart_Handle closure)
 
static std::string GetFunctionClassName (Dart_Handle closure)
 
static std::string GetFunctionName (Dart_Handle func)
 
void DartPluginRegistrant_EnsureInitialized ()
 
static float SafeNarrow (double value)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Canvas)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Codec)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ColorFilter)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, EngineLayer)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, FragmentProgram)
 
static std::string RuntimeStageBackendToString (impeller::RuntimeStageBackend backend)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ReusableFragmentShader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Gradient)
 
static SkColorType ChooseCompatibleColorType (SkColorType type)
 
static SkAlphaType ChooseCompatibleAlphaType (SkAlphaType type)
 
static std::pair< sk_sp< DlImage >, std::string > UnsafeUploadTextureToPrivate (const std::shared_ptr< impeller::Context > &context, const std::shared_ptr< impeller::DeviceBuffer > &buffer, const SkImageInfo &image_info)
 Only call this method if the GPU is available. More...
 
static sk_sp< SkImageResizeRasterImage (const sk_sp< SkImage > &image, const SkISize &resized_dimensions, const fml::tracing::TraceFlow &flow)
 
static sk_sp< SkImageImageFromDecompressedData (ImageDescriptor *descriptor, uint32_t target_width, uint32_t target_height, const fml::tracing::TraceFlow &flow)
 
static SkiaGPUObject< SkImageUploadRasterImage (sk_sp< SkImage > image, const 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)
 
fml::StatusOr< sk_sp< SkData > > EncodeImage (const sk_sp< SkImage > &raster_image, ImageByteFormat format)
 
template<typename SyncSwitch >
sk_sp< SkImageConvertToRasterUsingResourceContext (const sk_sp< SkImage > &image, const fml::WeakPtr< GrDirectContext > &resource_context, const std::shared_ptr< const SyncSwitch > &is_gpu_disabled_sync_switch)
 
void ConvertImageToRasterSkia (const sk_sp< DlImage > &dl_image, std::function< void(sk_sp< SkImage >)> encode_task, const fml::RefPtr< fml::TaskRunner > &raster_task_runner, const fml::RefPtr< fml::TaskRunner > &io_task_runner, const fml::WeakPtr< GrDirectContext > &resource_context, const fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > &snapshot_delegate, const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImageFilter)
 
static SkImageInfo getInfoIncludingExif (SkCodec *codec)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImageShader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, ImmutableBuffer)
 
SkM44 ToSkM44 (const tonic::Float64List &matrix4)
 
SkMatrix ToSkMatrix (const tonic::Float64List &matrix4)
 
tonic::Float64List ToMatrix4 (const SkMatrix &sk_matrix)
 
static void InvokeNextFrameCallback (const fml::RefPtr< CanvasImage > &image, int duration, const std::string &decode_error, std::unique_ptr< tonic::DartPersistentValue > callback, size_t trace_id)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Path)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, PathMeasure)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Picture)
 
static sk_sp< DlImageCreateDeferredImage (bool impeller, sk_sp< DisplayList > display_list, uint32_t width, uint32_t height, fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate, fml::RefPtr< fml::TaskRunner > raster_task_runner, fml::RefPtr< SkiaUnrefQueue > unref_queue)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, PictureRecorder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SceneNode)
 
static impeller::Matrix ToMatrix (const tonic::Float64List &matrix4)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SceneShader)
 
static impeller::Matrix DefaultCameraTransform ()
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Shader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Vertices)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SemanticsUpdate)
 
void pushStringAttributes (StringAttributes &destination, const std::vector< NativeStringAttribute * > &native_attributes)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, SemanticsUpdateBuilder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, NativeStringAttribute)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Paragraph)
 
static tonic::Float32List EncodeTextBoxes (const std::vector< txt::Paragraph::TextBox > &boxes)
 
Dart_Handle glyphInfoFrom (Dart_Handle constructor, const skia::textlayout::Paragraph::GlyphInfo &glyphInfo)
 
 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)
 
void decodeFontVariations (Dart_Handle font_variations_data, txt::FontVariations &font_variations)
 
static void BM_PlatformMessageResponseDartComplete (benchmark::State &state)
 
static void BM_PathVolatilityTracker (benchmark::State &state)
 
 BENCHMARK (BM_PathVolatilityTracker) -> Unit(benchmark::kMillisecond)
 
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)
 
static void * NativeAssetsDlopenRelative (const char *path, char **error)
 
static void InitDartFFIForIsolateGroup ()
 
bool InvokeDartPluginRegistrantIfAvailable (Dart_Handle library_handle)
 
bool FindAndInvokeDartPluginRegistrant ()
 
 TEST (DartServiceIsolateTest, CanAddAndRemoveHandles)
 
static std::unique_ptr< const fml::MappingGetFileMapping (const std::string &path, bool executable)
 
static std::shared_ptr< const fml::MappingSearchMapping (const 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)
 
fml::TimePoint DartTimelineTicksSinceEpoch ()
 
static std::string DartFileRecorderArgs (const std::string &path)
 
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 (const std::vector< std::string > &kernel_pieces_paths, const std::shared_ptr< AssetManager > &asset_manager, const 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< sk_sp< SkTypeface > > GetTestFontData ()
 
std::vector< std::string > GetTestFontFamilyNames ()
 
GrContextOptions MakeDefaultContextOptions (ContextType type, std::optional< GrBackendApi > api=std::nullopt)
 Initializes GrContextOptions with values suitable for Flutter. The options can be further tweaked before a GrContext is created from these options. More...
 
 TEST_F (EngineAnimatorTest, AnimatorAcceptsMultipleRenders)
 
 TEST_F (EngineAnimatorTest, IgnoresOutOfFrameRenders)
 
 TEST_F (EngineAnimatorTest, IgnoresDuplicateRenders)
 
 TEST_F (EngineAnimatorTest, AnimatorSubmitsImplicitViewBeforeDrawFrameEnds)
 
 TEST_F (EngineAnimatorTest, AnimatorSubmitWarmUpImplicitView)
 
 TEST_F (EngineAnimatorTest, AnimatorSubmitPartialViewsForWarmUp)
 
 TEST_F (EngineTest, Create)
 
 TEST_F (EngineTest, DispatchPlatformMessageUnknown)
 
 TEST_F (EngineTest, DispatchPlatformMessageInitialRoute)
 
 TEST_F (EngineTest, DispatchPlatformMessageInitialRouteIgnored)
 
 TEST_F (EngineTest, SpawnSharesFontLibrary)
 
 TEST_F (EngineTest, SpawnWithCustomInitialRoute)
 
 TEST_F (EngineTest, SpawnWithCustomSettings)
 
 TEST_F (EngineTest, PassesLoadDartDeferredLibraryErrorToRuntime)
 
 TEST_F (EngineTest, SpawnedEngineInheritsAssetManager)
 
 TEST_F (EngineTest, UpdateAssetManagerWithEqualManagers)
 
size_t GetNextPipelineTraceID ()
 
static constexpr std::chrono::milliseconds kSkiaCleanupExpiration (15000)
 
static sk_sp< SkDataScreenshotLayerTreeAsPicture (flutter::LayerTree *tree, flutter::CompositorContext &compositor_context)
 
static void RenderFrameForScreenshot (flutter::CompositorContext &compositor_context, DlCanvas *canvas, flutter::LayerTree *tree, GrDirectContext *surface_context, const std::shared_ptr< impeller::AiksContext > &aiks_context)
 
 TEST (RasterizerTest, create)
 
static std::unique_ptr< FrameTimingsRecorderCreateFinishedBuildRecorder (fml::TimePoint timestamp)
 
static std::unique_ptr< FrameTimingsRecorderCreateFinishedBuildRecorder ()
 
 TEST (RasterizerTest, drawEmptyPipeline)
 
 TEST (RasterizerTest, drawWithExternalViewEmbedderExternalViewEmbedderSubmitFrameCalled)
 
 TEST (RasterizerTest, drawWithExternalViewEmbedderAndThreadMergerNotMergedExternalViewEmbedderSubmitFrameNotCalled)
 
 TEST (RasterizerTest, drawWithExternalViewEmbedderAndThreadsMergedExternalViewEmbedderSubmitFrameCalled)
 
 TEST (RasterizerTest, drawLastLayerTreeWithThreadsMergedExternalViewEmbedderAndEndFrameCalled)
 
 TEST (RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet)
 
 TEST (RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNotUsedThisFrame)
 
 TEST (RasterizerTest, externalViewEmbedderDoesntEndFrameWhenPipelineIsEmpty)
 
 TEST (RasterizerTest, drawMultipleViewsWithExternalViewEmbedder)
 
 TEST (RasterizerTest, drawWithGpuEnabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame)
 
 TEST (RasterizerTest, drawWithGpuDisabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame)
 
 TEST (RasterizerTest, drawWithGpuEnabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesAcquireFrame)
 
 TEST (RasterizerTest, drawWithGpuDisabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesntAcquireFrame)
 
 TEST (RasterizerTest, FrameTimingRecorderShouldStartRecordingRasterTimeBeforeSurfaceAcquireFrame)
 
 TEST (RasterizerTest, drawLayerTreeWithCorrectFrameTimingWhenPipelineIsMoreAvailable)
 
 TEST (RasterizerTest, TeardownFreesResourceCache)
 
 TEST (RasterizerTest, TeardownNoSurface)
 
 TEST (RasterizerTest, presentationTimeSetWhenVsyncTargetInFuture)
 
 TEST (RasterizerTest, presentationTimeNotSetWhenVsyncTargetInPast)
 
sk_sp< SkDataSerializeTypefaceWithoutData (SkTypeface *typeface, void *ctx)
 
sk_sp< SkDataSerializeTypefaceWithData (SkTypeface *typeface, void *ctx)
 
sk_sp< SkTypefaceDeserializeTypefaceWithoutData (const void *data, size_t length, void *ctx)
 
struct flutter::ImageMetaData __attribute__ ((packed))
 
sk_sp< SkDataSerializeImageWithoutData (SkImage *image, void *ctx)
 
sk_sp< SkImageDeserializeImageWithoutData (const void *data, size_t length, void *ctx)
 
static impeller::RuntimeStageBackend DetermineRuntimeStageBackend (const std::shared_ptr< impeller::Context > &impeller_context)
 
static void ServiceProtocolParameterError (rapidjson::Document *response, std::string error_details)
 
static void ServiceProtocolFailureError (rapidjson::Document *response, std::string message)
 
static rapidjson::Value SerializeLayerSnapshot (double device_pixel_ratio, const LayerSnapshotData &snapshot, rapidjson::Document *response)
 
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)
 
void InitSkiaEventTracer (bool enabled, const std::optional< std::vector< std::string > > &allowlist)
 
void PrintUsage (const std::string &executable_name)
 
const std::string_view FlagForSwitch (Switch swtch)
 
static std::vector< std::string > ParseCommaDelimited (const std::string &input)
 
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 (const std::string &symbol_prefix, const 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(AotVMServiceSharedLibraryName
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate DEF_SWITCH (SnapshotAssetPath, "snapshot-asset-path", "Path to the directory containing the four files specified by " "VmSnapshotData, VmSnapshotInstructions, " "VmSnapshotInstructions and IsolateSnapshotInstructions.") DEF_SWITCH(VmSnapshotData
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present DEF_SWITCH (VmSnapshotInstructions, "vm-snapshot-instr", "The VM instructions snapshot that will be memory mapped as read " "and executable. SnapshotAssetPath must be present.") DEF_SWITCH(IsolateSnapshotData
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present DEF_SWITCH (IsolateSnapshotInstructions, "isolate-snapshot-instr", "The isolate instructions snapshot that will be memory mapped as " "read and executable. SnapshotAssetPath must be present.") DEF_SWITCH(CacheDirPath
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache DEF_SWITCH (ICUSymbolPrefix, "icu-symbol-prefix", "Prefix for the symbols representing ICU data linked into the " "Flutter library.") DEF_SWITCH(ICUNativeLibPath
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data DEF_SWITCH (DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " "by the Flutter shell.") DEF_SWITCH(DeviceVMServiceHost
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified DEF_SWITCH (DeviceObservatoryHost, "observatory-host", "(deprecated) The hostname/IP address on which the Dart VM Service should " "be served. If not set, defaults to 127.0.0.1 or ::1 depending on " "whether --ipv6 is specified.") DEF_SWITCH(DeviceVMServicePort
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port DEF_SWITCH (DeviceObservatoryPort, "observatory-port", "(deprecated) A custom Dart VM Service port. The default is to pick " "a randomly " "available open port.") DEF_SWITCH(DisableVMService
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode DEF_SWITCH (DisableObservatory, "disable-observatory", "(deprecated) Disable the Dart VM Service. The Dart VM Service is " "never available " "in release mode.") DEF_SWITCH(DisableVMServicePublication
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication DEF_SWITCH (DisableObservatoryPublication, "disable-observatory-publication", "(deprecated) Disable mDNS Dart VM Service publication.") DEF_SWITCH(IPv6
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set DEF_SWITCH (EnableDartProfiling, "enable-dart-profiling", "Enable Dart profiling. Profiling information can be viewed from " "Dart / Flutter DevTools.") DEF_SWITCH(EndlessTraceBuffer
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however DEF_SWITCH (EnableSoftwareRendering, "enable-software-rendering", "Enable rendering using the Skia software backend. This is useful " "when testing Flutter on emulators. By default, Flutter will " "attempt to either use OpenGL, Metal, or Vulkan.") DEF_SWITCH(Route
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework DEF_SWITCH (SkiaDeterministicRendering, "skia-deterministic-rendering", "Skips the call to SkGraphics::Init(), thus avoiding swapping out " "some Skia function pointers based on available CPU features. This " "is used to obtain 100% deterministic behavior in Skia rendering.") DEF_SWITCH(FlutterAssetsDir
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory DEF_SWITCH (DisableServiceAuthCodes, "disable-service-auth-codes", "Disable the requirement for authentication codes for communicating" " with the VM service.") DEF_SWITCH(EnableServicePortFallback
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails DEF_SWITCH (StartPaused, "start-paused", "Start the application paused in the Dart debugger.") DEF_SWITCH(TraceStartup
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer DEF_SWITCH (TraceSkia, "trace-skia", "Trace Skia calls. This is useful when debugging the GPU threed." "By default, Skia tracing is not enabled to reduce the number of " "traced events") DEF_SWITCH(TraceSkiaAllowlist
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list DEF_SWITCH (TraceAllowlist, "trace-allowlist", "Filters out all trace events except those that are specified in this " "comma separated list of allowed prefixes.") DEF_SWITCH(DumpSkpOnShaderCompilation
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead DEF_SWITCH (CacheSkSL, "cache-sksl", "Only cache the shader in SkSL instead of binary or GLSL. This " "should only be used during development phases. The generated SkSLs " "can later be used in the release build for shader precompilation " "at launch in order to eliminate the shader-compile jank.") DEF_SWITCH(PurgePersistentCache
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank DEF_SWITCH (TraceSystrace, "trace-systrace", "Trace to the system tracer (instead of the timeline) on platforms where " "such a tracer is available. Currently only supported on Android and " "Fuchsia.") DEF_SWITCH(TraceToFile
 
it will be possible to load the file into Perfetto s trace viewer DEF_SWITCH (UseTestFonts, "use-test-fonts", "Running tests that layout and measure text will not yield " "consistent results across various platforms. Enabling this option " "will make font resolution default to the Ahem test font on all " "platforms (See https://www.w3.org/Style/CSS/Test/Fonts/Ahem/). " "This option is only available on the desktop test shells.") DEF_SWITCH(DisableAssetFonts
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine DEF_SWITCH (VerboseLogging, "verbose-logging", "By default, only errors are logged. This flag enabled logging at " "all severity levels. This is NOT a per shell flag and affect log " "levels for all shells in the process.") DEF_SWITCH(RunForever
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed DEF_SWITCH (DisableDartAsserts, "disable-dart-asserts", "Dart code runs with assertions enabled when the runtime mode is " "debug. In profile and release product modes, assertions are " "disabled. This flag may be specified if the user wishes to run " "with assertions disabled in the debug product mode (i.e. with JIT " "or DBC).") DEF_SWITCH(EnableSerialGC
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities DEF_SWITCH (DisallowInsecureConnections, "disallow-insecure-connections", "By default, dart:io allows all socket connections. If this switch " "is set, all insecure connections are rejected.") DEF_SWITCH(DomainNetworkPolicy
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level DEF_SWITCH (ForceMultithreading, "force-multithreading", "Uses separate threads for the platform, UI, GPU and IO task runners. " "By default, a single thread is used for all task runners. Only available " "in the flutter_tester.") DEF_SWITCH(OldGenHeapSize
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space DEF_SWITCH (ResourceCacheMaxBytesThreshold, "resource-cache-max-bytes-threshold", "The max bytes threshold of resource cache, or 0 for unlimited.") DEF_SWITCH(EnableImpeller
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform DEF_SWITCH (ImpellerBackend, "impeller-backend", "Requests a particular Impeller backend on platforms that support " "multiple backends. (ex `opengles` or `vulkan`)") DEF_SWITCH(EnableVulkanValidation
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan this flag does nothing DEF_SWITCH (EnableOpenGLGPUTracing, "enable-opengl-gpu-tracing", "Enable tracing of GPU execution time when using the Impeller " "OpenGLES backend.") DEF_SWITCH(EnableVulkanGPUTracing
 
static bool IsProcResolverOpenGLES (const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)
 
static sk_sp< const GrGLInterfaceCreateGLInterface (const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)
 
static SkColorType FirstSupportedColorType (GrDirectContext *context, GrGLenum *format)
 
static sk_sp< SkSurfaceWrapOnscreenSurface (GrDirectContext *context, const SkISize &size, intptr_t fbo)
 
static std::shared_ptr< impeller::RendererCreateImpellerRenderer (std::shared_ptr< impeller::Context > context)
 
static std::shared_ptr< impeller::ContextCreateImpellerContext (const std::shared_ptr< impeller::ReactorGLES::Worker > &worker, bool enable_gpu_tracing)
 
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 std::shared_ptr< impeller::ContextCreateImpellerContext (const fml::RefPtr< fml::NativeLibrary > &vulkan_dylib, bool enable_vulkan_validation, bool enable_gpu_tracing, bool quiet)
 
void LogLastEGLError ()
 
static void AndroidPlatformThreadConfigSetter (const fml::Thread::ThreadConfig &config)
 
static PlatformData GetDefaultPlatformData ()
 
static void PrefetchDefaultFontManager (JNIEnv *env, jclass jcaller)
 
static std::shared_ptr< flutter::AndroidContextCreateAndroidContext (bool use_software_rendering, const flutter::TaskRunners &task_runners, AndroidRenderingAPI android_rendering_api, bool enable_vulkan_validation, bool enable_opengl_gpu_tracing, bool enable_vulkan_gpu_tracing)
 
void putStringAttributesIntoBuffer (const StringAttributes &attributes, int32_t *buffer_int32, size_t &position, std::vector< std::vector< uint8_t > > &string_attribute_args)
 
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)
 
static void DestroyJNI (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
static jobject SpawnJNI (JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jEntrypoint, jstring jLibraryUrl, jstring jInitialRoute, jobject jEntrypointArgs)
 
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, jobject jEntrypointArgs)
 
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, jint physicalTouchSlop, jintArray javaDisplayFeaturesBounds, jintArray javaDisplayFeaturesType, jintArray javaDisplayFeaturesState)
 
static void UpdateDisplayMetrics (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
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 CleanupMessageData (JNIEnv *env, jobject jcaller, jlong message_data)
 
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 RegisterImageTexture (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject image_texture_entry)
 
static void UnregisterTexture (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
 
static void MarkTextureFrameAvailable (JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
 
static void ScheduleFrame (JNIEnv *env, jobject jcaller, jlong shell_holder)
 
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)
 
static void LoadLoadingUnitFailure (intptr_t loading_unit_id, const std::string &message, bool transient)
 
static void DeferredComponentInstallFailure (JNIEnv *env, jobject obj, jint jLoadingUnitId, jstring jError, jboolean jTransient)
 
static void LoadDartDeferredLibrary (JNIEnv *env, jobject obj, jlong shell_holder, jint jLoadingUnitId, jobjectArray jSearchPaths)
 
static void UpdateJavaAssetManager (JNIEnv *env, jobject obj, jlong shell_holder, jobject jAssetManager, jstring jAssetBundlePath)
 
bool RegisterApi (JNIEnv *env)
 
constexpr const char * AppLifecycleStateToString (AppLifecycleState state)
 
 TEST (BasicMessageChannelTest, Registration)
 
 TEST (BasicMessageChannelTest, Unregistration)
 
 TEST (BasicMessageChannelTest, Resize)
 
 TEST (BasicMessageChannelTest, SetWarnsOnOverflow)
 
 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 (EncodableValueTest, TypeIndexesCorrect)
 
 TEST (EventChannelTest, Registration)
 
 TEST (EventChannelTest, Unregistration)
 
 TEST (EventChannelTest, Cancel)
 
 TEST (EventChannelTest, ListenNotCancel)
 
 TEST (EventChannelTest, ReRegistration)
 
 TEST (EventChannelTest, HandlerOutlivesEventChannel)
 
 TEST (EventChannelTest, StreamHandlerErrorPassByValue)
 
 TEST (EventChannelTest, StreamHandlerErrorNullptr)
 
 TEST (MethodCallTest, Basic)
 
 TEST (MethodChannelTest, Registration)
 
 TEST (MethodChannelTest, Unregistration)
 
 TEST (MethodChannelTest, InvokeWithoutResponse)
 
 TEST (MethodChannelTest, InvokeWithResponse)
 
 TEST (MethodChannelTest, InvokeNotImplemented)
 
 TEST (MethodChannelTest, Resize)
 
 TEST (MethodChannelTest, SetWarnsOnOverflow)
 
 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)
 
 TEST (PluginRegistrarTest, TextureRegistrarNotNull)
 
static void CheckEncodeDecode (const EncodableValue &value, const std::vector< uint8_t > &expected_encoding, const StandardCodecSerializer *serializer=nullptr, const 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, GetInstanceCachesInstance)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeNull)
 
 TEST (StandardMessageCodec, CanDecodeEmptyBytesAsNullWithoutCallingSerializer)
 
 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, CanEncodeAndDecodeFloat32Array)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeFloat64Array)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeSimpleCustomType)
 
 TEST (StandardMessageCodec, CanEncodeAndDecodeVariableLengthCustomType)
 
 TEST (StandardMethodCodec, GetInstanceCachesInstance)
 
 TEST (StandardMethodCodec, HandlesMethodCallsWithNullArguments)
 
 TEST (StandardMethodCodec, HandlesMethodCallsWithArgument)
 
 TEST (StandardMethodCodec, HandlesSuccessEnvelopesWithNullResult)
 
 TEST (StandardMethodCodec, HandlesSuccessEnvelopesWithResult)
 
 TEST (StandardMethodCodec, HandlesErrorEnvelopesWithNulls)
 
 TEST (StandardMethodCodec, HandlesErrorEnvelopesWithDetails)
 
 TEST (StandardMethodCodec, HandlesCustomTypeArguments)
 
 TEST (TextureRegistrarTest, RegisterUnregisterTexture)
 
 TEST (TextureRegistrarTest, UnregisterInvalidTexture)
 
 TEST (TextureRegistrarTest, MarkFrameAvailableInvalidTexture)
 
std::vector< std::string > GetSwitchesFromEnvironment ()
 
 TEST (FlutterProjectBundle, SwitchesEmpty)
 
 TEST (FlutterProjectBundle, Switches)
 
 TEST (FlutterProjectBundle, SwitchesExtraValues)
 
 TEST (FlutterProjectBundle, SwitchesMissingValues)
 
 TEST (Point, SetsCoordinates)
 
 TEST (Size, SetsDimensions)
 
 TEST (Size, ClampsDimensionsPositive)
 
 TEST (Rect, SetsOriginAndSize)
 
 TEST (Rect, ReturnsLTRB)
 
 TEST (Rect, ReturnsWidthHeight)
 
 TEST (IncomingMessageDispatcher, SetHandle)
 
 TEST (IncomingMessageDispatcher, BlockInputFalse)
 
 TEST (IncomingMessageDispatcher, BlockInputTrue)
 
 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 (TextEditingDeltaTest, TestTextEditingDeltaConstructor)
 
 TEST (TextEditingDeltaTest, TestTextEditingDeltaNonTextConstructor)
 
 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, UpdateSelectionWhileComposing)
 
 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, SelectToBeginningStart)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddle)
 
 TEST (TextInputModel, SelectToBeginningMiddle)
 
 TEST (TextInputModel, MoveCursorToBeginningEnd)
 
 TEST (TextInputModel, SelectToBeginningEnd)
 
 TEST (TextInputModel, MoveCursorToBeginningSelection)
 
 TEST (TextInputModel, SelectToBeginningSelection)
 
 TEST (TextInputModel, MoveCursorToBeginningReverseSelection)
 
 TEST (TextInputModel, SelectToBeginningReverseSelection)
 
 TEST (TextInputModel, MoveCursorToBeginningStartComposing)
 
 TEST (TextInputModel, SelectToBeginningStartComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningStartReverseComposing)
 
 TEST (TextInputModel, SelectToBeginningStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddleComposing)
 
 TEST (TextInputModel, SelectToBeginningMiddleComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningMiddleReverseComposing)
 
 TEST (TextInputModel, SelectToBeginningMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningEndComposing)
 
 TEST (TextInputModel, SelectToBeginningEndComposing)
 
 TEST (TextInputModel, MoveCursorToBeginningEndReverseComposing)
 
 TEST (TextInputModel, SelectToBeginningEndReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndStart)
 
 TEST (TextInputModel, SelectToEndStart)
 
 TEST (TextInputModel, MoveCursorToEndMiddle)
 
 TEST (TextInputModel, SelectToEndMiddle)
 
 TEST (TextInputModel, MoveCursorToEndEnd)
 
 TEST (TextInputModel, SelectToEndEnd)
 
 TEST (TextInputModel, MoveCursorToEndSelection)
 
 TEST (TextInputModel, SelectToEndSelection)
 
 TEST (TextInputModel, MoveCursorToEndReverseSelection)
 
 TEST (TextInputModel, SelectToEndReverseSelection)
 
 TEST (TextInputModel, MoveCursorToEndStartComposing)
 
 TEST (TextInputModel, SelectToEndStartComposing)
 
 TEST (TextInputModel, MoveCursorToEndStartReverseComposing)
 
 TEST (TextInputModel, SelectToEndStartReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndMiddleComposing)
 
 TEST (TextInputModel, SelectToEndMiddleComposing)
 
 TEST (TextInputModel, MoveCursorToEndMiddleReverseComposing)
 
 TEST (TextInputModel, SelectToEndMiddleReverseComposing)
 
 TEST (TextInputModel, MoveCursorToEndEndComposing)
 
 TEST (TextInputModel, SelectToEndEndComposing)
 
 TEST (TextInputModel, MoveCursorToEndEndReverseComposing)
 
 TEST (TextInputModel, SelectToEndEndReverseComposing)
 
 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::optional< ProductVersionProductVersionFromSystemVersionPList ()
 
bool IsEncodedVersionLessThanOrSame (uint32_t encoded_lhs, ProductVersion rhs)
 
fml::MallocMapping CopyNSDataToMapping (NSData *data)
 
NSData * ConvertMappingToNSData (fml::MallocMapping buffer)
 
std::unique_ptr< fml::MappingConvertNSDataToMappingPtr (NSData *data)
 
NSData * CopyMappingPtrToNSData (std::unique_ptr< fml::Mapping > mapping)
 
fml::CommandLine CommandLineFromNSProcessInfo (NSProcessInfo *processInfoOrNil=nil)
 
FlutterStandardField FlutterStandardFieldForDataType (FlutterStandardDataType type)
 
FlutterStandardDataType FlutterStandardDataTypeForField (FlutterStandardField field)
 
UInt8 elementSizeForFlutterStandardDataType (FlutterStandardDataType type)
 
CATransform3D GetCATransform3DFromSkMatrix (const SkMatrix &matrix)
 
void ResetAnchor (CALayer *layer)
 
CGRect GetCGRectFromSkRect (const SkRect &clipSkRect)
 
BOOL BlurRadiusEqualToBlurRadius (CGFloat radius1, CGFloat radius2)
 
bool IsIosEmbeddedViewsPreviewEnabled ()
 
static IOSContextMetalSkiaCastToMetalContext (const std::shared_ptr< IOSContext > &context) __attribute__((cf_audited_transfer))
 
IOSRenderingAPI GetRenderingAPIForProcess (bool force_software)
 
Class GetCoreAnimationLayerClassForRenderingAPI (IOSRenderingAPI rendering_api)
 
bool ShouldUseMetalRenderer ()
 
bool operator== (const LayoutGoal &a, const LayoutGoal &b)
 
static bool ValidNumTextures (int expected, int actual)
 
static SkISize TransformedSurfaceSize (const SkISize &size, const SkMatrix &transformation)
 
static FlutterBackingStoreConfig MakeBackingStoreConfig (int64_t view_id, 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 ()
 
fml::Thread::ThreadConfig MakeThreadConfig (flutter::ThreadHost::Type type, fml::Thread::ThreadPriority priority)
 
 TEST (FlutterEngineTest, CreateDestroy)
 
 TEST (FlutterEngineTest, ExplicitShutDown)
 
 TEST (FlutterEngineTest, RunloopTimeoutTranslation)
 
 TEST (FlutterViewControllerTest, CreateDestroy)
 
 TEST (FlutterWindowTest, SetSizeLimits)
 
 TEST (PluginRegistrarGlfwTest, GetView)
 
 TEST (PluginRegistrarGlfwTest, PluginDestroyedBeforeRegistrar)
 
std::vector< LanguageInfoGetPreferredLanguageInfo ()
 
std::vector< FlutterLocaleConvertToFlutterLocale (const std::vector< LanguageInfo > &languages)
 
 TEST_F (DartProjectTest, StandardProjectFormat)
 
 TEST_F (DartProjectTest, ProjectWithCustomPaths)
 
 TEST_F (DartProjectTest, DartEntrypointArguments)
 
 TEST (FlutterEngineTest, CreateDestroyWithCustomEntrypoint)
 
 TEST (FlutterEngineTest, ProcessMessages)
 
 TEST (FlutterEngineTest, ReloadFonts)
 
 TEST (FlutterEngineTest, GetMessenger)
 
 TEST (FlutterEngineTest, DartEntrypointArgs)
 
 TEST (FlutterEngineTest, SetNextFrameCallback)
 
 TEST (FlutterEngineTest, ProcessExternalWindowMessage)
 
 TEST (FlutterViewControllerTest, GetViewId)
 
 TEST (FlutterViewControllerTest, GetEngine)
 
 TEST (FlutterViewControllerTest, GetView)
 
 TEST (FlutterViewControllerTest, ForceRedraw)
 
 TEST (FlutterViewTest, HwndAccessPassesThrough)
 
 TEST (FlutterViewTest, GraphicsAdapterAccessPassesThrough)
 
 TEST (PluginRegistrarWindowsTest, GetView)
 
 TEST (PluginRegistrarWindowsTest, GetViewById)
 
 TEST (PluginRegistrarWindowsTest, PluginDestroyedBeforeRegistrar)
 
 TEST (PluginRegistrarWindowsTest, RegisterUnregister)
 
 TEST (PluginRegistrarWindowsTest, CallsRegisteredDelegates)
 
 TEST (PluginRegistrarWindowsTest, StopsOnceHandled)
 
HCURSOR GetCursorFromBuffer (const std::vector< uint8_t > &buffer, double hot_x, double hot_y, int width, int height)
 
void GetMaskBitmaps (HBITMAP bitmap, HBITMAP &mask_bitmap)
 
UINT GetDpiForHWND (HWND hwnd)
 
UINT GetDpiForMonitor (HMONITOR monitor)
 
static void WindowsPlatformThreadPrioritySetter (FlutterThreadPriority priority)
 
std::string ConvertChar32ToUtf8 (char32_t ch)
 
static bool isEasciiPrintable (int codeUnit)
 
static uint64_t toLower (uint64_t n)
 
static uint16_t normalizeScancode (int windowsScanCode, bool extended)
 
std::u16string EncodeUtf16 (char32_t character)
 
uint32_t UndeadChar (uint32_t ch)
 
static AppExitType StringToAppExitType (const std::string &string)
 
std::vector< LanguageInfoGetPreferredLanguageInfo (const WindowsProcTable &windows_proc_table)
 
std::wstring GetPreferredLanguagesFromMUI (const WindowsProcTable &windows_proc_table)
 
std::vector< std::wstring > GetPreferredLanguages (const WindowsProcTable &windows_proc_table)
 
LanguageInfo ParseLanguageName (std::wstring language_name)
 
std::wstring GetUserTimeFormat ()
 
bool Prefer24HourTime (std::wstring time_format)
 
static int64_t NumWindowsForThread (const THREADENTRY32 &thread)
 
 TEST (SamplingProfilerTest, DeleteAfterStart)
 
static void ConfigureShell (Shell *shell)
 
static void UnblockSIGPROF ()
 
int RunTester (const flutter::Settings &settings, bool run_forever, bool multithreaded)
 
EXPORTED Dart_Handle LoadLibraryFromKernel (const char *path)
 
EXPORTED Dart_Handle LookupEntryPoint (const char *uri, const char *name)
 
EXPORTED void Spawn (const char *entrypoint, const char *route)
 
EXPORTED void ForceShutdownIsolate ()
 
const char * GetFlutterEngineVersion ()
 
const char * GetSkiaVersion ()
 
const char * GetDartVersion ()
 
static void StartTestSuite (const impeller::android::NativeWindow &window)
 
std::unique_ptr< NativeActivityNativeActivityMain (ANativeActivity *activity, std::unique_ptr< fml::Mapping > saved_state)
 
SkPathCreatePath (SkPathFillType fill_type)
 
void DestroyPath (SkPath *path)
 
void MoveTo (SkPath *path, SkScalar x, SkScalar y)
 
void LineTo (SkPath *path, SkScalar x, SkScalar y)
 
void CubicTo (SkPath *path, SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
 
void Close (SkPath *path)
 
void Reset (SkPath *path)
 
void Op (SkPath *one, SkPath *two, SkPathOp op)
 
int GetFillType (SkPath *path)
 
struct PathDataData (SkPath *path)
 
void DestroyData (PathData *data)
 
API void DestroyPathBuilder (SkPath *path)
 
bool TemplaterMain (const fml::CommandLine &command_line)
 

Variables

constexpr double kMegaByteSizeInBytes = (1 << 20)
 
constexpr int64_t kFlutterImplicitViewId = 0
 
const double kSizeFactorSmall = 0.3
 
static constexpr DlRect kEmpty = DlRect()
 
const int kBinarySearchThreshold = 10
 
constexpr float kInvertColorMatrix [20]
 
static constexpr DlRect kEmpty = DlRect()
 
constexpr float kImpellerRepaintRatio = 0.7f
 The max ratio of pixel width or height to size that is dirty which results in a partial repaint. More...
 
static std::string gGoldenDir
 
static std::string gFontFile
 
static const auto * flow_type = "RasterCacheFlow::DisplayList"
 
static constexpr SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F)
 
static const auto * flow_type = "RasterCacheFlow::Layer"
 
const int kDisplayRasterizerStatistics = 1 << 0
 
const int kVisualizeRasterizerStatistics = 1 << 1
 
const int kDisplayEngineStatistics = 1 << 2
 
const int kVisualizeEngineStatistics = 1 << 3
 
static const size_t kMaxSamples = 120
 
static const size_t kMaxSamples = 120
 
static const size_t kMaxFrameMarkers = 8
 
static const size_t kMaxSamples = 120
 
static const size_t kMaxFrameMarkers = 8
 
static const tonic::DartWrapperInfo kDartWrapperInfoUIImage ("ui", "_Image")
 
static const std::array< DlImageSampling, 4 > kFilterQualities
 
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 size_t kDataByteCount = 52
 
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 float kStrokeMiterLimitDefault = 4.0f
 
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 kVerticalScrollSemanticsActions
 
const int kHorizontalScrollSemanticsActions
 
const int kScrollableSemanticsActions
 
const int kScrollableSemanticsFlags
 
static constexpr int kKeyDataFieldCount = 6
 
static constexpr int kBytesPerKeyField = sizeof(int64_t)
 
static constexpr int kPointerDataFieldCount = 36
 
static constexpr int kBytesPerField = sizeof(int64_t)
 
const char * dart_plugin_registrant_library_override = nullptr
 
static const char * kDartAllConfigsArgs []
 
static const char * kDartPrecompilationArgs [] = {"--precompilation"}
 
static const char * kSerialGCArgs []
 
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 * kDartEndlessTraceBufferArgs []
 
static const char * kDartSystraceTraceBufferArgs []
 
static FML_ALLOW_UNUSED_TYPE const char * kDartDefaultTraceStreamsArgs []
 
static const char * kDartStartupTraceStreamsArgs []
 
static const char * kDartSystraceTraceStreamsArgs []
 
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 constexpr size_t kMinCount = 2
 
static constexpr size_t kMaxCount = 4
 
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"
 
DEF_SWITCHES_START aot vmservice shared library name
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service host
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm service
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service publication
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication ipv6
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For example
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however route
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port fallback
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace startup
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia allowlist
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader compilation
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By default
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank trace to file
 
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank trace to Write the timeline trace to a file at the specified path The file will be in Perfetto s proto format
 
it will be possible to load the file into Perfetto s trace viewer disable asset fonts
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via dart
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run forever
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial gc
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core counts
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network policy
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable impeller
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan validation
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan backends
 
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan this flag does nothing enable vulkan gpu tracing
 
static constexpr const char * kVsyncFlowName = "VsyncFlow"
 
static constexpr const char * kVsyncTraceName = "VsyncProcessCallback"
 
static const size_t kGrCacheMaxByteSize = 24 * (1 << 20)
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_jni_class = nullptr
 
static jmethodID g_decode_image_method = nullptr
 
constexpr int kMinimumAndroidApiLevelForVulkan = 29
 
const uint8_t kPlatformStrongDill []
 
const intptr_t kPlatformStrongDillSize
 
static std::unique_ptr< FlutterMaing_flutter_main
 
static constexpr size_t kImageReaderSwapchainSize = 6u
 
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_java_weak_reference_class
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_texture_wrapper_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_image_consumer_texture_registry_interface = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_image_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_hardware_buffer_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_java_long_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_class = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_config_class = nullptr
 
static jmethodID g_flutter_callback_info_constructor = nullptr
 
static jfieldID g_jni_shell_holder_field = nullptr
 
static jmethodID g_jni_constructor = nullptr
 
static jmethodID g_long_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_get_scaled_font_size_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_java_weak_reference_get_method = nullptr
 
static jmethodID g_attach_to_gl_context_method = nullptr
 
static jmethodID g_surface_texture_wrapper_should_update = 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_acquire_latest_image_method = nullptr
 
static jmethodID g_image_get_hardware_buffer_method = nullptr
 
static jmethodID g_image_close_method = nullptr
 
static jmethodID g_hardware_buffer_close_method = nullptr
 
static jmethodID g_compute_platform_resolved_locale_method = nullptr
 
static jmethodID g_request_dart_deferred_library_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 jmethodID g_bitmap_create_bitmap_method = nullptr
 
static jmethodID g_bitmap_copy_pixels_from_buffer_method = nullptr
 
static jmethodID g_bitmap_config_value_of = 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 jmethodID g_mutators_stack_push_cliprrect_method = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_vsync_waiter_class = nullptr
 
static jmethodID g_async_wait_for_vsync_method_ = nullptr
 
static std::atomic_uint g_refresh_rate_ = 60
 
constexpr int kHasScrollingAction
 
const char *const kOrientationUpdateNotificationName
 
const char *const kOrientationUpdateNotificationKey
 
const char *const kOverlayStyleUpdateNotificationName
 
const char *const kOverlayStyleUpdateNotificationKey
 
BOOL canApplyBlurBackdrop = YES
 
static NSString *const kAccessibilityLoadCompleteNotification = @"@"AXLoadComplete"
 
static NSString *const kAccessibilityInvalidStatusChangedNotification = @"@"AXInvalidStatusChanged"
 
static NSString *const kAccessibilityLiveRegionCreatedNotification = @"@"AXLiveRegionCreated"
 
static NSString *const kAccessibilityLiveRegionChangedNotification = @"@"AXLiveRegionChanged"
 
static NSString *const kAccessibilityExpandedChanged = @"@"AXExpandedChanged"
 
static NSString *const kAccessibilityMenuItemSelectedNotification = @"@"AXMenuItemSelected"
 
const uint64_t kValueMask = 0x000ffffffff
 
const uint64_t kUnicodePlane = 0x00000000000
 
const uint64_t kMacosPlane = 0x01400000000
 
const NSDictionary * keyCodeToPhysicalKey
 
const NSDictionary * keyCodeToLogicalKey
 
const NSDictionary * keyCodeToModifierFlag
 
const NSDictionary * modifierFlagToKeyCode
 
const uint64_t kCapsLockPhysicalKey = 0x00070039
 
const uint64_t kCapsLockLogicalKey = 0x100000104
 
const std::vector< LayoutGoalkLayoutGoals
 
static const auto kRootViewIdentifier = EmbedderExternalView::ViewIdentifier{}
 
constexpr const char * kFlutterThreadName = "io.flutter"
 
constexpr int kOpaqueBlack = 0xff000000
 
constexpr FlutterViewId kImplicitViewId = 0
 
constexpr int kShift = 1 << 0
 
constexpr int kControl = 1 << 3
 
constexpr int kScanCodeShiftLeft = 0x2a
 
constexpr int kScanCodeShiftRight = 0x36
 
constexpr int kKeyCodeShiftLeft = 0xa0
 
constexpr int kScanCodeControlLeft = 0x1d
 
constexpr int kScanCodeControlRight = 0xe01d
 
constexpr int kKeyCodeControlLeft = 0xa2
 
constexpr int kDeadKeyCharMask = 0x80000000
 
static constexpr const char * kExitTypeNames []
 
constexpr const wchar_t kGetPreferredLanguageRegKey []
 
constexpr const wchar_t kGetPreferredLanguageRegValue [] = L"Languages"
 
static absl::NoDestructor< std::unique_ptr< Shell > > g_shell
 

Typedef Documentation

◆ AccessibilityNodeId

Definition at line 15 of file flutter_platform_node_delegate.h.

◆ 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 23 of file dart_isolate_group_data.h.

◆ CurrentTimeProc

typedef uint64_t(* flutter::CurrentTimeProc) ()

Definition at line 21 of file task_runner.h.

◆ CustomAccessibilityActionUpdates

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

Definition at line 31 of file custom_accessibility_action.h.

◆ DisplayId

typedef size_t flutter::DisplayId

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

Definition at line 17 of file display.h.

◆ DlDegrees

Definition at line 20 of file dl_geometry_types.h.

◆ DlIPoint

Definition at line 24 of file dl_geometry_types.h.

◆ DlIRect

Definition at line 28 of file dl_geometry_types.h.

◆ DlISize

Definition at line 26 of file dl_geometry_types.h.

◆ DlMatrix

Definition at line 29 of file dl_geometry_types.h.

◆ DlPoint

Definition at line 23 of file dl_geometry_types.h.

◆ DlRadians

Definition at line 21 of file dl_geometry_types.h.

◆ DlRect

Definition at line 27 of file dl_geometry_types.h.

◆ DlScalar

Definition at line 19 of file dl_geometry_types.h.

◆ DlSize

Definition at line 25 of file dl_geometry_types.h.

◆ EGLResult

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

Definition at line 15 of file android_context_gl_skia.cc.

◆ EncodableList

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

Definition at line 94 of file encodable_value.h.

◆ EncodableMap

Definition at line 95 of file encodable_value.h.

◆ Flags

Definition at line 12 of file dl_vertices.cc.

◆ FlutterViewId

typedef int64_t flutter::FlutterViewId

Definition at line 13 of file flutter_view.h.

◆ FramePipeline

Definition at line 98 of file rasterizer.h.

◆ FrameRasterizedCallback

Definition at line 97 of file settings.h.

◆ GPUCAMetalLayerHandle

Definition at line 24 of file gpu_surface_metal_delegate.h.

◆ GPUMTLCommandQueueHandle

Definition at line 21 of file gpu_surface_metal_delegate.h.

◆ GPUMTLDestructionCallback

typedef void(* flutter::GPUMTLDestructionCallback) (void *)

Definition at line 29 of file gpu_surface_metal_delegate.h.

◆ GPUMTLDeviceHandle

Definition at line 18 of file gpu_surface_metal_delegate.h.

◆ GPUMTLTextureHandle

typedef const void* flutter::GPUMTLTextureHandle

Definition at line 27 of file gpu_surface_metal_delegate.h.

◆ Gradient

Definition at line 57 of file dart_ui.cc.

◆ HardwareBufferKey

using flutter::HardwareBufferKey = typedef uint64_t

Definition at line 22 of file image_lru.h.

◆ Image

Definition at line 55 of file dart_ui.cc.

◆ ImageGeneratorFactory

ImageGeneratorFactory is the top level primitive for specifying an image decoder in Flutter. When called, it should return an ImageGenerator that typically compatible with the given input data.

Definition at line 21 of file image_generator_registry.h.

◆ JavaLocalRef

using flutter::JavaLocalRef = typedef std::nullptr_t

Definition at line 27 of file platform_view_android_jni.h.

◆ KeyboardLayoutNotifier

typedef void(^ flutter::KeyboardLayoutNotifier) ()

Definition at line 16 of file FlutterKeyboardViewDelegate.h.

◆ LayerVariant

Definition at line 29 of file FlutterCompositor.h.

◆ LogMessageCallback

using flutter::LogMessageCallback = typedef std::function<void(const std::string& , const std::string& )>

Definition at line 87 of file settings.h.

◆ MappingCallback

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

Definition at line 93 of file settings.h.

◆ Mappings

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

Definition at line 94 of file settings.h.

◆ MappingsCallback

Definition at line 95 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 50 of file basic_message_channel.h.

◆ MessageReply

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

Definition at line 43 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 27 of file method_channel.h.

◆ MutatorContext

Definition at line 530 of file layer_state_stack.cc.

◆ PaintRegionMap

using flutter::PaintRegionMap = typedef std::map<uint64_t, PaintRegion>

Definition at line 41 of file diff_context.h.

◆ Path

Definition at line 58 of file dart_ui.cc.

◆ PathMeasure

Definition at line 56 of file dart_ui.cc.

◆ PointerDataDispatcherMaker

Signature for constructing PointerDataDispatcher.

Parameters
[in]delegatethe Flutter::Engine

Definition at line 171 of file pointer_data_dispatcher.h.

◆ ProductVersion

using flutter::ProductVersion = typedef std::tuple<int32_t , int32_t , int32_t >

Definition at line 14 of file availability_version_check.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 22 of file method_result_functions.h.

◆ ResultHandlerNotImplemented

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

Definition at line 26 of file method_result_functions.h.

◆ ResultHandlerSuccess

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

Definition at line 20 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 73 of file sampling_profiler.h.

◆ SemanticsNodeUpdates

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

Definition at line 153 of file semantics_node.h.

◆ SkiaUnrefQueue

Definition at line 161 of file skia_gpu_object.h.

◆ StreamHandlerCancel

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

Definition at line 26 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 20 of file event_stream_handler_functions.h.

◆ StringAttributePtr

using flutter::StringAttributePtr = typedef std::shared_ptr<flutter::StringAttribute>

Definition at line 15 of file string_attribute.h.

◆ StringAttributes

using flutter::StringAttributes = typedef std::vector<StringAttributePtr>

Definition at line 16 of file string_attribute.h.

◆ TaskObserverAdd

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

Definition at line 81 of file settings.h.

◆ TaskObserverRemove

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

Definition at line 83 of file settings.h.

◆ TextureVariant

Definition at line 79 of file texture_registrar.h.

◆ ThreadConfig

Definition at line 17 of file thread_host.h.

◆ ThreadConfigSetter

Definition at line 18 of file thread_host.h.

◆ UnhandledExceptionCallback

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

Definition at line 84 of file settings.h.

◆ UniqueAotDataPtr

Definition at line 17 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 23 of file plugin_registrar_windows.h.

Enumeration Type Documentation

◆ AccessibilityFeatureFlag

enum class 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 AccessibilityFeatures class in framework.

Enumerator
kAccessibleNavigation 
kInvertColors 
kDisableAnimations 
kBoldText 
kReduceMotion 
kHighContrast 
kOnOffSwitchLabels 

Definition at line 36 of file platform_configuration.h.

◆ AndroidEGLSurfaceMakeCurrentStatus

Result of calling MakeCurrent on AndroidEGLSurface.

Enumerator
kSuccessAlreadyCurrent 

Success, the egl context for the surface was already current.

kSuccessMadeCurrent 

Success, the egl context for the surface made current.

kFailure 

Failed to make the egl context for the surface current.

Definition at line 30 of file android_egl_surface.h.

30 {
31 /// Success, the egl context for the surface was already current.
33 /// Success, the egl context for the surface made current.
35 /// Failed to make the egl context for the surface current.
37};
@ kFailure
Failed to make the egl context for the surface current.
@ kSuccessMadeCurrent
Success, the egl context for the surface made current.
@ kSuccessAlreadyCurrent
Success, the egl context for the surface was already current.

◆ AndroidRenderingAPI

enum class flutter::AndroidRenderingAPI
strong
Enumerator
kSoftware 
kImpellerOpenGLES 
kImpellerVulkan 
kSkiaOpenGLES 

Definition at line 26 of file settings.h.

◆ AppExitType

enum class flutter::AppExitType
strong
Enumerator
required 
cancelable 

Definition at line 27 of file platform_handler.h.

◆ AppLifecycleState

enum class flutter::AppLifecycleState
strong

These constants describe the possible lifecycle states of the application. They must be kept up to date with changes in the framework's AppLifecycleState enum. They are passed to the embedder's |SetLifecycleState| function.

States not supported on a platform will be synthesized by the framework when transitioning between states which are supported, so that all implementations share the same state machine.

Here is the state machine:

+-----------+                               +-----------+
| detached  |------------------------------>|  resumed  |
+-----------+                               +-----------+
     ^                                              ^
     |                                              |
     |                                              v
+-----------+        +--------------+       +-----------+
| paused    |<------>|    hidden    |<----->|  inactive |
+-----------+        +--------------+       +-----------+
Enumerator
kDetached 

Corresponds to the Framework's AppLifecycleState.detached: The initial state of the state machine. On Android, iOS, and web, also the final state of the state machine when all views are detached. Other platforms do not re-enter this state after initially leaving it.

kResumed 

Corresponds to the Framework's AppLifecycleState.resumed: The nominal "running" state of the application. The application is visible, has input focus, and is running.

kInactive 

Corresponds to the Framework's AppLifecycleState.inactive: At least one view of the application is visible, but none have input focus. The application is otherwise running normally.

kHidden 

Corresponds to the Framework's AppLifecycleState.hidden: All views of an application are hidden, either because the application is being stopped (on iOS and Android), or because it is being minimized or on a desktop that is no longer visible (on desktop), or on a tab that is no longer visible (on web).

kPaused 

Corresponds to the Framework's AppLifecycleState.paused: The application is not running, and can be detached or started again at any time. This state is typically only entered into on iOS and Android.

Definition at line 32 of file app_lifecycle_state.h.

32 {
33 /**
34 * Corresponds to the Framework's AppLifecycleState.detached: The initial
35 * state of the state machine. On Android, iOS, and web, also the final state
36 * of the state machine when all views are detached. Other platforms do not
37 * re-enter this state after initially leaving it.
38 */
40
41 /**
42 * Corresponds to the Framework's AppLifecycleState.resumed: The nominal
43 * "running" state of the application. The application is visible, has input
44 * focus, and is running.
45 */
47
48 /**
49 * Corresponds to the Framework's AppLifecycleState.inactive: At least one
50 * view of the application is visible, but none have input focus. The
51 * application is otherwise running normally.
52 */
54
55 /**
56 * Corresponds to the Framework's AppLifecycleState.hidden: All views of an
57 * application are hidden, either because the application is being stopped (on
58 * iOS and Android), or because it is being minimized or on a desktop that is
59 * no longer visible (on desktop), or on a tab that is no longer visible (on
60 * web).
61 */
62 kHidden,
63
64 /**
65 * Corresponds to the Framework's AppLifecycleState.paused: The application is
66 * not running, and can be detached or started again at any time. This state
67 * is typically only entered into on iOS and Android.
68 */
69 kPaused,
70};
@ kDetached
Definition: process.h:84

◆ Clip

Enumerator
kNone 
kHardEdge 
kAntiAlias 
kAntiAliasWithSaveLayer 

Definition at line 53 of file layer.h.

@ kAntiAlias
Definition: layer.h:53
@ kAntiAliasWithSaveLayer
Definition: layer.h:53
@ kNone
Definition: layer.h:53
@ kHardEdge
Definition: layer.h:53

◆ ColorSpace

Enumerator
kSRGB 
kExtendedSRGB 

Definition at line 16 of file image.h.

16 {
17 kSRGB,
19};
@ kExtendedSRGB
Definition: image.h:18
@ kSRGB
Definition: image.h:17

◆ ContextType

enum class flutter::ContextType
strong
Enumerator
kRender 

The context is used to render to a texture or renderbuffer.

kResource 

The context will only be used to transfer resources to and from device memory. No rendering will be performed using this context.

Definition at line 17 of file context_options.h.

17 {
18 /// The context is used to render to a texture or renderbuffer.
19 kRender,
20 /// The context will only be used to transfer resources to and from device
21 /// memory. No rendering will be performed using this context.
23};
@ kRender
The context is used to render to a texture or renderbuffer.

◆ DartErrorCode

enum class flutter::DartErrorCode
strong

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 unknown error.

Definition at line 49 of file shell.h.

49 {
50 // NOLINTBEGIN(readability-identifier-naming)
51 /// No error has occurred.
52 NoError = 0,
53 /// The Dart error code for an API error.
54 ApiError = 253,
55 /// The Dart error code for a compilation error.
56 CompilationError = 254,
57 /// The Dart error code for an unknown error.
58 UnknownError = 255
59 // NOLINTEND(readability-identifier-naming)
60};
@ CompilationError
The Dart error code for a compilation error.
@ ApiError
The Dart error code for an API error.
@ NoError
No error has occurred.
@ UnknownError
The Dart error code for an unknown error.

◆ DisplayListCompare

enum class flutter::DisplayListCompare
strong
Enumerator
kUseBulkCompare 
kNotEqual 
kEqual 

Definition at line 72 of file dl_op_records.h.

72 {
73 // The Op is deferring comparisons to a bulk memcmp performed lazily
74 // across all bulk-comparable ops.
76
77 // The Op provided a specific equals method that spotted a difference
79
80 // The Op provided a specific equals method that saw no differences
81 kEqual,
82};

◆ DisplayListOpType

enum class flutter::DisplayListOpType
strong

Definition at line 141 of file display_list.h.

141 {
143#ifdef IMPELLER_ENABLE_3D
144 DL_OP_TO_ENUM_VALUE(SetSceneColorSource)
145#endif // IMPELLER_ENABLE_3D
146};
#define FOR_EACH_DISPLAY_LIST_OP(V)
Definition: display_list.h:58
#define DL_OP_TO_ENUM_VALUE(name)
Definition: display_list.h:140

◆ DlBlendMode

enum class flutter::DlBlendMode
strong

A enum define the blend mode. Blends are operators that take in two colors (source, destination) and return a new color. Many of these operate the same on all 4 components: red, green, blue, alpha. For these, we just document what happens to one component, rather than naming each one separately. Different color types might have different representations for color components: 8-bit: 0..255 6-bit: 0..63 5-bit: 0..31 4-bit: 0..15 floats: 0...1 The comments are expressed as if the component values are always 0..1 (floats). For brevity, the documentation uses the following abbreviations s : source d : destination sa : source alpha da : destination alpha Results are abbreviated r : if all 4 components are computed in the same manner ra : result alpha component rc : result "color": red, green, blue components

Enumerator
kClear 

r = 0

kSrc 

r = s

kDst 

r = d

kSrcOver 

r = s + (1-sa)*d

kDstOver 

r = d + (1-da)*s

kSrcIn 

r = s * da

kDstIn 

r = d * sa

kSrcOut 

r = s * (1-da)

kDstOut 

r = d * (1-sa)

kSrcATop 

r = s*da + d*(1-sa)

kDstATop 

r = d*sa + s*(1-da)

kXor 

r = s*(1-da) + d*(1-sa)

kPlus 

r = min(s + d, 1)

kModulate 

r = s*d

kScreen 

r = s + d - s*d

kOverlay 

multiply or screen, depending on destination

kDarken 

rc = s + d - max(s*da, d*sa), ra = kSrcOver

kLighten 

rc = s + d - min(s*da, d*sa), ra = kSrcOver

kColorDodge 

brighten destination to reflect source

kColorBurn 

darken destination to reflect source

kHardLight 

multiply or screen, depending on source

kSoftLight 

lighten or darken, depending on source

kDifference 

rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver

kExclusion 

rc = s + d - two(s*d), ra = kSrcOver

kMultiply 

r = s*(1-da) + d*(1-sa) + s*d

kHue 

hue of source with saturation and luminosity of destination

kSaturation 

saturation of source with hue and luminosity of destination

kColor 

hue and saturation of source with luminosity of destination

kLuminosity 

luminosity of source with hue and saturation of destination

kLastCoeffMode 

last porter duff blend mode

kLastSeparableMode 

last blend mode operating separately on components

kLastMode 

last valid value

kDefaultMode 

Definition at line 26 of file dl_blend_mode.h.

26 {
27 kClear, //!< r = 0
28 kSrc, //!< r = s
29 kDst, //!< r = d
30 kSrcOver, //!< r = s + (1-sa)*d
31 kDstOver, //!< r = d + (1-da)*s
32 kSrcIn, //!< r = s * da
33 kDstIn, //!< r = d * sa
34 kSrcOut, //!< r = s * (1-da)
35 kDstOut, //!< r = d * (1-sa)
36 kSrcATop, //!< r = s*da + d*(1-sa)
37 kDstATop, //!< r = d*sa + s*(1-da)
38 kXor, //!< r = s*(1-da) + d*(1-sa)
39 kPlus, //!< r = min(s + d, 1)
40 kModulate, //!< r = s*d
41 kScreen, //!< r = s + d - s*d
42
43 kOverlay, //!< multiply or screen, depending on destination
44 kDarken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver
45 kLighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver
46 kColorDodge, //!< brighten destination to reflect source
47 kColorBurn, //!< darken destination to reflect source
48 kHardLight, //!< multiply or screen, depending on source
49 kSoftLight, //!< lighten or darken, depending on source
50 kDifference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
51 kExclusion, //!< rc = s + d - two(s*d), ra = kSrcOver
52 kMultiply, //!< r = s*(1-da) + d*(1-sa) + s*d
53
54 kHue, //!< hue of source with saturation and luminosity of destination
55 kSaturation, //!< saturation of source with hue and luminosity of destination
56 kColor, //!< hue and saturation of source with luminosity of destination
57 kLuminosity, //!< luminosity of source with hue and saturation of destination
58
59 kLastCoeffMode = kScreen, //!< last porter duff blend mode
61 kMultiply, //!< last blend mode operating separately on components
62 kLastMode = kLuminosity, //!< last valid value
64};
static constexpr SkColor kColor
Definition: CanvasTest.cpp:265
@ kSrcOut
r = s * (1-da)
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kPlus
r = min(s + d, 1)
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kLastCoeffMode
last porter duff blend mode
@ kColorDodge
brighten destination to reflect source
@ kScreen
r = s + d - s*d
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ kLastSeparableMode
last blend mode operating separately on components
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ kLastMode
last valid value
@ kHardLight
multiply or screen, depending on source
@ kDstOut
r = d * (1-sa)
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver

◆ DlBlurStyle

enum class flutter::DlBlurStyle
strong
Enumerator
kNormal 

fuzzy inside and outside

kSolid 

solid inside, fuzzy outside

kOuter 

nothing inside, fuzzy outside

kInner 

fuzzy inside, nothing outside

Definition at line 24 of file dl_mask_filter.h.

24 {
25 kNormal, //!< fuzzy inside and outside
26 kSolid, //!< solid inside, fuzzy outside
27 kOuter, //!< nothing inside, fuzzy outside
28 kInner, //!< fuzzy inside, nothing outside
29};
@ kNormal
Default priority level.
Definition: embedder.h:262
@ kOuter
nothing inside, fuzzy outside
@ kInner
fuzzy inside, nothing outside

◆ DlColorFilterType

enum class flutter::DlColorFilterType
strong
Enumerator
kBlend 
kMatrix 
kSrgbToLinearGamma 
kLinearToSrgbGamma 

Definition at line 23 of file dl_color_filter.h.

◆ DlColorSourceType

enum class flutter::DlColorSourceType
strong
Enumerator
kColor 
kImage 
kLinearGradient 
kRadialGradient 
kConicalGradient 
kSweepGradient 
kRuntimeEffect 

Definition at line 51 of file dl_color_source.h.

◆ DlDrawStyle

enum class flutter::DlDrawStyle
strong
Enumerator
kFill 

fills interior of shapes

kStroke 

strokes boundary of shapes

kStrokeAndFill 

both strokes and fills shapes

kLastStyle 
kDefaultStyle 

Definition at line 19 of file dl_paint.h.

19 {
20 kFill, //!< fills interior of shapes
21 kStroke, //!< strokes boundary of shapes
22 kStrokeAndFill, //!< both strokes and fills shapes
23
26};
@ kStrokeAndFill
both strokes and fills shapes
@ kStroke
strokes boundary of shapes
@ kFill
fills interior of shapes

◆ DlFilterMode

enum class flutter::DlFilterMode
strong
Enumerator
kNearest 
kLinear 
kLast 

Definition at line 10 of file dl_sampling_options.h.

10 {
11 kNearest, // single sample point (nearest neighbor)
12 kLinear, // interporate between 2x2 sample points (bilinear interpolation)
13
14 kLast = kLinear,
15};
static constexpr skcms_TransferFunction kLinear
Definition: SkColorSpace.h:51

◆ DlImageFilterType

enum class flutter::DlImageFilterType
strong
Enumerator
kBlur 
kDilate 
kErode 
kMatrix 
kCompose 
kColorFilter 
kLocalMatrix 

Definition at line 29 of file dl_image_filter.h.

◆ DlImageSampling

enum class flutter::DlImageSampling
strong
Enumerator
kNearestNeighbor 
kLinear 
kMipmapLinear 
kCubic 

Definition at line 17 of file dl_sampling_options.h.

◆ DlMaskFilterType

enum class flutter::DlMaskFilterType
strong
Enumerator
kBlur 

Definition at line 22 of file dl_mask_filter.h.

22{ kBlur };

◆ DlStrokeCap

enum class flutter::DlStrokeCap
strong
Enumerator
kButt 

no stroke extension

kRound 

adds circle

kSquare 

adds square

kLastCap 
kDefaultCap 

Definition at line 28 of file dl_paint.h.

28 {
29 kButt, //!< no stroke extension
30 kRound, //!< adds circle
31 kSquare, //!< adds square
32
35};
@ kRound
adds circle
@ kButt
no stroke extension
@ kSquare
adds square

◆ DlStrokeJoin

enum class flutter::DlStrokeJoin
strong
Enumerator
kMiter 

extends to miter limit

kRound 

adds circle

kBevel 

connects outside edges

kLastJoin 
kDefaultJoin 

Definition at line 37 of file dl_paint.h.

37 {
38 kMiter, //!< extends to miter limit
39 kRound, //!< adds circle
40 kBevel, //!< connects outside edges
41
44};
@ kMiter
extends to miter limit
@ kBevel
connects outside edges

◆ DlTileMode

enum class flutter::DlTileMode
strong
Enumerator
kClamp 
kRepeat 
kMirror 
kDecal 

Definition at line 13 of file dl_tile_mode.h.

13 {
14 // Replicate the edge color if the |DlColorSource| draws outside of the
15 // defined bounds.
16 kClamp,
17
18 // Repeat the |DlColorSource|'s defined colors both horizontally and
19 // vertically (or both along and perpendicular to a gradient's geometry).
20 kRepeat,
21
22 // Repeat the |DlColorSource|'s colors horizontally and vertically,
23 // alternating mirror images so that adjacent images always seam.
24 kMirror,
25
26 // Only draw within the original domain, return transparent-black everywhere
27 // else.
28 kDecal,
29};

◆ DlVertexMode

enum class flutter::DlVertexMode
strong

Defines the way in which the vertices of a DlVertices object are separated into triangles into which to render.

Enumerator
kTriangles 

The vertices are taken 3 at a time to form a triangle.

kTriangleStrip 

The vertices are taken in overlapping triplets to form triangles, with each triplet sharing 2 of its vertices with the preceding and following triplets. vertices [ABCDE] yield 3 triangles ABC,BCD,CDE

kTriangleFan 

The vertices are taken in overlapping pairs and combined with the first vertex to form triangles that radiate outward from the initial point. vertices [ABCDE] yield 3 triangles ABC,ACD,ADE

Definition at line 20 of file dl_vertices.h.

20 {
21 /// The vertices are taken 3 at a time to form a triangle.
23
24 /// The vertices are taken in overlapping triplets to form triangles, with
25 /// each triplet sharing 2 of its vertices with the preceding and following
26 /// triplets.
27 /// vertices [ABCDE] yield 3 triangles ABC,BCD,CDE
29
30 /// The vertices are taken in overlapping pairs and combined with the first
31 /// vertex to form triangles that radiate outward from the initial point.
32 /// vertices [ABCDE] yield 3 triangles ABC,ACD,ADE
34};
@ kTriangles
The vertices are taken 3 at a time to form a triangle.

◆ DrawStatus

enum class flutter::DrawStatus
strong
Enumerator
kDone 
kNotSetUp 
kYielded 
kPipelineEmpty 
kGpuUnavailable 

Definition at line 53 of file rasterizer.h.

53 {
54 // The drawing was done without any specified status.
55 kDone,
56 // Failed to rasterize the frame because the Rasterizer is not set up.
58 // Nothing was done, because the call was not on the raster thread. Yielded to
59 // let this frame be serviced on the right thread.
61 // Nothing was done, because the pipeline was empty.
63 // Nothing was done, because the GPU was unavailable.
65};

◆ DrawSurfaceStatus

enum class flutter::DrawSurfaceStatus
strong
Enumerator
kSuccess 
kRetry 
kFailed 
kDiscarded 

Definition at line 68 of file rasterizer.h.

68 {
69 // The layer tree was successfully rasterized.
71 // The layer tree must be submitted again.
72 //
73 // This can occur on Android when switching the background surface to
74 // FlutterImageView. On Android, the first frame doesn't make the image
75 // available to the ImageReader right away. The second frame does.
76 // TODO(egarciad): https://github.com/flutter/flutter/issues/65652
77 //
78 // This can also occur when the frame is dropped to wait for the thread
79 // merger to merge the raster and platform threads.
80 kRetry,
81 // Failed to rasterize the frame.
82 kFailed,
83 // Layer tree was discarded because its size does not match the view size.
84 // This typically occurs during resizing.
86};
@ kSuccess
Definition: embedder.h:73

◆ FocusChangeDirection

enum class flutter::FocusChangeDirection
strong
Enumerator
kProgrammatic 
kForward 
kBackward 

Definition at line 17 of file platform_view_manager.h.

17 {
18 kProgrammatic, // Un-directed focus change.
19 kForward, // Keyboard focus moves forwards, e.g. TAB key.
20 kBackward // Keyboard focus moves backwards, e.g. Shift+TAB.
21};

◆ GpuAvailability

enum class flutter::GpuAvailability
strong

Values for |Shell::SetGpuAvailability|.

Enumerator
kAvailable 

Indicates that GPU operations should be permitted.

kFlushAndMakeUnavailable 

Indicates that the GPU is about to become unavailable, and to attempt to flush any GPU related resources now.

kUnavailable 

Indicates that the GPU is unavailable, and that no attempt should be made to even flush GPU objects until it is available again.

Definition at line 63 of file shell.h.

63 {
64 /// Indicates that GPU operations should be permitted.
65 kAvailable = 0,
66 /// Indicates that the GPU is about to become unavailable, and to attempt to
67 /// flush any GPU related resources now.
69 /// Indicates that the GPU is unavailable, and that no attempt should be made
70 /// to even flush GPU objects until it is available again.
71 kUnavailable = 2
72};
@ kAvailable
Indicates that GPU operations should be permitted.

◆ ImageByteFormat

Enumerator
kRawRGBA 
kRawStraightRGBA 
kRawUnmodified 
kRawExtendedRgba128 
kPNG 

Definition at line 17 of file image_encoding.h.

◆ IOSRenderingAPI

enum class flutter::IOSRenderingAPI
strong
Enumerator
kSoftware 
kMetal 

Definition at line 14 of file rendering_api_selection.h.

14 {
16 kMetal,
17};
@ kMetal
Definition: embedder.h:85

◆ IOSRenderingBackend

enum class flutter::IOSRenderingBackend
strong
Enumerator
kSkia 
kImpeller 

Definition at line 19 of file rendering_api_selection.h.

◆ IsolateLaunchType

enum class flutter::IsolateLaunchType
strong

Describes whether the isolate is part of a group or not.

If the isolate is part of a group, it avoids reloading the kernel snapshot.

Enumerator
kNewGroup 

The isolate is launched as a solo isolate or to start a new group.

kExistingGroup 

The isolate is launched as part of a group, and avoids reloading the kernel snapshot.

Definition at line 25 of file isolate_configuration.h.

25 {
26 /// The isolate is launched as a solo isolate or to start a new group.
28 /// The isolate is launched as part of a group, and avoids reloading the
29 /// kernel snapshot.
31};
@ kNewGroup
The isolate is launched as a solo isolate or to start a new group.

◆ KeyEventDeviceType

enum class flutter::KeyEventDeviceType : int64_t
strong
Enumerator
kKeyboard 
kDirectionalPad 
kGamepad 
kJoystick 
kHdmi 

Definition at line 34 of file key_data.h.

34 : int64_t {
35 // The source is a keyboard.
36 kKeyboard = 0,
37
38 // The source is a directional pad on something like a television remote
39 // control or similar.
41
42 // The source is a gamepad button.
44
45 // The source is a joystick button.
47
48 // The source is a device connected to an HDMI bus.
49 kHdmi,
50};

◆ KeyEventType

enum class flutter::KeyEventType : int64_t
strong
Enumerator
kDown 
kUp 
kRepeat 

Definition at line 22 of file key_data.h.

22 : int64_t {
23 kDown = 0,
24 kUp,
25 kRepeat,
26};
@ kUp
Definition: embedder.h:973
@ kDown
Definition: embedder.h:980

◆ MaskFilterType

Enumerator
kNull 
kBlur 

Definition at line 59 of file paint.cc.

59{ kNull, kBlur };
@ kNull
Definition: paint.cc:59

◆ ModifierFlag

Bits in |NSEvent.modifierFlags| indicating whether a modifier key is pressed.

These constants are not written in the official documentation, but derived from experiments. This is currently the only way to know whether a one-side modifier key (such as ShiftLeft) is pressed, instead of the general combined modifier state (such as Shift).

Enumerator
kModifierFlagControlLeft 
kModifierFlagShiftLeft 
kModifierFlagShiftRight 
kModifierFlagMetaLeft 
kModifierFlagMetaRight 
kModifierFlagAltLeft 
kModifierFlagAltRight 
kModifierFlagControlRight 

Definition at line 79 of file KeyCodeMap_Internal.h.

79 {
ModifierFlag
@ kModifierFlagControlLeft
@ kModifierFlagAltRight
@ kModifierFlagControlRight
@ kModifierFlagMetaRight
@ kModifierFlagShiftLeft
@ kModifierFlagShiftRight
@ kModifierFlagAltLeft
@ kModifierFlagMetaLeft

◆ MTLRenderTargetType

enum class flutter::MTLRenderTargetType
strong
Enumerator
kMTLTexture 
kCAMetalLayer 

Definition at line 38 of file gpu_surface_metal_delegate.h.

◆ MutatorType

Enumerator
kClipRect 
kClipRRect 
kClipPath 
kTransform 
kOpacity 
kBackdropFilter 

Definition at line 37 of file embedded_views.h.

◆ PipelineConsumeResult

enum class flutter::PipelineConsumeResult
strong
Enumerator
NoneAvailable 
Done 
MoreAvailable 

Definition at line 29 of file pipeline.h.

29 {
30 // NOLINTBEGIN(readability-identifier-naming)
32 Done,
34 // NOLINTEND(readability-identifier-naming)
35};

◆ PlatformProvidedMenu

enum class flutter::PlatformProvidedMenu
strong
Enumerator
kAbout 
kQuit 
kServicesSubmenu 
kHide 
kHideOtherApplications 
kShowAllApplications 
kStartSpeaking 
kStopSpeaking 
kToggleFullScreen 
kMinimizeWindow 
kZoomWindow 
kArrangeWindowsInFront 

Definition at line 12 of file platform_provided_menu.h.

12 {
13 // orderFrontStandardAboutPanel macOS provided menu
14 kAbout,
15
16 // terminate macOS provided menu
17 kQuit,
18
19 // Services macOS provided submenu.
21
22 // hide macOS provided menu
23 kHide,
24
25 // hideOtherApplications macOS provided menu
27
28 // unhideAllApplications macOS provided menu
30
31 // startSpeaking macOS provided menu
33
34 // stopSpeaking macOS provided menu
36
37 // toggleFullScreen macOS provided menu
39
40 // performMiniaturize macOS provided menu
42
43 // performZoom macOS provided menu
45
46 // arrangeInFront macOS provided menu
48};

◆ PointerButtonMouse

Enumerator
kPointerButtonMousePrimary 
kPointerButtonMouseSecondary 
kPointerButtonMouseMiddle 
kPointerButtonMouseBack 
kPointerButtonMouseForward 

Definition at line 13 of file pointer_data.h.

13 : int64_t {
19};
@ kPointerButtonMouseBack
Definition: pointer_data.h:17
@ kPointerButtonMouseForward
Definition: pointer_data.h:18
@ kPointerButtonMouseSecondary
Definition: pointer_data.h:15
@ kPointerButtonMouseMiddle
Definition: pointer_data.h:16
@ kPointerButtonMousePrimary
Definition: pointer_data.h:14

◆ PointerButtonStylus

Enumerator
kPointerButtonStylusContact 
kPointerButtonStylusPrimary 
kPointerButtonStylusSecondary 

Definition at line 25 of file pointer_data.h.

25 : int64_t {
29};
@ kPointerButtonStylusSecondary
Definition: pointer_data.h:28
@ kPointerButtonStylusPrimary
Definition: pointer_data.h:27
@ kPointerButtonStylusContact
Definition: pointer_data.h:26

◆ PointerButtonTouch

Enumerator
kPointerButtonTouchContact 

Definition at line 21 of file pointer_data.h.

21 : int64_t {
23};
@ kPointerButtonTouchContact
Definition: pointer_data.h:22

◆ PostPrerollResult

enum class flutter::PostPrerollResult
strong
Enumerator
kSuccess 
kResubmitFrame 
kSkipAndRetryFrame 

Definition at line 318 of file embedded_views.h.

318 {
319 // Frame has successfully rasterized.
320 kSuccess,
321 // Frame is submitted twice. This is currently only used when
322 // thread configuration change occurs.
324 // Frame is dropped and a new frame with the same layer tree is
325 // attempted. This is currently only used when thread configuration
326 // change occurs.
328};

◆ RasterCacheKeyKind

enum class flutter::RasterCacheKeyKind
strong
Enumerator
kLayerMetrics 
kDisplayListMetrics 

Definition at line 77 of file raster_cache_key.h.

◆ RasterCacheKeyType

enum class flutter::RasterCacheKeyType
strong
Enumerator
kLayer 
kDisplayList 
kLayerChildren 

Definition at line 23 of file raster_cache_key.h.

◆ RasterCacheLayerStrategy

Enumerator
kLayer 
kLayerChildren 

Definition at line 27 of file raster_cache.h.

◆ RasterStatus

enum class flutter::RasterStatus
strong
Enumerator
kSuccess 
kResubmit 
kSkipAndRetry 

Definition at line 28 of file compositor_context.h.

28 {
29 // Frame has been successfully rasterized.
31 // Frame has been submited, but must be submitted again. This is only used
32 // on Android when switching the background surface to FlutterImageView.
33 //
34 // On Android, the first frame doesn't make the image available
35 // to the ImageReader right away. The second frame does.
36 //
37 // TODO(egarciad): https://github.com/flutter/flutter/issues/65652
39 // Frame has be dropped and a new frame with the same layer tree must be
40 // attempted.
41 //
42 // This is currently used to wait for the thread merger to merge
43 // the raster and platform threads.
44 //
45 // Since the thread merger may be disabled, the system will proceed
46 // with separate threads for rasterization and platform tasks,
47 // potentially leading to different performance characteristics.
49};

◆ SemanticsAction

enum class 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 
kMoveCursorForwardByWord 
kMoveCursorBackwardByWord 
kSetText 
kFocus 

Definition at line 22 of file semantics_node.h.

22 : int32_t {
23 kTap = 1 << 0,
24 kLongPress = 1 << 1,
25 kScrollLeft = 1 << 2,
26 kScrollRight = 1 << 3,
27 kScrollUp = 1 << 4,
28 kScrollDown = 1 << 5,
29 kIncrease = 1 << 6,
30 kDecrease = 1 << 7,
31 kShowOnScreen = 1 << 8,
34 kSetSelection = 1 << 11,
35 kCopy = 1 << 12,
36 kCut = 1 << 13,
37 kPaste = 1 << 14,
40 kCustomAction = 1 << 17,
41 kDismiss = 1 << 18,
44 kSetText = 1 << 21,
45 kFocus = 1 << 22,
46};

◆ SemanticsFlags

enum class 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 
kIsMultiline 
kIsReadOnly 
kIsFocusable 
kIsLink 
kIsSlider 
kIsKeyboardKey 
kIsCheckStateMixed 
kHasExpandedState 
kIsExpanded 

Definition at line 65 of file semantics_node.h.

65 : int32_t {
66 kHasCheckedState = 1 << 0,
67 kIsChecked = 1 << 1,
68 kIsSelected = 1 << 2,
69 kIsButton = 1 << 3,
70 kIsTextField = 1 << 4,
71 kIsFocused = 1 << 5,
72 kHasEnabledState = 1 << 6,
73 kIsEnabled = 1 << 7,
75 kIsHeader = 1 << 9,
76 kIsObscured = 1 << 10,
77 kScopesRoute = 1 << 11,
78 kNamesRoute = 1 << 12,
79 kIsHidden = 1 << 13,
80 kIsImage = 1 << 14,
81 kIsLiveRegion = 1 << 15,
82 kHasToggledState = 1 << 16,
83 kIsToggled = 1 << 17,
84 kHasImplicitScrolling = 1 << 18,
85 kIsMultiline = 1 << 19,
86 kIsReadOnly = 1 << 20,
87 kIsFocusable = 1 << 21,
88 kIsLink = 1 << 22,
89 kIsSlider = 1 << 23,
90 kIsKeyboardKey = 1 << 24,
91 kIsCheckStateMixed = 1 << 25,
92 kHasExpandedState = 1 << 26,
93 kIsExpanded = 1 << 27,
94};

◆ StringAttributeType

enum class flutter::StringAttributeType : int32_t
strong
Enumerator
kSpellOut 
kLocale 

Definition at line 27 of file string_attribute.h.

27 : int32_t {
29 kLocale,
30};
@ kSpellOut
Definition: embedder.h:1202
@ kLocale
Definition: embedder.h:1204

◆ TracingResult

enum class flutter::TracingResult
strong
Enumerator
kNotAttempted 
kEnabled 
kNotNecessary 
kDisabled 

Definition at line 17 of file ptrace_check.h.

◆ WindowStateEvent

enum class flutter::WindowStateEvent
strong

An event representing a change in window state that may update the.

Enumerator
kShow 
kHide 
kFocus 
kUnfocus 

Definition at line 24 of file windows_lifecycle_manager.h.

Function Documentation

◆ __attribute__()

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

◆ AndroidPlatformThreadConfigSetter()

static void flutter::AndroidPlatformThreadConfigSetter ( const fml::Thread::ThreadConfig config)
static

Inheriting ThreadConfigurer and use Android platform thread API to configure the thread priorities

Definition at line 38 of file android_shell_holder.cc.

39 {
40 // set thread name
42 // set thread priority
43 switch (config.priority) {
46 if (::setpriority(PRIO_PROCESS, 0, 10) != 0) {
47 FML_LOG(ERROR) << "Failed to set IO task runner priority";
48 }
49 break;
50 }
53 if (::setpriority(PRIO_PROCESS, 0, -1) != 0) {
54 FML_LOG(ERROR) << "Failed to set UI task runner priority";
55 }
56 break;
57 }
60 // Android describes -8 as "most important display threads, for
61 // compositing the screen and retrieving input events". Conservatively
62 // set the raster thread to slightly lower priority than it.
63 if (::setpriority(PRIO_PROCESS, 0, -5) != 0) {
64 // Defensive fallback. Depending on the OEM, it may not be possible
65 // to set priority to -5.
66 if (::setpriority(PRIO_PROCESS, 0, -2) != 0) {
67 FML_LOG(ERROR) << "Failed to set raster task runner priority";
68 }
69 }
70 break;
71 }
72 default:
74 if (::setpriority(PRIO_PROCESS, 0, 0) != 0) {
75 FML_LOG(ERROR) << "Failed to set priority";
76 }
77 }
78}
@ kRaster
Suitable for thread which raster data.
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
@ kDisplay
Suitable for threads which generate data for the display.
static void SetCurrentThreadName(const ThreadConfig &config)
Definition: thread.cc:135
#define FML_LOG(severity)
Definition: logging.h:82
@ kPerformance
Request CPU affinity for the performance cores.
@ kEfficiency
Request CPU affinity for the efficiency cores.
@ kNotPerformance
Request affinity for all non-performance cores.
bool RequestAffinity(CpuAffinity affinity)
Request the given affinity for the current thread.
Definition: cpu_affinity.cc:26
ThreadPriority priority
Definition: thread.h:45
#define ERROR(message)
Definition: elf_loader.cc:260

◆ AppLifecycleStateToString()

constexpr const char * flutter::AppLifecycleStateToString ( AppLifecycleState  state)
constexpr

Definition at line 72 of file app_lifecycle_state.h.

72 {
73 switch (state) {
75 return "AppLifecycleState.detached";
76 case AppLifecycleState::kResumed:
77 return "AppLifecycleState.resumed";
78 case AppLifecycleState::kInactive:
79 return "AppLifecycleState.inactive";
80 case AppLifecycleState::kHidden:
81 return "AppLifecycleState.hidden";
82 case AppLifecycleState::kPaused:
83 return "AppLifecycleState.paused";
84 }
85}
AtkStateType state

◆ AttachJNI()

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

Definition at line 158 of file platform_view_android_jni_impl.cc.

158 {
159 fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterJNI);
160 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
161 std::make_shared<PlatformViewAndroidJNIImpl>(java_object);
162 auto shell_holder = std::make_unique<AndroidShellHolder>(
163 FlutterMain::Get().GetSettings(), jni_facade);
164 if (shell_holder->IsValid()) {
165 return reinterpret_cast<jlong>(shell_holder.release());
166 } else {
167 return 0;
168 }
169}
const GrXPFactory * Get(SkBlendMode mode)
Definition: __init__.py:1

◆ BENCHMARK() [1/4]

flutter::BENCHMARK ( BM_PathVolatilityTracker  ) -> Unit(benchmark::kMillisecond)

◆ BENCHMARK() [2/4]

flutter::BENCHMARK ( BM_ShellInitialization  )

◆ BENCHMARK() [3/4]

flutter::BENCHMARK ( BM_ShellInitializationAndShutdown  )

◆ BENCHMARK() [4/4]

flutter::BENCHMARK ( BM_ShellShutdown  )

◆ BENCHMARK_CAPTURE() [1/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderDefault  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [2/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderDefault  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [3/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderDefault  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [4/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderDefault  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [5/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithClipRect  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [6/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithClipRect  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [7/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithClipRect  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [8/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithClipRect  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [9/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithGlobalSaveLayer  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [10/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithGlobalSaveLayer  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [11/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithGlobalSaveLayer  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [12/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithGlobalSaveLayer  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [13/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithPerspective  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [14/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithPerspective  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [15/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithPerspective  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [16/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithPerspective  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [17/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayer  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [18/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayer  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [19/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayer  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [20/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayer  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [21/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayerAndImageFilter  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [22/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayerAndImageFilter  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [23/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayerAndImageFilter  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [24/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithSaveLayerAndImageFilter  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [25/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithScaleAndTranslate  ,
kBounds  ,
DisplayListBuilderBenchmarkType::kBounds   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [26/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithScaleAndTranslate  ,
kBoundsAndRtree  ,
DisplayListBuilderBenchmarkType::kBoundsAndRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [27/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithScaleAndTranslate  ,
kDefault  ,
DisplayListBuilderBenchmarkType::kDefault   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [28/76]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListBuilderWithScaleAndTranslate  ,
kRtree  ,
DisplayListBuilderBenchmarkType::kRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [29/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_IntersectsRegion  ,
LargeAsymmetric  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [30/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_IntersectsRegion  ,
MediumAsymmetric  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [31/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_IntersectsRegion  ,
SmallAsymmetric  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [32/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_IntersectsRegion  ,
TinyAsymmetric  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [33/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_Large  ,
RegionOp::kIntersection  ,
false  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [34/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_LargeAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [35/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_Medium  ,
RegionOp::kIntersection  ,
false  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [36/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_MediumAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [37/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_SingleRect_Large  ,
RegionOp::kIntersection  ,
true  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [38/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_SingleRect_Medium  ,
RegionOp::kIntersection  ,
true  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [39/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_SingleRect_Small  ,
RegionOp::kIntersection  ,
true  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [40/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_SingleRect_Tiny  ,
RegionOp::kIntersection  ,
true  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [41/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_Small  ,
RegionOp::kIntersection  ,
false  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [42/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_SmallAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [43/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_Tiny  ,
RegionOp::kIntersection  ,
false  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [44/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Intersection_TinyAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [45/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_Large  ,
RegionOp::kUnion  ,
false  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [46/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_LargeAsymmetric  ,
RegionOp::kUnion  ,
false  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [47/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_Medium  ,
RegionOp::kUnion  ,
false  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [48/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_MediumAsymmetric  ,
RegionOp::kUnion  ,
false  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [49/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_Small  ,
RegionOp::kUnion  ,
false  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [50/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_SmallAsymmetric  ,
RegionOp::kUnion  ,
false  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [51/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_Tiny  ,
RegionOp::kUnion  ,
false  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [52/76]

flutter::BENCHMARK_CAPTURE ( BM_DlRegion_Operation  ,
Union_TinyAsymmetric  ,
RegionOp::kUnion  ,
false  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [53/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_IntersectsRegion  ,
LargeAsymmetric  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [54/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_IntersectsRegion  ,
MediumAsymmetric  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [55/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_IntersectsRegion  ,
SmallAsymmetric  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [56/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_IntersectsRegion  ,
TinyAsymmetric  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kNanosecond)

◆ BENCHMARK_CAPTURE() [57/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_Large  ,
RegionOp::kIntersection  ,
false  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [58/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_LargeAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [59/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_Medium  ,
RegionOp::kIntersection  ,
false  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [60/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_MediumAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [61/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_SingleRect_Large  ,
RegionOp::kIntersection  ,
true  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [62/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_SingleRect_Medium  ,
RegionOp::kIntersection  ,
true  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [63/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_SingleRect_Small  ,
RegionOp::kIntersection  ,
true  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [64/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_SingleRect_Tiny  ,
RegionOp::kIntersection  ,
true  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [65/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_Small  ,
RegionOp::kIntersection  ,
false  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [66/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_SmallAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [67/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_Tiny  ,
RegionOp::kIntersection  ,
false  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [68/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Intersection_TinyAsymmetric  ,
RegionOp::kIntersection  ,
false  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [69/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_Large  ,
RegionOp::kUnion  ,
false  ,
1500  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [70/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_LargeAsymmetric  ,
RegionOp::kUnion  ,
false  ,
1500  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [71/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_Medium  ,
RegionOp::kUnion  ,
false  ,
400  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [72/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_MediumAsymmetric  ,
RegionOp::kUnion  ,
false  ,
400  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [73/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_Small  ,
RegionOp::kUnion  ,
false  ,
100  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [74/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_SmallAsymmetric  ,
RegionOp::kUnion  ,
false  ,
100  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [75/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_Tiny  ,
RegionOp::kUnion  ,
false  ,
30  ,
1.  0 
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [76/76]

flutter::BENCHMARK_CAPTURE ( BM_SkRegion_Operation  ,
Union_TinyAsymmetric  ,
RegionOp::kUnion  ,
false  ,
30  ,
kSizeFactorSmall   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE_ALL() [1/3]

flutter::BENCHMARK_CAPTURE_ALL ( BM_AdapterDispatchOverhead  )

◆ BENCHMARK_CAPTURE_ALL() [2/3]

flutter::BENCHMARK_CAPTURE_ALL ( BM_SetIdentity  )

◆ BENCHMARK_CAPTURE_ALL() [3/3]

flutter::BENCHMARK_CAPTURE_ALL ( BM_SetPerspective  )

◆ BENCHMARK_CAPTURE_ALL_ARGS() [1/3]

flutter::BENCHMARK_CAPTURE_ALL_ARGS ( BM_Rotate  ,
kPiOver4   
)

◆ BENCHMARK_CAPTURE_ALL_ARGS() [2/3]

flutter::BENCHMARK_CAPTURE_ALL_ARGS ( BM_Scale  ,
2.  0f 
)

◆ BENCHMARK_CAPTURE_ALL_ARGS() [3/3]

flutter::BENCHMARK_CAPTURE_ALL_ARGS ( BM_Translate  ,
10.  0f,
15.  0f 
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [1/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [2/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
Perspective   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [3/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [4/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [5/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [6/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertAndCheck  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [7/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [8/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
Perspective   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [9/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [10/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [11/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [12/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_InvertUnchecked  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [13/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [14/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
PerspectiveClipFour   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [15/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
PerspectiveClipNone   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [16/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
PerspectiveClipOne   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [17/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
PerspectiveClipThree   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [18/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
PerspectiveClipTwo   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [19/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [20/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [21/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [22/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformAndClipRect  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [23/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [24/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
Perspective   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [25/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [26/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [27/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [28/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoint  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [29/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [30/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
Perspective   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [31/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [32/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [33/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [34/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformPoints  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [35/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
Identity   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [36/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
PerspectiveClipFour   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [37/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
PerspectiveClipNone   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [38/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
PerspectiveClipOne   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [39/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
PerspectiveClipThree   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [40/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
PerspectiveClipTwo   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [41/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [42/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
Scale   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [43/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP() [44/44]

flutter::BENCHMARK_CAPTURE_ALL_SETUP ( BM_TransformRectFast  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP2() [1/5]

flutter::BENCHMARK_CAPTURE_ALL_SETUP2 ( BM_Concat  ,
Perspective  ,
ScaleTranslate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP2() [2/5]

flutter::BENCHMARK_CAPTURE_ALL_SETUP2 ( BM_Concat  ,
Scale  ,
Translate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP2() [3/5]

flutter::BENCHMARK_CAPTURE_ALL_SETUP2 ( BM_Concat  ,
ScaleTranslate  ,
Perspective   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP2() [4/5]

flutter::BENCHMARK_CAPTURE_ALL_SETUP2 ( BM_Concat  ,
ScaleTranslate  ,
Rotate   
)

◆ BENCHMARK_CAPTURE_ALL_SETUP2() [5/5]

flutter::BENCHMARK_CAPTURE_ALL_SETUP2 ( BM_Concat  ,
ScaleTranslate  ,
ScaleTranslate   
)

◆ BlurRadiusEqualToBlurRadius()

BOOL flutter::BlurRadiusEqualToBlurRadius ( CGFloat  radius1,
CGFloat  radius2 
)

Definition at line 69 of file FlutterPlatformViews_Internal.mm.

69 {
70 const CGFloat epsilon = 0.01;
71 return radius1 - radius2 < epsilon;
72}

◆ BM_AdapterDispatchOverhead()

static void flutter::BM_AdapterDispatchOverhead ( benchmark::State &  state,
AdapterType  type 
)
static

Definition at line 577 of file dl_transform_benchmarks.cc.

578 {
579 auto adapter = GetAdapter(type);
580 TestTransform transform;
581 while (state.KeepRunning()) {
582 adapter->DoNothing(transform);
583 }
584}
GLenum type
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47

◆ BM_Concat()

static void flutter::BM_Concat ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  a_setup,
const SetupFunction &  b_setup 
)
static

Definition at line 647 of file dl_transform_benchmarks.cc.

650 {
651 auto adapter = GetAdapter(type);
652 TestTransform a, b, result;
653 a_setup(adapter.get(), a, nullptr);
654 b_setup(adapter.get(), b, nullptr);
655 while (state.KeepRunning()) {
656 adapter->Concat(a, b, result);
657 }
658}
static bool b
struct MyStruct a[10]
GAsyncResult * result

◆ BM_DisplayListBuilderDefault()

static void flutter::BM_DisplayListBuilderDefault ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 62 of file dl_builder_benchmarks.cc.

63 {
64 bool prepare_rtree = NeedPrepareRTree(type);
65 while (state.KeepRunning()) {
66 DisplayListBuilder builder(prepare_rtree);
67 InvokeAllRenderingOps(builder);
68 Complete(builder, type);
69 }
70}

◆ BM_DisplayListBuilderWithClipRect()

static void flutter::BM_DisplayListBuilderWithClipRect ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 98 of file dl_builder_benchmarks.cc.

100 {
101 SkRect clip_bounds = SkRect::MakeLTRB(6.5, 7.3, 90.2, 85.7);
102 bool prepare_rtree = NeedPrepareRTree(type);
103 while (state.KeepRunning()) {
104 DisplayListBuilder builder(prepare_rtree);
105 builder.ClipRect(clip_bounds, DlCanvas::ClipOp::kIntersect, true);
106 InvokeAllRenderingOps(builder);
107 Complete(builder, type);
108 }
109}
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

◆ BM_DisplayListBuilderWithGlobalSaveLayer()

static void flutter::BM_DisplayListBuilderWithGlobalSaveLayer ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 111 of file dl_builder_benchmarks.cc.

113 {
114 bool prepare_rtree = NeedPrepareRTree(type);
115 while (state.KeepRunning()) {
116 DisplayListBuilder builder(prepare_rtree);
117 builder.Scale(3.5, 3.5);
118 builder.Translate(10.3, 6.9);
119 builder.SaveLayer(nullptr, nullptr);
120 builder.Translate(45.3, 27.9);
122 for (auto& group : allRenderingOps) {
123 for (size_t i = 0; i < group.variants.size(); i++) {
124 auto& invocation = group.variants[i];
125 invocation.Invoke(receiver);
126 }
127 }
128 builder.Restore();
129 Complete(builder, type);
130 }
131}
Internal API for rendering recorded display lists to backends.
DlOpReceiver & DisplayListBuilderBenchmarkAccessor(DisplayListBuilder &builder)

◆ BM_DisplayListBuilderWithPerspective()

static void flutter::BM_DisplayListBuilderWithPerspective ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 85 of file dl_builder_benchmarks.cc.

87 {
88 bool prepare_rtree = NeedPrepareRTree(type);
89 while (state.KeepRunning()) {
90 DisplayListBuilder builder(prepare_rtree);
91 builder.TransformFullPerspective(0, 1, 0, 12, 1, 0, 0, 33, 3, 2, 5, 29, 0,
92 0, 0, 12);
93 InvokeAllRenderingOps(builder);
94 Complete(builder, type);
95 }
96}

◆ BM_DisplayListBuilderWithSaveLayer()

static void flutter::BM_DisplayListBuilderWithSaveLayer ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 133 of file dl_builder_benchmarks.cc.

135 {
136 bool prepare_rtree = NeedPrepareRTree(type);
137 while (state.KeepRunning()) {
138 DisplayListBuilder builder(prepare_rtree);
140 for (auto& group : allRenderingOps) {
141 for (size_t i = 0; i < group.variants.size(); i++) {
142 auto& invocation = group.variants[i];
143 builder.SaveLayer(nullptr, nullptr);
144 invocation.Invoke(receiver);
145 builder.Restore();
146 }
147 }
148 Complete(builder, type);
149 }
150}

◆ BM_DisplayListBuilderWithSaveLayerAndImageFilter()

static void flutter::BM_DisplayListBuilderWithSaveLayerAndImageFilter ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 152 of file dl_builder_benchmarks.cc.

154 {
155 DlPaint layer_paint;
157 SkRect layer_bounds = SkRect::MakeLTRB(6.5, 7.3, 35.2, 42.7);
158 bool prepare_rtree = NeedPrepareRTree(type);
159 while (state.KeepRunning()) {
160 DisplayListBuilder builder(prepare_rtree);
162 for (auto& group : allRenderingOps) {
163 for (size_t i = 0; i < group.variants.size(); i++) {
164 auto& invocation = group.variants[i];
165 builder.SaveLayer(&layer_bounds, &layer_paint);
166 invocation.Invoke(receiver);
167 builder.Restore();
168 }
169 }
170 Complete(builder, type);
171 }
172}
DlPaint & setImageFilter(const std::shared_ptr< const DlImageFilter > &filter)
Definition: dl_paint.h:157
static const DlBlurImageFilter kTestBlurImageFilter1(5.0, 5.0, DlTileMode::kClamp)

◆ BM_DisplayListBuilderWithScaleAndTranslate()

static void flutter::BM_DisplayListBuilderWithScaleAndTranslate ( benchmark::State &  state,
DisplayListBuilderBenchmarkType  type 
)
static

Definition at line 72 of file dl_builder_benchmarks.cc.

74 {
75 bool prepare_rtree = NeedPrepareRTree(type);
76 while (state.KeepRunning()) {
77 DisplayListBuilder builder(prepare_rtree);
78 builder.Scale(3.5, 3.5);
79 builder.Translate(10.3, 6.9);
80 InvokeAllRenderingOps(builder);
81 Complete(builder, type);
82 }
83}

◆ BM_DlRegion_FromRects()

static void flutter::BM_DlRegion_FromRects ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 260 of file dl_region_benchmarks.cc.

260 {
261 RunFromRectsBenchmark<DlRegionAdapter>(state, maxSize);
262}

◆ BM_DlRegion_GetRects()

static void flutter::BM_DlRegion_GetRects ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 268 of file dl_region_benchmarks.cc.

268 {
269 RunGetRectsBenchmark<DlRegionAdapter>(state, maxSize);
270}

◆ BM_DlRegion_IntersectsRegion()

static void flutter::BM_DlRegion_IntersectsRegion ( benchmark::State &  state,
int  maxSize,
double  sizeFactor 
)
static

Definition at line 294 of file dl_region_benchmarks.cc.

296 {
297 RunIntersectsRegionBenchmark<DlRegionAdapter>(state, maxSize, sizeFactor);
298}

◆ BM_DlRegion_IntersectsSingleRect()

static void flutter::BM_DlRegion_IntersectsSingleRect ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 306 of file dl_region_benchmarks.cc.

307 {
308 RunIntersectsSingleRectBenchmark<DlRegionAdapter>(state, maxSize);
309}

◆ BM_DlRegion_Operation()

static void flutter::BM_DlRegion_Operation ( benchmark::State &  state,
RegionOp  op,
bool  withSingleRect,
int  maxSize,
double  sizeFactor 
)
static

Definition at line 276 of file dl_region_benchmarks.cc.

280 {
281 RunRegionOpBenchmark<DlRegionAdapter>(state, op, withSingleRect, maxSize,
282 sizeFactor);
283}

◆ BM_InvertAndCheck()

static void flutter::BM_InvertAndCheck ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 737 of file dl_transform_benchmarks.cc.

739 {
740 auto adapter = GetAdapter(type);
741 TestTransform transform;
742 setup(adapter.get(), transform, nullptr);
743 TestTransform result;
744 while (state.KeepRunning()) {
745 adapter->InvertAndCheck(transform, result);
746 }
747}
static void setup(SkCanvas *canvas, SkPaint *paint, const SkBitmap &bm, SkFilterMode fm, SkTileMode tmx, SkTileMode tmy)
Definition: tilemodes.cpp:52

◆ BM_InvertUnchecked()

static void flutter::BM_InvertUnchecked ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 725 of file dl_transform_benchmarks.cc.

727 {
728 auto adapter = GetAdapter(type);
729 TestTransform transform;
730 setup(adapter.get(), transform, nullptr);
731 TestTransform result;
732 while (state.KeepRunning()) {
733 adapter->InvertUnchecked(transform, result);
734 }
735}

◆ BM_PathVolatilityTracker()

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

Definition at line 70 of file ui_benchmarks.cc.

70 {
72 "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
73 ThreadHost::Type::kIo | ThreadHost::Type::kUi));
74 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
75 thread_host.raster_thread->GetTaskRunner(),
76 thread_host.ui_thread->GetTaskRunner(),
77 thread_host.io_thread->GetTaskRunner());
78
79 VolatilePathTracker tracker(task_runners.GetUITaskRunner(), true);
80
81 while (state.KeepRunning()) {
82 std::vector<std::shared_ptr<VolatilePathTracker::TrackedPath>> paths;
83 constexpr int path_count = 1000;
84 for (int i = 0; i < path_count; i++) {
85 auto path = std::make_shared<VolatilePathTracker::TrackedPath>();
86 path->path = SkPath();
87 path->path.setIsVolatile(true);
88 paths.push_back(std::move(path));
89 }
90
92 task_runners.GetUITaskRunner()->PostTask([&]() {
93 for (const auto& path : paths) {
94 tracker.Track(path);
95 }
96 latch.Signal();
97 });
98
99 latch.Wait();
100
101 task_runners.GetUITaskRunner()->PostTask([&]() { tracker.OnFrame(); });
102
103 for (int i = 0; i < path_count - 10; ++i) {
104 paths[i].reset();
105 }
106
107 task_runners.GetUITaskRunner()->PostTask([&]() { tracker.OnFrame(); });
108
109 latch.Reset();
110 task_runners.GetUITaskRunner()->PostTask([&]() { latch.Signal(); });
111 latch.Wait();
112 }
113}
Definition: SkPath.h:59
@ kRaster
Suitable for thread which raster data.
Definition: embedder.h:266
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
The collection of all the threads used by the engine.
Definition: thread_host.h:21

◆ BM_PlatformMessageResponseDartComplete()

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

Definition at line 22 of file ui_benchmarks.cc.

22 {
24 "test", ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
25 ThreadHost::Type::kIo | ThreadHost::Type::kUi));
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();
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}
static sk_sp< Effect > Create()
Definition: RefCntTest.cpp:117
virtual Settings CreateSettingsForFixture()
Definition: dart_fixture.cc:30
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char *str)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
DART_EXPORT Dart_Handle Dart_RootLibrary(void)
#define FML_CHECK(condition)
Definition: logging.h:85
Win32Message message
std::string GetDefaultKernelFilePath()
Returns the default path to kernel_blob.bin. This file is within the directory returned by GetFixture...
Definition: testing.cc:19
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 &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::shared_ptr< VolatilePathTracker > volatile_path_tracker, std::unique_ptr< PlatformConfiguration > platform_configuration)
std::function< void()> closure
Definition: closure.h:14
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ BM_Rotate()

static void flutter::BM_Rotate ( benchmark::State &  state,
AdapterType  type,
float  radians 
)
static

Definition at line 636 of file dl_transform_benchmarks.cc.

638 {
639 auto adapter = GetAdapter(type);
640 TestTransform transform;
641 adapter->InitTransformIdentity(transform);
642 while (state.KeepRunning()) {
643 adapter->RotateRadians(transform, radians);
644 }
645}

◆ BM_Scale()

static void flutter::BM_Scale ( benchmark::State &  state,
AdapterType  type,
float  scale 
)
static

Definition at line 620 of file dl_transform_benchmarks.cc.

620 {
621 auto adapter = GetAdapter(type);
622 TestTransform transform;
623 adapter->InitTransformIdentity(transform);
624 float inv_scale = 1.0f / scale;
625 bool flip = true;
626 while (state.KeepRunning()) {
627 if (flip) {
628 adapter->Scale(transform, scale, scale);
629 } else {
630 adapter->Scale(transform, inv_scale, inv_scale);
631 }
632 flip = !flip;
633 }
634}
const Scalar scale

◆ BM_SetIdentity()

static void flutter::BM_SetIdentity ( benchmark::State &  state,
AdapterType  type 
)
static

Definition at line 586 of file dl_transform_benchmarks.cc.

586 {
587 auto adapter = GetAdapter(type);
588 TestTransform transform;
589 while (state.KeepRunning()) {
590 adapter->InitTransformIdentity(transform);
591 }
592}

◆ BM_SetPerspective()

static void flutter::BM_SetPerspective ( benchmark::State &  state,
AdapterType  type 
)
static

Definition at line 594 of file dl_transform_benchmarks.cc.

594 {
595 auto adapter = GetAdapter(type);
596 TestTransform transform;
597 while (state.KeepRunning()) {
598 adapter->InitTransformColMatrix(transform, kSimplePerspective);
599 }
600}

◆ BM_ShellInitialization()

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

Definition at line 99 of file shell_benchmarks.cc.

99 {
100 while (state.KeepRunning()) {
101 StartupAndShutdownShell(state, true, false);
102 }
103}
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 115 of file shell_benchmarks.cc.

115 {
116 while (state.KeepRunning()) {
117 StartupAndShutdownShell(state, true, true);
118 }
119}

◆ BM_ShellShutdown()

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

Definition at line 107 of file shell_benchmarks.cc.

107 {
108 while (state.KeepRunning()) {
109 StartupAndShutdownShell(state, false, true);
110 }
111}

◆ BM_SkRegion_FromRects()

static void flutter::BM_SkRegion_FromRects ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 264 of file dl_region_benchmarks.cc.

264 {
265 RunFromRectsBenchmark<SkRegionAdapter>(state, maxSize);
266}

◆ BM_SkRegion_GetRects()

static void flutter::BM_SkRegion_GetRects ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 272 of file dl_region_benchmarks.cc.

272 {
273 RunGetRectsBenchmark<SkRegionAdapter>(state, maxSize);
274}

◆ BM_SkRegion_IntersectsRegion()

static void flutter::BM_SkRegion_IntersectsRegion ( benchmark::State &  state,
int  maxSize,
double  sizeFactor 
)
static

Definition at line 300 of file dl_region_benchmarks.cc.

302 {
303 RunIntersectsRegionBenchmark<SkRegionAdapter>(state, maxSize, sizeFactor);
304}

◆ BM_SkRegion_IntersectsSingleRect()

static void flutter::BM_SkRegion_IntersectsSingleRect ( benchmark::State &  state,
int  maxSize 
)
static

Definition at line 311 of file dl_region_benchmarks.cc.

312 {
313 RunIntersectsSingleRectBenchmark<SkRegionAdapter>(state, maxSize);
314}

◆ BM_SkRegion_Operation()

static void flutter::BM_SkRegion_Operation ( benchmark::State &  state,
RegionOp  op,
bool  withSingleRect,
int  maxSize,
double  sizeFactor 
)
static

Definition at line 285 of file dl_region_benchmarks.cc.

289 {
290 RunRegionOpBenchmark<SkRegionAdapter>(state, op, withSingleRect, maxSize,
291 sizeFactor);
292}

◆ BM_TransformAndClipRect()

static void flutter::BM_TransformAndClipRect ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 712 of file dl_transform_benchmarks.cc.

714 {
715 auto adapter = GetAdapter(type);
716 TestTransform transform;
717 TestRect rect, result;
718 adapter->InitRectLTRB(rect, 100, 100, 200, 200);
719 setup(adapter.get(), transform, &rect);
720 while (state.KeepRunning()) {
721 adapter->TransformAndClipRect(transform, rect, result);
722 }
723}
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ BM_TransformPoint()

static void flutter::BM_TransformPoint ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 660 of file dl_transform_benchmarks.cc.

662 {
663 auto adapter = GetAdapter(type);
664 TestTransform transform;
665 setup(adapter.get(), transform, nullptr);
666 TestPoint point, result;
667 adapter->InitPoint(point, 25.7, 32.4);
668 while (state.KeepRunning()) {
669 adapter->TransformPoint(transform, point, result);
670 }
671}

◆ BM_TransformPoints()

static void flutter::BM_TransformPoints ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 673 of file dl_transform_benchmarks.cc.

675 {
676 auto adapter = GetAdapter(type);
677 TestTransform transform;
678 setup(adapter.get(), transform, nullptr);
679 const int Xs = 10;
680 const int Ys = 10;
681 const int N = Xs * Ys;
682 TestPoint points[N];
683 for (int i = 0; i < Xs; i++) {
684 for (int j = 0; j < Ys; j++) {
685 int index = i * Xs + j;
686 FML_CHECK(index < N);
687 adapter->InitPoint(points[index], i * 23.3 + 17, j * 32.7 + 12);
688 }
689 }
690 TestPoint results[N];
691 int64_t item_count = 0;
692 while (state.KeepRunning()) {
693 adapter->TransformPoints(transform, points, results, N);
694 item_count += N;
695 }
696 state.SetItemsProcessed(item_count);
697}
static const int points[]
#define N
Definition: beziers.cpp:19

◆ BM_TransformRectFast()

static void flutter::BM_TransformRectFast ( benchmark::State &  state,
AdapterType  type,
const SetupFunction &  setup 
)
static

Definition at line 699 of file dl_transform_benchmarks.cc.

701 {
702 auto adapter = GetAdapter(type);
703 TestTransform transform;
704 TestRect rect, result;
705 adapter->InitRectLTRB(rect, 100, 100, 200, 200);
706 setup(adapter.get(), transform, &rect);
707 while (state.KeepRunning()) {
708 adapter->TransformRectFast(transform, rect, result);
709 }
710}

◆ BM_Translate()

static void flutter::BM_Translate ( benchmark::State &  state,
AdapterType  type,
float  tx,
float  ty 
)
static

Definition at line 602 of file dl_transform_benchmarks.cc.

605 {
606 auto adapter = GetAdapter(type);
607 TestTransform transform;
608 adapter->InitTransformIdentity(transform);
609 bool flip = true;
610 while (state.KeepRunning()) {
611 if (flip) {
612 adapter->Translate(transform, tx, ty);
613 } else {
614 adapter->Translate(transform, -tx, -ty);
615 }
616 flip = !flip;
617 }
618}

◆ bytes_needed()

static size_t flutter::bytes_needed ( int  vertex_count,
Flags  flags,
int  index_count 
)
static

Definition at line 23 of file dl_vertices.cc.

23 {
24 int needed = sizeof(DlVertices);
25 // We always have vertices
26 needed += vertex_count * sizeof(SkPoint);
27 if (flags.has_texture_coordinates) {
28 needed += vertex_count * sizeof(SkPoint);
29 }
30 if (flags.has_colors) {
31 needed += vertex_count * sizeof(DlColor);
32 }
33 if (index_count > 0) {
34 needed += index_count * sizeof(uint16_t);
35 }
36 return needed;
37}
Holds all of the data (both required and optional) for a DisplayList drawVertices call.
Definition: dl_vertices.h:71
FlutterSemanticsFlag flags
flutter::DlColor DlColor

◆ CastToMetalContext()

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

Definition at line 21 of file ios_surface_metal_skia.mm.

22 {
23 return (IOSContextMetalSkia*)context.get();
24}

◆ CheckEncodeDecode()

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

Definition at line 37 of file standard_message_codec_unittests.cc.

42 {
43 const StandardMessageCodec& codec =
44 StandardMessageCodec::GetInstance(serializer);
45 auto encoded = codec.EncodeMessage(value);
46 ASSERT_TRUE(encoded);
47 EXPECT_EQ(*encoded, expected_encoding);
48
49 auto decoded = codec.DecodeMessage(*encoded);
50 if (custom_comparator) {
51 EXPECT_TRUE(custom_comparator(value, *decoded));
52 } else {
53 EXPECT_EQ(value, *decoded);
54 }
55}
std::unique_ptr< T > DecodeMessage(const uint8_t *binary_message, const size_t message_size) const
Definition: message_codec.h:29
std::unique_ptr< std::vector< uint8_t > > EncodeMessage(const T &message) const
Definition: message_codec.h:45
uint8_t value
#define EXPECT_TRUE(handle)
Definition: unit_test.h:678

◆ 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 62 of file standard_message_codec_unittests.cc.

65 {
66 EXPECT_TRUE(std::holds_alternative<EncodableMap>(value));
67 const StandardMessageCodec& codec = StandardMessageCodec::GetInstance();
68 auto encoded = codec.EncodeMessage(value);
69 ASSERT_TRUE(encoded);
70
71 EXPECT_EQ(encoded->size(), expected_encoding_length);
72 ASSERT_GT(encoded->size(), expected_encoding_prefix.size());
74 encoded->begin(), encoded->begin() + expected_encoding_prefix.size(),
75 expected_encoding_prefix.begin(), expected_encoding_prefix.end()));
76
77 auto decoded = codec.DecodeMessage(*encoded);
78
79 EXPECT_EQ(value, *decoded);
80}
static bool equal(const SkBitmap &a, const SkBitmap &b)
Definition: ImageTest.cpp:1395

◆ ChooseCompatibleAlphaType()

static SkAlphaType flutter::ChooseCompatibleAlphaType ( SkAlphaType  type)
static

Definition at line 107 of file image_decoder_impeller.cc.

107 {
108 return type;
109}

◆ ChooseCompatibleColorType()

static SkColorType flutter::ChooseCompatibleColorType ( SkColorType  type)
static

Definition at line 98 of file image_decoder_impeller.cc.

98 {
99 switch (type) {
102 default:
104 }
105}
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition: SkColorType.h:38
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
Definition: SkColorType.h:40

◆ ChooseEGLConfiguration()

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

Definition at line 27 of file android_context_gl_skia.cc.

27 {
28 EGLint attributes[] = {
29 // clang-format off
30 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
31 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
32 EGL_RED_SIZE, 8,
33 EGL_GREEN_SIZE, 8,
34 EGL_BLUE_SIZE, 8,
35 EGL_ALPHA_SIZE, 8,
36 EGL_DEPTH_SIZE, 0,
37 EGL_STENCIL_SIZE, 0,
38 EGL_NONE, // termination sentinel
39 // clang-format on
40 };
41
42 EGLint config_count = 0;
43 EGLConfig egl_config = nullptr;
44
45 if (eglChooseConfig(display, attributes, &egl_config, 1, &config_count) !=
46 EGL_TRUE) {
47 return {false, nullptr};
48 }
49
50 bool success = config_count > 0 && egl_config != nullptr;
51
52 return {success, success ? egl_config : nullptr};
53}

◆ CleanupMessageData()

static void flutter::CleanupMessageData ( JNIEnv *  env,
jobject  jcaller,
jlong  message_data 
)
static

Definition at line 435 of file platform_view_android_jni_impl.cc.

437 {
438 // Called from any thread.
439 free(reinterpret_cast<void*>(message_data));
440}

◆ Close()

API void flutter::Close ( SkPath path)

Definition at line 36 of file path_ops.cc.

36 {
37 path->close();
38}

◆ CommandLineFromNSProcessInfo()

fml::CommandLine flutter::CommandLineFromNSProcessInfo ( NSProcessInfo *  processInfoOrNil = nil)

Definition at line 11 of file command_line.mm.

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

◆ CompareOps()

static bool flutter::CompareOps ( const uint8_t *  ptrA,
const uint8_t *  endA,
const uint8_t *  ptrB,
const uint8_t *  endB 
)
static

Definition at line 243 of file display_list.cc.

246 {
247 // These conditions are checked by the caller...
248 FML_DCHECK((endA - ptrA) == (endB - ptrB));
249 FML_DCHECK(ptrA != ptrB);
250 const uint8_t* bulk_start_a = ptrA;
251 const uint8_t* bulk_start_b = ptrB;
252 while (ptrA < endA && ptrB < endB) {
253 auto opA = reinterpret_cast<const DLOp*>(ptrA);
254 auto opB = reinterpret_cast<const DLOp*>(ptrB);
255 if (opA->type != opB->type || opA->size != opB->size) {
256 return false;
257 }
258 ptrA += opA->size;
259 ptrB += opB->size;
260 FML_DCHECK(ptrA <= endA);
261 FML_DCHECK(ptrB <= endB);
263 switch (opA->type) {
264#define DL_OP_EQUALS(name) \
265 case DisplayListOpType::k##name: \
266 result = static_cast<const name##Op*>(opA)->equals( \
267 static_cast<const name##Op*>(opB)); \
268 break;
269
271#ifdef IMPELLER_ENABLE_3D
272 DL_OP_EQUALS(SetSceneColorSource)
273#endif // IMPELLER_ENABLE_3D
274
275#undef DL_OP_EQUALS
276
277 default:
278 FML_DCHECK(false);
279 return false;
280 }
281 switch (result) {
282 case DisplayListCompare::kNotEqual:
283 return false;
284 case DisplayListCompare::kUseBulkCompare:
285 break;
286 case DisplayListCompare::kEqual:
287 // Check if we have a backlog of bytes to bulk compare and then
288 // reset the bulk compare pointers to the address following this op
289 auto bulk_bytes = reinterpret_cast<const uint8_t*>(opA) - bulk_start_a;
290 if (bulk_bytes > 0) {
291 if (memcmp(bulk_start_a, bulk_start_b, bulk_bytes) != 0) {
292 return false;
293 }
294 }
295 bulk_start_a = ptrA;
296 bulk_start_b = ptrB;
297 break;
298 }
299 }
300 if (ptrA != endA || ptrB != endB) {
301 return false;
302 }
303 if (bulk_start_a < ptrA) {
304 // Perform a final bulk compare if we have remaining bytes waiting
305 if (memcmp(bulk_start_a, bulk_start_b, ptrA - bulk_start_a) != 0) {
306 return false;
307 }
308 }
309 return true;
310}
#define DL_OP_EQUALS(name)
#define FML_DCHECK(condition)
Definition: logging.h:103
DisplayListCompare
Definition: dl_op_records.h:72

◆ compute_bounds()

static SkRect flutter::compute_bounds ( const SkPoint points,
int  count 
)
static

Definition at line 88 of file dl_vertices.cc.

88 {
89 AccumulationRect accumulator;
90 for (int i = 0; i < count; i++) {
91 accumulator.accumulate(points[i]);
92 }
93 return accumulator.bounds();
94}
int count
Definition: FontMgrTest.cpp:50
void accumulate(SkScalar x, SkScalar y)

◆ ConfigureShell()

static void flutter::ConfigureShell ( Shell shell)
static

Definition at line 131 of file tester_main.cc.

131 {
132 auto device_pixel_ratio = 3.0;
133 auto physical_width = 2400.0; // 800 at 3x resolution.
134 auto physical_height = 1800.0; // 600 at 3x resolution.
135
136 std::vector<std::unique_ptr<Display>> displays;
137 displays.push_back(std::make_unique<Display>(
138 0, 60, physical_width, physical_height, device_pixel_ratio));
139 shell->OnDisplayUpdates(std::move(displays));
140
141 flutter::ViewportMetrics metrics{};
142 metrics.device_pixel_ratio = device_pixel_ratio;
143 metrics.physical_width = physical_width;
144 metrics.physical_height = physical_height;
145 metrics.display_id = 0;
146 shell->GetPlatformView()->SetViewportMetrics(kImplicitViewId, metrics);
147}
static constexpr FlutterViewId kImplicitViewId

◆ ConvertChar32ToUtf8()

std::string flutter::ConvertChar32ToUtf8 ( char32_t  ch)

Definition at line 38 of file keyboard_key_embedder_handler.cc.

38 {
39 std::string result;
40 FML_DCHECK(0 <= ch && ch <= 0x10FFFF) << "Character out of range";
41 if (ch <= 0x007F) {
42 result.push_back(ch);
43 } else if (ch <= 0x07FF) {
44 result.push_back(0b11000000 + _GetBit(ch, 11, 6));
45 result.push_back(0b10000000 + _GetBit(ch, 6, 0));
46 } else if (ch <= 0xFFFF) {
47 result.push_back(0b11100000 + _GetBit(ch, 16, 12));
48 result.push_back(0b10000000 + _GetBit(ch, 12, 6));
49 result.push_back(0b10000000 + _GetBit(ch, 6, 0));
50 } else {
51 result.push_back(0b11110000 + _GetBit(ch, 21, 18));
52 result.push_back(0b10000000 + _GetBit(ch, 18, 12));
53 result.push_back(0b10000000 + _GetBit(ch, 12, 6));
54 result.push_back(0b10000000 + _GetBit(ch, 6, 0));
55 }
56 return result;
57}

◆ ConvertImageToRasterSkia()

void flutter::ConvertImageToRasterSkia ( const sk_sp< DlImage > &  dl_image,
std::function< void(sk_sp< SkImage >)>  encode_task,
const fml::RefPtr< fml::TaskRunner > &  raster_task_runner,
const fml::RefPtr< fml::TaskRunner > &  io_task_runner,
const fml::WeakPtr< GrDirectContext > &  resource_context,
const fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > &  snapshot_delegate,
const std::shared_ptr< const fml::SyncSwitch > &  is_gpu_disabled_sync_switch 
)

Definition at line 14 of file image_encoding_skia.cc.

21 {
22 // If the owning_context is kRaster, we can't access it on this task runner.
23 if (dl_image->owning_context() != DlImage::OwningContext::kRaster) {
24 auto image = dl_image->skia_image();
25
26 // Check validity of the image.
27 if (image == nullptr) {
28 FML_LOG(ERROR) << "Image was null.";
29 encode_task(nullptr);
30 return;
31 }
32
33 auto dimensions = image->dimensions();
34
35 if (dimensions.isEmpty()) {
36 FML_LOG(ERROR) << "Image dimensions were empty.";
37 encode_task(nullptr);
38 return;
39 }
40
41 SkPixmap pixmap;
42 if (image->peekPixels(&pixmap)) {
43 // This is already a raster image.
44 encode_task(image);
45 return;
46 }
47
48 if (sk_sp<SkImage> raster_image = image->makeRasterImage()) {
49 // The image can be converted to a raster image.
50 encode_task(raster_image);
51 return;
52 }
53 }
54
55 if (!raster_task_runner) {
56 FML_LOG(ERROR) << "Raster task runner was null.";
57 encode_task(nullptr);
58 return;
59 }
60
61 if (!io_task_runner) {
62 FML_LOG(ERROR) << "IO task runner was null.";
63 encode_task(nullptr);
64 return;
65 }
66
67 // Cross-context images do not support makeRasterImage. Convert these images
68 // by drawing them into a surface. This must be done on the raster thread
69 // to prevent concurrent usage of the image on both the IO and raster threads.
70 raster_task_runner->PostTask([dl_image, encode_task = std::move(encode_task),
71 resource_context, snapshot_delegate,
72 io_task_runner, is_gpu_disabled_sync_switch,
73 raster_task_runner]() {
74 auto image = dl_image->skia_image();
75 if (!image || !snapshot_delegate) {
76 io_task_runner->PostTask(
77 [encode_task = encode_task]() mutable { encode_task(nullptr); });
78 return;
79 }
80
81 sk_sp<SkImage> raster_image =
82 snapshot_delegate->ConvertToRasterImage(image);
83
84 io_task_runner->PostTask([image, encode_task = encode_task,
85 raster_image = std::move(raster_image),
86 resource_context, is_gpu_disabled_sync_switch,
87 owning_context = dl_image->owning_context(),
88 raster_task_runner]() mutable {
89 if (!raster_image) {
90 // The rasterizer was unable to render the cross-context image
91 // (presumably because it does not have a GrContext). In that case,
92 // convert the image on the IO thread using the resource context.
94 image, resource_context, is_gpu_disabled_sync_switch);
95 }
96 encode_task(raster_image);
97 if (owning_context == DlImage::OwningContext::kRaster) {
98 raster_task_runner->PostTask([image = std::move(image)]() {});
99 }
100 });
101 });
102}
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
Definition: SkImage.cpp:267
SkISize dimensions() const
Definition: SkImage.h:297
bool peekPixels(SkPixmap *pixmap) const
Definition: SkImage.cpp:34
virtual void PostTask(const fml::closure &task) override
Definition: task_runner.cc:24
sk_sp< const SkImage > image
Definition: SkRecords.h:269
sk_sp< SkImage > ConvertToRasterUsingResourceContext(const sk_sp< SkImage > &image, const fml::WeakPtr< GrDirectContext > &resource_context, const std::shared_ptr< const SyncSwitch > &is_gpu_disabled_sync_switch)

◆ ConvertMappingToNSData()

NSData * flutter::ConvertMappingToNSData ( fml::MallocMapping  buffer)

Definition at line 35 of file buffer_conversions.mm.

35 {
36 size_t size = buffer.GetSize();
37 return [NSData dataWithBytesNoCopy:buffer.Release() length:size];
38}
size_t length
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ ConvertMutation() [1/4]

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

Definition at line 119 of file embedder_layers.cc.

120 {
121 FlutterPlatformViewMutation mutation = {};
132 return std::make_unique<FlutterPlatformViewMutation>(mutation);
133}
static constexpr int kMScaleX
horizontal scale factor
Definition: SkMatrix.h:353
static constexpr int kMTransY
vertical translation
Definition: SkMatrix.h:358
static constexpr int kMPersp1
input y perspective factor
Definition: SkMatrix.h:360
static constexpr int kMPersp0
input x perspective factor
Definition: SkMatrix.h:359
static constexpr int kMPersp2
perspective bias
Definition: SkMatrix.h:361
static constexpr int kMTransX
horizontal translation
Definition: SkMatrix.h:355
static constexpr int kMSkewY
vertical skew factor
Definition: SkMatrix.h:356
static constexpr int kMScaleY
vertical scale factor
Definition: SkMatrix.h:357
static constexpr int kMSkewX
horizontal skew factor
Definition: SkMatrix.h:354
@ kFlutterPlatformViewMutationTypeTransformation
Definition: embedder.h:1700
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
FlutterTransformation transformation
Definition: embedder.h:1710
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:1705
double transY
vertical translation
Definition: embedder.h:289
double pers2
perspective scale factor
Definition: embedder.h:295
double skewX
horizontal skew factor
Definition: embedder.h:281
double pers0
input x-axis perspective factor
Definition: embedder.h:291
double scaleX
horizontal scale factor
Definition: embedder.h:279
double skewY
vertical skew factor
Definition: embedder.h:285
double scaleY
vertical scale factor
Definition: embedder.h:287
double pers1
input y-axis perspective factor
Definition: embedder.h:293
double transX
horizontal translation
Definition: embedder.h:283

◆ ConvertMutation() [2/4]

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

Definition at line 81 of file embedder_layers.cc.

82 {
83 FlutterPlatformViewMutation mutation = {};
85 mutation.clip_rect.left = rect.left();
86 mutation.clip_rect.top = rect.top();
87 mutation.clip_rect.right = rect.right();
88 mutation.clip_rect.bottom = rect.bottom();
89 return std::make_unique<FlutterPlatformViewMutation>(mutation);
90}
@ kFlutterPlatformViewMutationTypeClipRect
Definition: embedder.h:1694
double bottom
Definition: embedder.h:441
double top
Definition: embedder.h:439
double left
Definition: embedder.h:438
double right
Definition: embedder.h:440

◆ ConvertMutation() [3/4]

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

Definition at line 99 of file embedder_layers.cc.

100 {
101 FlutterPlatformViewMutation mutation = {};
103 const auto& rect = rrect.rect();
104 mutation.clip_rounded_rect.rect.left = rect.left();
105 mutation.clip_rounded_rect.rect.top = rect.top();
106 mutation.clip_rounded_rect.rect.right = rect.right();
107 mutation.clip_rounded_rect.rect.bottom = rect.bottom();
109 VectorToSize(rrect.radii(SkRRect::Corner::kUpperLeft_Corner));
111 VectorToSize(rrect.radii(SkRRect::Corner::kUpperRight_Corner));
113 VectorToSize(rrect.radii(SkRRect::Corner::kLowerRight_Corner));
115 VectorToSize(rrect.radii(SkRRect::Corner::kLowerLeft_Corner));
116 return std::make_unique<FlutterPlatformViewMutation>(mutation);
117}
const SkRect & rect() const
Definition: SkRRect.h:264
SkVector radii(Corner corner) const
Definition: SkRRect.h:271
@ kFlutterPlatformViewMutationTypeClipRoundedRect
Definition: embedder.h:1697
SkRRect rrect
Definition: SkRecords.h:232
static FlutterSize VectorToSize(const SkVector &vector)
FlutterRoundedRect clip_rounded_rect
Definition: embedder.h:1709
FlutterRect rect
Definition: embedder.h:452
FlutterSize upper_left_corner_radius
Definition: embedder.h:453
FlutterSize lower_left_corner_radius
Definition: embedder.h:456
FlutterSize upper_right_corner_radius
Definition: embedder.h:454
FlutterSize lower_right_corner_radius
Definition: embedder.h:455

◆ ConvertMutation() [4/4]

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

Definition at line 73 of file embedder_layers.cc.

74 {
75 FlutterPlatformViewMutation mutation = {};
77 mutation.opacity = opacity;
78 return std::make_unique<FlutterPlatformViewMutation>(mutation);
79}
@ kFlutterPlatformViewMutationTypeOpacity
Definition: embedder.h:1691

◆ ConvertNSDataToMappingPtr()

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

Definition at line 40 of file buffer_conversions.mm.

40 {
41 return std::make_unique<NSDataMapping>(data);
42}

◆ ConvertToFlutterLocale()

std::vector< FlutterLocale > flutter::ConvertToFlutterLocale ( const std::vector< LanguageInfo > &  languages)

Definition at line 131 of file system_utils.cc.

132 {
133 std::vector<FlutterLocale> flutter_locales;
134 flutter_locales.reserve(languages.size());
135 for (const auto& info : languages) {
136 FlutterLocale locale = {};
137 locale.struct_size = sizeof(FlutterLocale);
138 locale.language_code = info.language.c_str();
139 if (!info.territory.empty()) {
140 locale.country_code = info.territory.c_str();
141 }
142 if (!info.codeset.empty()) {
143 locale.script_code = info.codeset.c_str();
144 }
145 if (!info.modifier.empty()) {
146 locale.variant_code = info.modifier.c_str();
147 }
148 flutter_locales.push_back(locale);
149 }
150
151 return flutter_locales;
152}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
const char * language_code
Definition: embedder.h:1941
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition: embedder.h:1937
const char * script_code
Definition: embedder.h:1951
const char * country_code
Definition: embedder.h:1946
const char * variant_code
Definition: embedder.h:1956

◆ ConvertToRasterUsingResourceContext()

template<typename SyncSwitch >
sk_sp< SkImage > flutter::ConvertToRasterUsingResourceContext ( const sk_sp< SkImage > &  image,
const fml::WeakPtr< GrDirectContext > &  resource_context,
const std::shared_ptr< const SyncSwitch > &  is_gpu_disabled_sync_switch 
)

Definition at line 18 of file image_encoding_impl.h.

21 {
24
25 is_gpu_disabled_sync_switch->Execute(
26 typename SyncSwitch::Handlers()
27 .SetIfTrue([&surface, &surface_info] {
28 surface = SkSurfaces::Raster(surface_info);
29 })
30 .SetIfFalse([&surface, &surface_info, resource_context] {
31 if (resource_context) {
33 resource_context.get(), skgpu::Budgeted::kNo, surface_info);
34 } else {
35 surface = SkSurfaces::Raster(surface_info);
36 }
37 }));
38
39 if (surface == nullptr || surface->getCanvas() == nullptr) {
40 FML_LOG(ERROR) << "Could not create a surface to copy the texture into.";
41 return nullptr;
42 }
43
44 surface->getCanvas()->drawImage(image, 0, 0);
45 if (resource_context) {
46 resource_context->flushAndSubmit();
47 }
48
49 auto snapshot = surface->makeImageSnapshot();
50
51 if (snapshot == nullptr) {
52 FML_LOG(ERROR) << "Could not snapshot image to encode.";
53 return nullptr;
54 }
55
56 return snapshot->makeRasterImage();
57}
T * get() const
Definition: weak_ptr.h:87
VkSurfaceKHR surface
Definition: main.cc:49
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static SkImageInfo MakeN32Premul(int width, int height)

◆ CopyMappingPtrToNSData()

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

Definition at line 44 of file buffer_conversions.mm.

44 {
45 return [NSData dataWithBytes:mapping->GetMapping() length:mapping->GetSize()];
46}

◆ CopyNSDataToMapping()

fml::MallocMapping flutter::CopyNSDataToMapping ( NSData *  data)

Definition at line 30 of file buffer_conversions.mm.

30 {
31 const uint8_t* bytes = static_cast<const uint8_t*>(data.bytes);
32 return fml::MallocMapping::Copy(bytes, data.length);
33}
static MallocMapping Copy(const T *begin, const T *end)
Definition: mapping.h:162

◆ CopyV() [1/2]

static void flutter::CopyV ( void *  dst)
static

Definition at line 21 of file dl_builder.cc.

21{}

◆ CopyV() [2/2]

template<typename S , typename... Rest>
static void flutter::CopyV ( void *  dst,
const S *  src,
int  n,
Rest &&...  rest 
)
static

Definition at line 24 of file dl_builder.cc.

24 {
25 FML_DCHECK(((uintptr_t)dst & (alignof(S) - 1)) == 0)
26 << "Expected " << dst << " to be aligned for at least " << alignof(S)
27 << " bytes.";
28 // If n is 0, there is nothing to copy into dst from src.
29 if (n > 0) {
30 memcpy(dst, src, n * sizeof(S));
31 dst = reinterpret_cast<void*>(reinterpret_cast<uint8_t*>(dst) +
32 n * sizeof(S));
33 }
34 // Repeat for the next items, if any
35 CopyV(dst, std::forward<Rest>(rest)...);
36}
static void CopyV(void *dst, const S *src, int n, Rest &&... rest)
Definition: dl_builder.cc:24
dst
Definition: cp.py:12

◆ CreateAndroidContext()

static std::shared_ptr< flutter::AndroidContext > flutter::CreateAndroidContext ( bool  use_software_rendering,
const flutter::TaskRunners task_runners,
AndroidRenderingAPI  android_rendering_api,
bool  enable_vulkan_validation,
bool  enable_opengl_gpu_tracing,
bool  enable_vulkan_gpu_tracing 
)
static

Definition at line 63 of file platform_view_android.cc.

69 {
70 switch (android_rendering_api) {
72 return std::make_shared<AndroidContext>(AndroidRenderingAPI::kSoftware);
73 case AndroidRenderingAPI::kImpellerOpenGLES:
74 return std::make_unique<AndroidContextGLImpeller>(
75 std::make_unique<impeller::egl::Display>(),
76 enable_opengl_gpu_tracing);
77 case AndroidRenderingAPI::kImpellerVulkan:
78 return std::make_unique<AndroidContextVulkanImpeller>(
79 enable_vulkan_validation, enable_vulkan_gpu_tracing);
80 case AndroidRenderingAPI::kSkiaOpenGLES:
81 return std::make_unique<AndroidContextGLSkia>(
82 fml::MakeRefCounted<AndroidEnvironmentGL>(), //
83 task_runners //
84 );
85 }
87}
#define FML_UNREACHABLE()
Definition: logging.h:109

◆ CreateContext()

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

Definition at line 17 of file android_context_gl_skia.cc.

19 {
20 EGLint attributes[] = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE};
21
22 EGLContext context = eglCreateContext(display, config, share, attributes);
23
24 return {context != EGL_NO_CONTEXT, context};
25}

◆ CreateDeferredImage() [1/2]

static sk_sp< DlImage > flutter::CreateDeferredImage ( bool  impeller,
sk_sp< DisplayList display_list,
uint32_t  width,
uint32_t  height,
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate snapshot_delegate,
fml::RefPtr< fml::TaskRunner raster_task_runner,
fml::RefPtr< SkiaUnrefQueue unref_queue 
)
static

Definition at line 58 of file picture.cc.

65 {
66#if IMPELLER_SUPPORTS_RENDERING
67 if (impeller) {
69 std::move(display_list), SkISize::Make(width, height),
70 std::move(snapshot_delegate), std::move(raster_task_runner));
71 }
72#endif // IMPELLER_SUPPORTS_RENDERING
73
74#if SLIMPELLER
75 FML_LOG(FATAL) << "Impeller opt-out unavailable.";
76 return nullptr;
77#else // SLIMPELLER
78 const SkImageInfo image_info = SkImageInfo::Make(
81 image_info, std::move(display_list), std::move(snapshot_delegate),
82 raster_task_runner, std::move(unref_queue));
83#endif // !SLIMPELLER
84}
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
#define FATAL(error)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
int32_t height
int32_t width
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)

◆ CreateDeferredImage() [2/2]

static sk_sp< DlImage > flutter::CreateDeferredImage ( bool  impeller,
std::unique_ptr< LayerTree layer_tree,
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate snapshot_delegate,
fml::RefPtr< fml::TaskRunner raster_task_runner,
fml::RefPtr< SkiaUnrefQueue unref_queue 
)
static

Definition at line 74 of file scene.cc.

79 {
80#if IMPELLER_SUPPORTS_RENDERING
81 if (impeller) {
82 return DlDeferredImageGPUImpeller::Make(std::move(layer_tree),
83 std::move(snapshot_delegate),
84 std::move(raster_task_runner));
85 }
86#endif // IMPELLER_SUPPORTS_RENDERING
87
88#if SLIMPELLER
89 FML_LOG(FATAL) << "Impeller opt-out unavailable.";
90 return nullptr;
91#else // SLIMPELLER
92 const auto& frame_size = layer_tree->frame_size();
93 const SkImageInfo image_info =
94 SkImageInfo::Make(frame_size.width(), frame_size.height(),
96 return DlDeferredImageGPUSkia::MakeFromLayerTree(
97 image_info, std::move(layer_tree), std::move(snapshot_delegate),
98 raster_task_runner, std::move(unref_queue));
99#endif // SLIMPELLER
100}

◆ 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.

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) {
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}
static SkString identifier(const FontFamilyDesc &family, const FontDesc &font)
#define SAFE_ACCESS(pointer, member, default_value)
BoolCallback runs_task_on_current_thread_callback
Definition: embedder.h:1572
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition: embedder.h:1583
void * user_data

◆ CreateFinishedBuildRecorder() [1/2]

static std::unique_ptr< FrameTimingsRecorder > flutter::CreateFinishedBuildRecorder ( )
static

Definition at line 147 of file rasterizer_unittests.cc.

147 {
149}
static TimePoint Now()
Definition: time_point.cc:49
static std::unique_ptr< FrameTimingsRecorder > CreateFinishedBuildRecorder()

◆ CreateFinishedBuildRecorder() [2/2]

static std::unique_ptr< FrameTimingsRecorder > flutter::CreateFinishedBuildRecorder ( fml::TimePoint  timestamp)
static

Definition at line 137 of file rasterizer_unittests.cc.

138 {
139 std::unique_ptr<FrameTimingsRecorder> recorder =
140 std::make_unique<FrameTimingsRecorder>();
141 recorder->RecordVsync(timestamp, timestamp);
142 recorder->RecordBuildStart(timestamp);
143 recorder->RecordBuildEnd(timestamp);
144 return recorder;
145}

◆ CreateFlutterCallbackInformation()

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

Definition at line 69 of file platform_view_android_jni_impl.cc.

73 {
74 return env->NewObject(g_flutter_callback_info_class->obj(),
76 env->NewStringUTF(callbackName.c_str()),
77 env->NewStringUTF(callbackClassName.c_str()),
78 env->NewStringUTF(callbackLibraryPath.c_str()));
79}
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 234 of file service_protocol.cc.

234 {
235 std::stringstream stream;
236 stream << kViewIdPrefx << "0x" << std::hex << handler;
237 return stream.str();
238}
static constexpr std::string_view kViewIdPrefx

◆ CreateGLInterface()

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

Definition at line 83 of file gpu_surface_gl_delegate.cc.

84 {
85 if (proc_resolver == nullptr) {
86#if defined(FML_OS_ANDROID)
88#elif defined(FML_OS_LINUX)
89#if defined(SK_GLX)
91#else
92 return nullptr;
93#endif // defined(SK_GLX)
94#elif defined(FML_OS_IOS)
96#elif defined(FML_OS_MACOSX)
98#else
99 // TODO(kjlubick) update this when Skia has a Windows target for making GL
100 // interfaces. For now, ask Skia to guess the native
101 // interface. This often leads to interesting results on most platforms.
103#endif
104 }
105
106 struct ProcResolverContext {
107 GPUSurfaceGLDelegate::GLProcResolver resolver;
108 };
109
110 ProcResolverContext context = {proc_resolver};
111
112 GrGLGetProc gl_get_proc = [](void* context,
113 const char gl_proc_name[]) -> GrGLFuncPtr {
114 auto proc_resolver_context =
115 reinterpret_cast<ProcResolverContext*>(context);
116 return reinterpret_cast<GrGLFuncPtr>(
117 proc_resolver_context->resolver(gl_proc_name));
118 };
119
120 // glGetString indicates an OpenGL ES interface.
121 if (IsProcResolverOpenGLES(proc_resolver)) {
122 return GrGLMakeAssembledGLESInterface(&context, gl_get_proc);
123 }
124
125 // Fallback to OpenGL.
126 if (auto interface = GrGLMakeAssembledGLInterface(&context, gl_get_proc)) {
127 return interface;
128 }
129
130 FML_LOG(ERROR) << "Could not create a valid GL interface.";
131 return nullptr;
132}
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc get)
GrGLFuncPtr(* GrGLGetProc)(void *ctx, const char name[])
SK_API sk_sp< const GrGLInterface > GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc get)
SK_API sk_sp< const GrGLInterface > GrGLMakeNativeInterface()
void(* GrGLFuncPtr)()
Definition: GrGLInterface.h:17
SK_API sk_sp< const GrGLInterface > MakeEGL()
SK_API sk_sp< const GrGLInterface > MakeIOS()
SK_API sk_sp< const GrGLInterface > MakeMac()
SK_API sk_sp< const GrGLInterface > MakeGLX()
static bool IsProcResolverOpenGLES(const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)

◆ CreateImpellerContext() [1/2]

static std::shared_ptr< impeller::Context > flutter::CreateImpellerContext ( const fml::RefPtr< fml::NativeLibrary > &  vulkan_dylib,
bool  enable_vulkan_validation,
bool  enable_gpu_tracing,
bool  quiet 
)
static

Definition at line 19 of file android_context_vulkan_impeller.cc.

23 {
24 if (!vulkan_dylib) {
25 VALIDATION_LOG << "Could not open the Vulkan dylib.";
26 return nullptr;
27 }
28
29 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
30 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
31 impeller_entity_shaders_vk_length),
32 std::make_shared<fml::NonOwnedMapping>(
33 impeller_framebuffer_blend_shaders_vk_data,
34 impeller_framebuffer_blend_shaders_vk_length),
35#if IMPELLER_ENABLE_3D
36 std::make_shared<fml::NonOwnedMapping>(impeller_scene_shaders_vk_data,
37 impeller_scene_shaders_vk_length),
38#endif
39 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
40 impeller_modern_shaders_vk_length),
41 };
42
43 auto instance_proc_addr =
45 "vkGetInstanceProcAddr");
46
47 if (!instance_proc_addr.has_value()) {
48 VALIDATION_LOG << "Could not setup Vulkan proc table.";
49 return nullptr;
50 }
51
53 settings.proc_address_callback = instance_proc_addr.value();
54 settings.shader_libraries_data = std::move(shader_mappings);
55 settings.cache_directory = fml::paths::GetCachesDirectory();
56 settings.enable_validation = enable_vulkan_validation;
57 settings.enable_gpu_tracing = enable_gpu_tracing;
58
59 auto context = impeller::ContextVK::Create(std::move(settings));
60
61 if (!quiet) {
62 if (context && impeller::CapabilitiesVK::Cast(*context->GetCapabilities())
64 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (Vulkan with "
65 "Validation Layers).";
66 } else {
67 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (Vulkan).";
68 }
69 }
70
71 return context;
72}
const std::optional< T > ResolveFunction(const char *symbol)
static CapabilitiesVK & Cast(Capabilities &base)
Definition: backend_cast.h:13
bool AreValidationsEnabled() const
static std::shared_ptr< ContextVK > Create(Settings settings)
Definition: context_vk.cc:100
fml::UniqueFD GetCachesDirectory()
#define VALIDATION_LOG
Definition: validation.h:73
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)
Definition: vulkan_core.h:3989

◆ CreateImpellerContext() [2/2]

static std::shared_ptr< impeller::Context > flutter::CreateImpellerContext ( const std::shared_ptr< impeller::ReactorGLES::Worker > &  worker,
bool  enable_gpu_tracing 
)
static

Definition at line 52 of file android_context_gl_impeller.cc.

54 {
55 auto proc_table = std::make_unique<impeller::ProcTableGLES>(
57
58 if (!proc_table->IsValid()) {
59 FML_LOG(ERROR) << "Could not create OpenGL proc table.";
60 return nullptr;
61 }
62
63 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
64 std::make_shared<fml::NonOwnedMapping>(
65 impeller_entity_shaders_gles_data,
66 impeller_entity_shaders_gles_length),
67 std::make_shared<fml::NonOwnedMapping>(
68 impeller_framebuffer_blend_shaders_gles_data,
69 impeller_framebuffer_blend_shaders_gles_length),
70#if IMPELLER_ENABLE_3D
71 std::make_shared<fml::NonOwnedMapping>(
72 impeller_scene_shaders_gles_data, impeller_scene_shaders_gles_length),
73#endif // IMPELLER_ENABLE_3D
74 };
75
76 auto context = impeller::ContextGLES::Create(
77 std::move(proc_table), shader_mappings, enable_gpu_tracing);
78 if (!context) {
79 FML_LOG(ERROR) << "Could not create OpenGLES Impeller Context.";
80 return nullptr;
81 }
82
83 if (!context->AddReactorWorker(worker).has_value()) {
84 FML_LOG(ERROR) << "Could not add reactor worker.";
85 return nullptr;
86 }
87 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (OpenGLES).";
88 return context;
89}
static std::shared_ptr< ContextGLES > Create(std::unique_ptr< ProcTableGLES > gl, const std::vector< std::shared_ptr< fml::Mapping > > &shader_libraries, bool enable_gpu_tracing)
Definition: context_gles.cc:16
std::function< void *(const char *)> CreateProcAddressResolver()
Creates a proc address resolver that resolves function pointers to EGL and OpenGL (ES) procs.
Definition: egl.cc:12

◆ CreateImpellerRenderer()

static std::shared_ptr< impeller::Renderer > flutter::CreateImpellerRenderer ( std::shared_ptr< impeller::Context context)
static

Definition at line 24 of file gpu_surface_metal_impeller.mm.

25 {
26 auto renderer = std::make_shared<impeller::Renderer>(std::move(context));
27 if (!renderer->IsValid()) {
28 FML_LOG(ERROR) << "Could not create valid Impeller Renderer.";
29 return nullptr;
30 }
31 return renderer;
32}

◆ CreateIsolateID()

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

Definition at line 240 of file service_protocol.cc.

240 {
241 std::stringstream stream;
242 stream << "isolates/" << isolate;
243 return stream.str();
244}

◆ CreatePath()

API SkPath * flutter::CreatePath ( SkPathFillType  fill_type)

Definition at line 8 of file path_ops.cc.

8 {
9 auto* path = new SkPath();
10 path->setFillType(fill_type);
11 return path;
12}

◆ CreateSnapshotSurface()

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

Definition at line 20 of file offscreen_surface.cc.

21 {
22 const auto image_info = SkImageInfo::MakeN32Premul(
23 size.width(), size.height(), SkColorSpace::MakeSRGB());
24 if (surface_context) {
25 // There is a rendering surface that may contain textures that are going to
26 // be referenced in the layer tree about to be drawn.
27 return SkSurfaces::RenderTarget(surface_context, skgpu::Budgeted::kNo,
28 image_info);
29 }
30
31 // There is no rendering surface, assume no GPU textures are present and
32 // create a raster surface.
33 return SkSurfaces::Raster(image_info);
34}
static sk_sp< SkColorSpace > MakeSRGB()

◆ CubicTo()

API void flutter::CubicTo ( SkPath path,
SkScalar  x1,
SkScalar  y1,
SkScalar  x2,
SkScalar  y2,
SkScalar  x3,
SkScalar  y3 
)

Definition at line 26 of file path_ops.cc.

32 {
33 path->cubicTo(x1, y1, x2, y2, x3, y3);
34}

◆ DartFileModifiedCallback()

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

Definition at line 130 of file dart_vm.cc.

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

◆ DartFileRecorderArgs()

static std::string flutter::DartFileRecorderArgs ( const std::string &  path)
static

Definition at line 102 of file dart_vm.cc.

102 {
103 std::ostringstream oss;
104 oss << "--timeline_recorder=perfettofile:" << path;
105 return oss.str();
106}

◆ DartOldGenHeapSizeArgs()

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

Definition at line 121 of file dart_vm.cc.

121 {
122 std::ostringstream oss;
123 oss << "--old_gen_heap_size=" << heap_size;
124 return oss.str();
125}

◆ DartPluginRegistrant_EnsureInitialized()

void flutter::DartPluginRegistrant_EnsureInitialized ( )

Definition at line 269 of file dart_runtime_hooks.cc.

◆ DartTimelineTicksSinceEpoch()

fml::TimePoint flutter::DartTimelineTicksSinceEpoch ( )

Definition at line 34 of file dart_timestamp_provider.cc.

34 {
35 return DartTimestampProvider::Instance().Now();
36}

◆ Data()

API struct PathData * flutter::Data ( SkPath path)

Definition at line 52 of file path_ops.cc.

52 {
53 int point_count = path->countPoints();
54 int verb_count = path->countVerbs();
55
56 auto data = new PathData();
57 data->points = new float[point_count * 2];
58 data->point_count = point_count * 2;
59 data->verbs = new uint8_t[verb_count];
60 data->verb_count = verb_count;
61
62 path->getVerbs(data->verbs, verb_count);
63 path->getPoints(reinterpret_cast<SkPoint*>(data->points), point_count);
64 return data;
65}

◆ decodeFontFeatures()

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

Definition at line 334 of file paragraph_builder.cc.

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

◆ decodeFontVariations()

void flutter::decodeFontVariations ( Dart_Handle  font_variations_data,
txt::FontVariations font_variations 
)

Definition at line 352 of file paragraph_builder.cc.

353 { // NOLINT
354 tonic::DartByteData byte_data(font_variations_data);
355 FML_CHECK(byte_data.length_in_bytes() % kBytesPerFontVariation == 0);
356
357 size_t variation_count = byte_data.length_in_bytes() / kBytesPerFontVariation;
358 for (size_t variation_index = 0; variation_index < variation_count;
359 ++variation_index) {
360 size_t variation_offset = variation_index * kBytesPerFontVariation;
361 const char* variation_bytes =
362 static_cast<const char*>(byte_data.data()) + variation_offset;
363 std::string tag(variation_bytes, kFontVariationTagLength);
364 float value = *(reinterpret_cast<const float*>(variation_bytes +
365 kFontVariationTagLength));
366 font_variations.SetAxisValue(tag, value);
367 }
368}
void SetAxisValue(std::string tag, float value)

◆ decodeStrut()

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

Definition at line 166 of file paragraph_builder.cc.

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

◆ decodeTextShadows()

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

Definition at line 309 of file paragraph_builder.cc.

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

◆ DEF_SWITCH() [1/27]

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

◆ DEF_SWITCH() [2/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead flutter::DEF_SWITCH ( CacheSkSL  ,
"cache-sksl"  ,
"Only cache the shader in SkSL instead of binary or GLSL. This " "should only be used during development phases. The generated SkSLs " "can later be used in the release build for shader precompilation " "at launch in order to eliminate the shader-compile jank."   
)

◆ DEF_SWITCH() [3/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data flutter::DEF_SWITCH ( DartFlags  ,
"dart-flags ,
"Flags passed directly to the Dart VM without being interpreted " "by the Flutter shell."   
)

◆ DEF_SWITCH() [4/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified flutter::DEF_SWITCH ( DeviceObservatoryHost  ,
"observatory-host ,
"(deprecated) The hostname/IP address on which the Dart VM Service should " "be served. If not  set,
defaults to 127.0.0.1 or ::1 depending on " "whether --ipv6 is specified."   
)

◆ DEF_SWITCH() [5/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port flutter::DEF_SWITCH ( DeviceObservatoryPort  ,
"observatory-port ,
"(deprecated) A custom Dart VM Service port. The default is to pick " "a randomly " "available open port."   
)

◆ DEF_SWITCH() [6/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed flutter::DEF_SWITCH ( DisableDartAsserts  ,
"disable-dart-asserts"  ,
"Dart code runs with assertions enabled when the runtime mode is " "debug. In profile and release product  modes,
assertions are " "disabled. This flag may be specified if the user wishes to run " "with assertions disabled in the debug product mode(i.e. with JIT " "or DBC)."   
)

◆ DEF_SWITCH() [7/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode flutter::DEF_SWITCH ( DisableObservatory  ,
"disable-observatory"  ,
"(deprecated) Disable the Dart VM Service. The Dart VM Service is " "never available " "in release mode."   
)

◆ DEF_SWITCH() [8/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication flutter::DEF_SWITCH ( DisableObservatoryPublication  ,
"disable-observatory-publication ,
"(deprecated) Disable mDNS Dart VM Service publication."   
)

◆ DEF_SWITCH() [9/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory flutter::DEF_SWITCH ( DisableServiceAuthCodes  ,
"disable-service-auth-codes"  ,
"Disable the requirement for authentication codes for communicating" " with the VM service."   
)

◆ DEF_SWITCH() [10/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities flutter::DEF_SWITCH ( DisallowInsecureConnections  ,
"disallow-insecure-connections"  ,
"By  default,
dart:io allows all socket connections. If this switch " "is  set,
all insecure connections are rejected."   
)

◆ DEF_SWITCH() [11/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set flutter::DEF_SWITCH ( EnableDartProfiling  ,
"enable-dart-profiling"  ,
"Enable Dart profiling. Profiling information can be viewed from " "Dart / Flutter DevTools."   
)

◆ DEF_SWITCH() [12/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan this flag does nothing flutter::DEF_SWITCH ( EnableOpenGLGPUTracing  ,
"enable-opengl-gpu-tracing ,
"Enable tracing of GPU execution time when using the Impeller " "OpenGLES backend."   
)

◆ DEF_SWITCH() [13/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however flutter::DEF_SWITCH ( EnableSoftwareRendering  ,
"enable-software-rendering"  ,
"Enable rendering using the Skia software backend. This is useful " "when testing Flutter on emulators. By  default,
Flutter will " "attempt to either use  OpenGL,
Metal  ,
or Vulkan."   
)

◆ DEF_SWITCH() [14/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level flutter::DEF_SWITCH ( ForceMultithreading  ,
"force-multithreading"  ,
"Uses separate threads for the  platform,
UI  ,
GPU and IO task runners. " "By  default,
a single thread is used for all task runners. Only available " "in the flutter_tester."   
)

◆ DEF_SWITCH() [15/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache flutter::DEF_SWITCH ( ICUSymbolPrefix  ,
"icu-symbol-prefix"  ,
"Prefix for the symbols representing ICU data linked into the " "Flutter library."   
)

◆ DEF_SWITCH() [16/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform flutter::DEF_SWITCH ( ImpellerBackend  ,
"impeller-backend ,
"Requests a particular Impeller backend on platforms that support " "multiple backends. (ex `opengles` or `vulkan`)"   
)

◆ DEF_SWITCH() [17/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present flutter::DEF_SWITCH ( IsolateSnapshotInstructions  ,
"isolate-snapshot-instr"  ,
"The isolate instructions snapshot that will be memory mapped as " "read and executable. SnapshotAssetPath must be present."   
)

◆ DEF_SWITCH() [18/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space flutter::DEF_SWITCH ( ResourceCacheMaxBytesThreshold  ,
"resource-cache-max-bytes-threshold"  ,
"The max bytes threshold of resource  cache,
or 0 for unlimited."   
)

◆ DEF_SWITCH() [19/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter::DEF_SWITCH ( SkiaDeterministicRendering  ,
"skia-deterministic-rendering"  ,
"Skips the call to   SkGraphics::Init(),
thus avoiding swapping out " "some Skia function pointers based on available CPU features. This " "is used to obtain 100% deterministic behavior in Skia rendering."   
)

◆ DEF_SWITCH() [20/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate flutter::DEF_SWITCH ( SnapshotAssetPath  ,
"snapshot-asset-path ,
"Path to the directory containing the four files specified by " "  VmSnapshotData,
VmSnapshotInstructions  ,
" "VmSnapshotInstructions and IsolateSnapshotInstructions."   
)

◆ DEF_SWITCH() [21/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails flutter::DEF_SWITCH ( StartPaused  ,
"start-paused"  ,
"Start the application paused in the Dart debugger."   
)

◆ DEF_SWITCH() [22/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list flutter::DEF_SWITCH ( TraceAllowlist  ,
"trace-allowlist ,
"Filters out all trace events except those that are specified in this " "comma separated list of allowed prefixes."   
)

◆ DEF_SWITCH() [23/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer flutter::DEF_SWITCH ( TraceSkia  ,
"trace-skia"  ,
"Trace Skia calls. This is useful when debugging the GPU threed." "By  default,
Skia tracing is not enabled to reduce the number of " "traced events"   
)

◆ DEF_SWITCH() [24/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank flutter::DEF_SWITCH ( TraceSystrace  ,
"trace-systrace"  ,
"Trace to the system tracer (instead of the timeline) on platforms where " "such a tracer is available. Currently only supported on Android and " "Fuchsia."   
)

◆ DEF_SWITCH() [25/27]

it will be possible to load the file into Perfetto s trace viewer flutter::DEF_SWITCH ( UseTestFonts  ,
"use-test-fonts ,
"Running tests that layout and measure text will not yield " "consistent results across various platforms. Enabling this option " "will make font resolution default to the Ahem test font on all " "platforms (See https://www.w3.org/Style/CSS/Test/Fonts/Ahem/). " "This option is only available on the desktop test shells."   
)

◆ DEF_SWITCH() [26/27]

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine flutter::DEF_SWITCH ( VerboseLogging  ,
"verbose-logging"  ,
"By  default,
only errors are logged. This flag enabled logging at " "all severity levels. This is NOT a per shell flag and affect log " "levels for all shells in the process."   
)

◆ DEF_SWITCH() [27/27]

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present flutter::DEF_SWITCH ( VmSnapshotInstructions  ,
"vm-snapshot-instr"  ,
"The VM instructions snapshot that will be memory mapped as read " "and executable. SnapshotAssetPath must be present."   
)

◆ DefaultCameraTransform()

static impeller::Matrix flutter::DefaultCameraTransform ( )
static

Definition at line 62 of file scene_shader.cc.

62 {
63 // TODO(bdero): There's no way to know what the draw area will be yet, so
64 // make the DlSceneColorSource camera transform optional and
65 // defer this default (or parameterize the camera instead).
67 impeller::Degrees(45), impeller::ISize{800, 600}, 0.1f, 1000) *
68 impeller::Matrix::MakeLookAt({0, 0, -5}, {0, 0, 0}, {0, 1, 0});
69}
static constexpr Matrix MakePerspective(Radians fov_y, Scalar aspect_ratio, Scalar z_near, Scalar z_far)
Definition: matrix.h:506
static constexpr Matrix MakeLookAt(Vector3 position, Vector3 target, Vector3 up)
Definition: matrix.h:532

◆ DeferredComponentInstallFailure()

static void flutter::DeferredComponentInstallFailure ( JNIEnv *  env,
jobject  obj,
jint  jLoadingUnitId,
jstring  jError,
jboolean  jTransient 
)
static

Definition at line 594 of file platform_view_android_jni_impl.cc.

598 {
599 LoadLoadingUnitFailure(static_cast<intptr_t>(jLoadingUnitId),
601 static_cast<bool>(jTransient));
602}
static void LoadLoadingUnitFailure(intptr_t loading_unit_id, const std::string &message, bool transient)
std::string JavaStringToString(JNIEnv *env, jstring str)
Definition: jni_util.cc:70

◆ DEFINE_DRAW_POINTS_OP() [1/3]

flutter::DEFINE_DRAW_POINTS_OP ( Lines  ,
kLines   
)

◆ DEFINE_DRAW_POINTS_OP() [2/3]

flutter::DEFINE_DRAW_POINTS_OP ( Points  ,
kPoints   
)

◆ DEFINE_DRAW_POINTS_OP() [3/3]

flutter::DEFINE_DRAW_POINTS_OP ( Polygon  ,
kPolygon   
)

◆ DeserializeImageWithoutData()

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

Definition at line 56 of file serialization_callbacks.cc.

58 {
59 FML_CHECK(length >= sizeof(ImageMetaData));
60 auto metadata = static_cast<const ImageMetaData*>(data);
61 sk_sp<SkColorSpace> color_space = nullptr;
62 if (metadata->has_color_space) {
63 color_space = SkColorSpace::Deserialize(
64 static_cast<const uint8_t*>(data) + sizeof(ImageMetaData),
65 length - sizeof(ImageMetaData));
66 }
67
68 auto image_size = SkISize::Make(metadata->width, metadata->height);
70 image_size, static_cast<SkColorType>(metadata->color_type),
71 static_cast<SkAlphaType>(metadata->alpha_type), color_space);
72 sk_sp<SkData> image_data =
73 SkData::MakeUninitialized(image_size.width() * image_size.height() * 4);
74 memset(image_data->writable_data(), 0x0f, image_data->size());
76 SkImages::RasterFromData(info, image_data, image_size.width() * 4);
77
78 return image;
79};
SkAlphaType
Definition: SkAlphaType.h:26
SkColorType
Definition: SkColorType.h:19
static sk_sp< SkColorSpace > Deserialize(const void *data, size_t length)
static sk_sp< SkData > MakeUninitialized(size_t length)
Definition: SkData.cpp:116
void * writable_data()
Definition: SkData.h:52
size_t size() const
Definition: SkData.h:30
SK_API sk_sp< SkImage > RasterFromData(const SkImageInfo &info, sk_sp< SkData > pixels, size_t rowBytes)

◆ DeserializeTypefaceWithoutData()

sk_sp< SkTypeface > flutter::DeserializeTypefaceWithoutData ( const void *  data,
size_t  length,
void *  ctx 
)

Definition at line 22 of file serialization_callbacks.cc.

24 {
25 return nullptr;
26}

◆ DestroyData()

API void flutter::DestroyData ( PathData data)

Definition at line 67 of file path_ops.cc.

67 {
68 delete[] data->points;
69 delete[] data->verbs;
70 delete data;
71}

◆ DestroyJNI()

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

Definition at line 171 of file platform_view_android_jni_impl.cc.

171 {
173}
#define ANDROID_SHELL_HOLDER

◆ DestroyPath()

API void flutter::DestroyPath ( SkPath path)

Definition at line 14 of file path_ops.cc.

14 {
15 delete path;
16}

◆ DestroyPathBuilder()

API void flutter::DestroyPathBuilder ( SkPath path)

◆ DetermineRuntimeStageBackend()

static impeller::RuntimeStageBackend flutter::DetermineRuntimeStageBackend ( const std::shared_ptr< impeller::Context > &  impeller_context)
static

◆ DispatchEmptyPlatformMessage()

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

Definition at line 423 of file platform_view_android_jni_impl.cc.

427 {
428 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage(
429 env, //
431 responseId //
432 );
433}

◆ DispatchPlatformMessage()

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

Definition at line 407 of file platform_view_android_jni_impl.cc.

413 {
414 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage(
415 env, //
417 message, //
418 position, //
419 responseId //
420 );
421}

◆ DispatchPointerDataPacket()

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

Definition at line 442 of file platform_view_android_jni_impl.cc.

446 {
447 uint8_t* data = static_cast<uint8_t*>(env->GetDirectBufferAddress(buffer));
448 auto packet = std::make_unique<flutter::PointerDataPacket>(data, position);
449 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPointerDataPacket(
450 std::move(packet));
451}

◆ 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 453 of file platform_view_android_jni_impl.cc.

459 {
460 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction(
461 env, //
462 id, //
463 action, //
464 args, //
465 args_position //
466 );
467}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ DisplayListBuilderBenchmarkAccessor()

DlOpReceiver & flutter::DisplayListBuilderBenchmarkAccessor ( DisplayListBuilder builder)

Definition at line 10 of file dl_builder_benchmarks.cc.

10 {
11 return builder.asReceiver();
12}

◆ DisplayListBuilderTestingAccessor()

DlOpReceiver & flutter::DisplayListBuilderTestingAccessor ( DisplayListBuilder builder)

Definition at line 33 of file display_list_unittests.cc.

33 {
34 return builder.asReceiver();
35}

◆ DisplayListBuilderTestingAttributes()

DlPaint flutter::DisplayListBuilderTestingAttributes ( DisplayListBuilder builder)

Definition at line 37 of file display_list_unittests.cc.

37 {
38 return builder.CurrentAttributes();
39}

◆ DisplayListBuilderTestingLastOpIndex()

int flutter::DisplayListBuilderTestingLastOpIndex ( DisplayListBuilder builder)

Definition at line 41 of file display_list_unittests.cc.

41 {
42 return builder.LastOpIndex();
43}

◆ DlGradientDeleter()

static void flutter::DlGradientDeleter ( void *  p)
static

Definition at line 13 of file dl_color_source.cc.

13 {
14 // Some of our target environments would prefer a sized delete,
15 // but other target environments do not have that operator.
16 // Use an unsized delete until we get better agreement in the
17 // environments.
18 // See https://github.com/flutter/flutter/issues/100327
19 ::operator delete(p);
20}

◆ DlVerticesDeleter()

static void flutter::DlVerticesDeleter ( void *  p)
static

Definition at line 14 of file dl_vertices.cc.

14 {
15 // Some of our target environments would prefer a sized delete,
16 // but other target environments do not have that operator.
17 // Use an unsized delete until we get better agreement in the
18 // environments.
19 // See https://github.com/flutter/flutter/issues/100327
20 ::operator delete(p);
21}

◆ DrawCheckerboard()

void flutter::DrawCheckerboard ( DlCanvas canvas,
const SkRect rect 
)

Definition at line 32 of file paint_utils.cc.

32 {
33 // Draw a checkerboard
34 canvas->Save();
35 canvas->ClipRect(rect, DlCanvas::ClipOp::kIntersect, false);
36
37 // Secure random number generation isn't needed here.
38 // NOLINTBEGIN(clang-analyzer-security.insecureAPI.rand)
39 auto checkerboard_color =
40 SkColorSetARGB(64, rand() % 256, rand() % 256, rand() % 256);
41 // NOLINTEND(clang-analyzer-security.insecureAPI.rand)
42
44 paint.setColorSource(
45 CreateCheckerboardShader(checkerboard_color, 0x00000000, 12));
46 canvas->DrawPaint(paint);
47 canvas->Restore();
48
49 // Stroke the drawn area
50 DlPaint debug_paint;
51 debug_paint.setStrokeWidth(8);
52 debug_paint.setColor(DlColor(SkColorSetA(checkerboard_color, 255)));
53 debug_paint.setDrawStyle(DlDrawStyle::kStroke);
54 canvas->DrawRect(rect, debug_paint);
55}
static constexpr SkColor SkColorSetA(SkColor c, U8CPU a)
Definition: SkColor.h:82
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColor.h:49
virtual void DrawPaint(const DlPaint &paint)=0
virtual void DrawRect(const SkRect &rect, const DlPaint &paint)=0
virtual void ClipRect(const SkRect &rect, ClipOp clip_op=ClipOp::kIntersect, bool is_aa=false)=0
virtual void Restore()=0
virtual void Save()=0
DlPaint & setColor(DlColor color)
Definition: dl_paint.h:70
DlPaint & setStrokeWidth(float width)
Definition: dl_paint.h:116
DlPaint & setDrawStyle(DlDrawStyle style)
Definition: dl_paint.h:94
const Paint & paint
Definition: color_source.cc:38

◆ elementSizeForFlutterStandardDataType()

UInt8 flutter::elementSizeForFlutterStandardDataType ( FlutterStandardDataType  type)

Definition at line 45 of file FlutterStandardCodec_Internal.h.

45 {
46 switch (type) {
47 case FlutterStandardDataTypeUInt8:
48 return 1;
49 case FlutterStandardDataTypeInt32:
50 return 4;
51 case FlutterStandardDataTypeInt64:
52 return 8;
53 case FlutterStandardDataTypeFloat32:
54 return 4;
55 case FlutterStandardDataTypeFloat64:
56 return 8;
57 }
58}

◆ EmbedderInformationCallback()

static void flutter::EmbedderInformationCallback ( Dart_EmbedderInformation info)
static

Definition at line 253 of file dart_vm.cc.

253 {
256 info->name = "Flutter";
257}
#define DART_EMBEDDER_INFORMATION_CURRENT_VERSION
void GetIOEmbedderInformation(Dart_EmbedderInformation *info)

◆ 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.

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() [1/2]

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

Definition at line 165 of file image_encoding.cc.

167 {
168 if (!canvas_image) {
169 return ToDart("encode called with non-genuine Image.");
170 }
171
172 if (!Dart_IsClosure(callback_handle)) {
173 return ToDart("Callback must be a function.");
174 }
175
176 ImageByteFormat image_format = static_cast<ImageByteFormat>(format);
177
178 auto callback = std::make_unique<DartPersistentValue>(
179 tonic::DartState::Current(), callback_handle);
180
181 const auto& task_runners = UIDartState::Current()->GetTaskRunners();
182
183 // The static leak checker gets confused by the use of fml::MakeCopyable.
184 // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
185 task_runners.GetIOTaskRunner()->PostTask(fml::MakeCopyable(
186 [callback = std::move(callback), image = canvas_image->image(),
187 image_format, ui_task_runner = task_runners.GetUITaskRunner(),
188 raster_task_runner = task_runners.GetRasterTaskRunner(),
189 io_task_runner = task_runners.GetIOTaskRunner(),
190 io_manager = UIDartState::Current()->GetIOManager(),
191 snapshot_delegate = UIDartState::Current()->GetSnapshotDelegate(),
192 is_impeller_enabled =
193 UIDartState::Current()->IsImpellerEnabled()]() mutable {
194 EncodeImageAndInvokeDataCallback(
195 image, std::move(callback), image_format, ui_task_runner,
196 raster_task_runner, io_task_runner,
197 io_manager->GetResourceContext(), snapshot_delegate,
198 io_manager->GetIsGpuDisabledSyncSwitch(),
199 io_manager->GetImpellerContext(), is_impeller_enabled);
200 }));
201
202 return Dart_Null();
203}
sk_sp< DlImage > image() const
Definition: image.h:42
static DartState * Current()
Definition: dart_state.cc:56
DART_EXPORT bool Dart_IsClosure(Dart_Handle object)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
uint32_t uint32_t * format
internal::CopyableLambda< T > MakeCopyable(T lambda)
Definition: make_copyable.h:57
Dart_Handle ToDart(const T &object)

◆ EncodeImage() [2/2]

fml::StatusOr< sk_sp< SkData > > flutter::EncodeImage ( const sk_sp< SkImage > &  raster_image,
ImageByteFormat  format 
)

Definition at line 205 of file image_encoding.cc.

206 {
207 TRACE_EVENT0("flutter", __FUNCTION__);
208
209 if (!raster_image) {
210 return fml::Status(fml::StatusCode::kInternal, "Missing raster image.");
211 }
212
213 switch (format) {
214 case kPNG: {
215 auto png_image = SkPngEncoder::Encode(nullptr, raster_image.get(), {});
216
217 if (png_image == nullptr) {
219 "Could not convert raster image to PNG.");
220 };
221 return png_image;
222 }
223 case kRawRGBA:
224 return CopyImageByteData(raster_image, kRGBA_8888_SkColorType,
226
227 case kRawStraightRGBA:
228 return CopyImageByteData(raster_image, kRGBA_8888_SkColorType,
230
231 case kRawUnmodified:
232 return CopyImageByteData(raster_image, raster_image->colorType(),
233 raster_image->alphaType());
235 return CopyImageByteData(raster_image, kRGBA_F32_SkColorType,
237 }
238
240 "Unknown error encoding image.");
241}
kUnpremul_SkAlphaType
SkAlphaType alphaType() const
Definition: SkImage.cpp:154
SkColorType colorType() const
Definition: SkImage.cpp:152
T * get() const
Definition: SkRefCnt.h:303
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
Task::Status Status
Definition: TaskList.cpp:15
#define TRACE_EVENT0(category_group, name)
Definition: trace_event.h:131

◆ EncodeTextBoxes()

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

Definition at line 77 of file paragraph.cc.

78 {
79 // Layout:
80 // First value is the number of values.
81 // Then there are boxes.size() groups of 5 which are LTRBD, where D is the
82 // text direction index.
83 tonic::Float32List result(
85 uint64_t position = 0;
86 for (uint64_t i = 0; i < boxes.size(); i++) {
87 const txt::Paragraph::TextBox& box = boxes[i];
88 result[position++] = box.rect.fLeft;
89 result[position++] = box.rect.fTop;
90 result[position++] = box.rect.fRight;
91 result[position++] = box.rect.fBottom;
92 result[position++] = static_cast<float>(box.direction);
93 }
94 return result;
95}
@ Dart_TypedData_kFloat32
Definition: dart_api.h:2623
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
SkScalar fBottom
larger y-axis bounds
Definition: extension.cpp:17
SkScalar fLeft
smaller x-axis bounds
Definition: extension.cpp:14
SkScalar fRight
larger x-axis bounds
Definition: extension.cpp:16
SkScalar fTop
smaller y-axis bounds
Definition: extension.cpp:15
TextDirection direction
Definition: paragraph.h:85

◆ EncodeUtf16()

std::u16string flutter::EncodeUtf16 ( char32_t  character)

Definition at line 11 of file keyboard_utils.cc.

11 {
12 // Algorithm: https://en.wikipedia.org/wiki/UTF-16#Description
13 std::u16string result;
14 // Invalid value.
15 FML_DCHECK(!(character >= 0xD800 && character <= 0xDFFF) &&
16 !(character > 0x10FFFF));
17 if ((character >= 0xD800 && character <= 0xDFFF) || (character > 0x10FFFF)) {
18 return result;
19 }
20 if (character <= 0xD7FF || (character >= 0xE000 && character <= 0xFFFF)) {
21 result.push_back((char16_t)character);
22 return result;
23 }
24 uint32_t remnant = character - 0x10000;
25 result.push_back((remnant >> 10) + 0xD800);
26 result.push_back((remnant & 0x3FF) + 0xDC00);
27 return result;
28}

◆ Equals() [1/4]

template<class T >
bool flutter::Equals ( const T a,
const T b 
)

Definition at line 19 of file dl_comparable.h.

19 {
20 if (a == b) {
21 return true;
22 }
23 if (!a || !b) {
24 return false;
25 }
26 return *a == *b;
27}

◆ Equals() [2/4]

template<class T >
bool flutter::Equals ( const T a,
std::shared_ptr< const T b 
)

Definition at line 40 of file dl_comparable.h.

40 {
41 return Equals(a, b.get());
42}
bool Equals(std::shared_ptr< const T > a, std::shared_ptr< const T > b)
Definition: dl_comparable.h:50

◆ Equals() [3/4]

template<class T >
bool flutter::Equals ( std::shared_ptr< const T a,
const T b 
)

Definition at line 30 of file dl_comparable.h.

30 {
31 return Equals(a.get(), b);
32}

◆ Equals() [4/4]

template<class T >
bool flutter::Equals ( std::shared_ptr< const T a,
std::shared_ptr< const T b 
)

Definition at line 50 of file dl_comparable.h.

50 {
51 return Equals(a.get(), b.get());
52}

◆ FindAndInvokeDartPluginRegistrant()

bool flutter::FindAndInvokeDartPluginRegistrant ( )
Returns
true when the registrant has been invoked.

Definition at line 42 of file dart_plugin_registrant.cc.

42 {
43 std::string library_name =
45 ? "package:flutter/src/dart_plugin_registrant.dart"
47 Dart_Handle library = Dart_LookupLibrary(tonic::ToDart(library_name));
48 if (Dart_IsError(library)) {
49 return false;
50 }
51 Dart_Handle registrant_file_uri =
52 Dart_GetField(library, tonic::ToDart("dartPluginRegistrantLibrary"));
53 if (Dart_IsError(registrant_file_uri)) {
54 // TODO(gaaclarke): Find a way to remove this branch so the field is
55 // required. I couldn't get it working with unit tests.
57 }
58
59 std::string registrant_file_uri_string =
61 if (registrant_file_uri_string.empty()) {
62 return false;
63 }
64
65 Dart_Handle registrant_library = Dart_LookupLibrary(registrant_file_uri);
66 return InvokeDartPluginRegistrantIfAvailable(registrant_library);
67}
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
const char * dart_plugin_registrant_library_override
bool InvokeDartPluginRegistrantIfAvailable(Dart_Handle library_handle)

◆ FirstSupportedColorType()

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

Definition at line 121 of file gpu_surface_gl_skia.cc.

122 {
123#define RETURN_IF_RENDERABLE(x, y) \
124 if (context->colorTypeSupportedAsSurface((x))) { \
125 *format = (y); \
126 return (x); \
127 }
132}
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
Definition: SkColorType.h:23
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
Definition: SkColorType.h:22
@ kUnknown_SkColorType
uninitialized
Definition: SkColorType.h:20
#define GPU_GL_RGBA4
#define GPU_GL_RGB565
#define GPU_GL_RGBA8
#define RETURN_IF_RENDERABLE(x, y)

◆ FlagForSwitch()

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

Definition at line 144 of file switches.cc.

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

◆ FlutterStandardDataTypeForField()

FlutterStandardDataType flutter::FlutterStandardDataTypeForField ( FlutterStandardField  field)

Definition at line 27 of file FlutterStandardCodec_Internal.h.

28 {
29 switch (field) {
31 return FlutterStandardDataTypeUInt8;
33 return FlutterStandardDataTypeInt32;
35 return FlutterStandardDataTypeInt64;
37 return FlutterStandardDataTypeFloat32;
39 return FlutterStandardDataTypeFloat64;
40 default:
41 return FlutterStandardDataTypeUInt8;
42 }
43}
@ FlutterStandardFieldUInt8Data
@ FlutterStandardFieldFloat32Data
@ FlutterStandardFieldInt64Data
@ FlutterStandardFieldInt32Data
@ FlutterStandardFieldFloat64Data

◆ FlutterStandardFieldForDataType()

FlutterStandardField flutter::FlutterStandardFieldForDataType ( FlutterStandardDataType  type)

Definition at line 12 of file FlutterStandardCodec_Internal.h.

13 {
14 switch (type) {
15 case FlutterStandardDataTypeUInt8:
17 case FlutterStandardDataTypeInt32:
19 case FlutterStandardDataTypeInt64:
21 case FlutterStandardDataTypeFloat32:
23 case FlutterStandardDataTypeFloat64:
25 }
26}

◆ FlutterTextUtilsIsEmoji()

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

Definition at line 558 of file platform_view_android_jni_impl.cc.

560 {
561 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
562}

◆ FlutterTextUtilsIsEmojiModifier()

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

Definition at line 564 of file platform_view_android_jni_impl.cc.

566 {
567 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
568}

◆ FlutterTextUtilsIsEmojiModifierBase()

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

Definition at line 570 of file platform_view_android_jni_impl.cc.

572 {
573 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
574}

◆ FlutterTextUtilsIsRegionalIndicator()

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

Definition at line 582 of file platform_view_android_jni_impl.cc.

584 {
585 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
586}

◆ FlutterTextUtilsIsVariationSelector()

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

Definition at line 576 of file platform_view_android_jni_impl.cc.

578 {
579 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
580}

◆ ForceShutdownIsolate()

EXPORTED void flutter::ForceShutdownIsolate ( )

Definition at line 604 of file tester_main.cc.

604 {
605 // Enable Isolate.exit().
606 FML_DCHECK(Dart_CurrentIsolate() != nullptr);
607 Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate"));
610 isolate_lib, tonic::ToDart("Isolate"), 0, nullptr);
613 Dart_SetField(isolate_type, tonic::ToDart("_mayExit"), Dart_True());
615}
DART_EXPORT Dart_Handle Dart_GetNonNullableType(Dart_Handle library, Dart_Handle class_name, intptr_t number_of_type_arguments, Dart_Handle *type_arguments)
DART_EXPORT Dart_Handle Dart_True(void)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value)
DART_EXPORT Dart_Isolate Dart_CurrentIsolate(void)
bool CheckAndHandleError(Dart_Handle handle)
Definition: dart_error.cc:33

◆ GetBitmap()

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

Definition at line 373 of file platform_view_android_jni_impl.cc.

373 {
374 auto screenshot = ANDROID_SHELL_HOLDER->Screenshot(
375 Rasterizer::ScreenshotType::UncompressedImage, false);
376 if (screenshot.data == nullptr) {
377 return nullptr;
378 }
379
380 jstring argb = env->NewStringUTF("ARGB_8888");
381 if (argb == nullptr) {
382 return nullptr;
383 }
384
385 jobject bitmap_config = env->CallStaticObjectMethod(
387 if (bitmap_config == nullptr) {
388 return nullptr;
389 }
390
391 auto bitmap = env->CallStaticObjectMethod(
393 screenshot.frame_size.width(), screenshot.frame_size.height(),
394 bitmap_config);
395
397 env,
398 env->NewDirectByteBuffer(const_cast<uint8_t*>(screenshot.data->bytes()),
399 screenshot.data->size()));
400
402 buffer.obj());
403
404 return bitmap;
405}
Definition: bitmap.py:1
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_class
static jmethodID g_bitmap_copy_pixels_from_buffer_method
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_config_class
static jmethodID g_bitmap_config_value_of
static jmethodID g_bitmap_create_bitmap_method

◆ GetCATransform3DFromSkMatrix()

CATransform3D flutter::GetCATransform3DFromSkMatrix ( const SkMatrix matrix)

Definition at line 43 of file FlutterPlatformViews_Internal.mm.

43 {
44 // Skia only supports 2D transform so we don't map z.
45 CATransform3D transform = CATransform3DIdentity;
46 transform.m11 = matrix.getScaleX();
47 transform.m21 = matrix.getSkewX();
48 transform.m41 = matrix.getTranslateX();
49 transform.m14 = matrix.getPerspX();
50
51 transform.m12 = matrix.getSkewY();
52 transform.m22 = matrix.getScaleY();
53 transform.m42 = matrix.getTranslateY();
54 transform.m24 = matrix.getPerspY();
55 return transform;
56}

◆ GetCGRectFromSkRect()

CGRect flutter::GetCGRectFromSkRect ( const SkRect clipSkRect)

Definition at line 64 of file FlutterPlatformViews_Internal.mm.

64 {
65 return CGRectMake(clipSkRect.fLeft, clipSkRect.fTop, clipSkRect.fRight - clipSkRect.fLeft,
66 clipSkRect.fBottom - clipSkRect.fTop);
67}

◆ GetColorSpace()

SkColorSpace * flutter::GetColorSpace ( DlCanvas canvas)
inline

Definition at line 25 of file layer_tree.cc.

25 {
26 return canvas ? canvas->GetImageInfo().colorSpace() : nullptr;
27}
virtual SkImageInfo GetImageInfo() const =0
SkColorSpace * colorSpace() const

◆ GetCoreAnimationLayerClassForRenderingAPI()

Class flutter::GetCoreAnimationLayerClassForRenderingAPI ( IOSRenderingAPI  rendering_api)

Definition at line 59 of file rendering_api_selection.mm.

59 {
60 switch (rendering_api) {
62 return [CALayer class];
64 if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
65 if ([FlutterMetalLayer enabled]) {
66 return [FlutterMetalLayer class];
67 } else {
68 return [CAMetalLayer class];
69 }
70 }
71 FML_CHECK(false) << "Metal availability should already have been checked";
72 break;
73 default:
74 break;
75 }
76 FML_CHECK(false) << "Unknown client rendering API";
77 return [CALayer class];
78}
#define METAL_IOS_VERSION_BASELINE

◆ GetCurrentThreadTaskRunner()

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

Definition at line 108 of file embedder_thread_host.cc.

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

◆ GetCursorFromBuffer()

HCURSOR flutter::GetCursorFromBuffer ( const std::vector< uint8_t > &  buffer,
double  hot_x,
double  hot_y,
int  width,
int  height 
)

Definition at line 205 of file cursor_handler.cc.

209 {
210 HCURSOR cursor = nullptr;
211 HDC display_dc = GetDC(NULL);
212 // Flutter should returns rawBGRA, which has 8bits * 4channels.
213 BITMAPINFO bmi;
214 memset(&bmi, 0, sizeof(bmi));
215 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
216 bmi.bmiHeader.biWidth = width;
217 bmi.bmiHeader.biHeight = -height;
218 bmi.bmiHeader.biPlanes = 1;
219 bmi.bmiHeader.biBitCount = 32;
220 bmi.bmiHeader.biCompression = BI_RGB;
221 bmi.bmiHeader.biSizeImage = width * height * 4;
222 // Create the pixmap DIB section
223 uint8_t* pixels = 0;
224 HBITMAP bitmap =
225 CreateDIBSection(display_dc, &bmi, DIB_RGB_COLORS, (void**)&pixels, 0, 0);
226 ReleaseDC(0, display_dc);
227 if (!bitmap || !pixels) {
228 return nullptr;
229 }
230 int bytes_per_line = width * 4;
231 for (int y = 0; y < height; ++y) {
232 memcpy(pixels + y * bytes_per_line, &buffer[bytes_per_line * y],
233 bytes_per_line);
234 }
235 HBITMAP mask;
236 GetMaskBitmaps(bitmap, mask);
237 ICONINFO icon_info;
238 icon_info.fIcon = 0;
239 icon_info.xHotspot = hot_x;
240 icon_info.yHotspot = hot_y;
241 icon_info.hbmMask = mask;
242 icon_info.hbmColor = bitmap;
243 cursor = CreateIconIndirect(&icon_info);
244 DeleteObject(mask);
245 DeleteObject(bitmap);
246 return cursor;
247}
double y
void GetMaskBitmaps(HBITMAP bitmap, HBITMAP &mask_bitmap)

◆ GetDartVersion()

const char * flutter::GetDartVersion ( )

Definition at line 19 of file version.cc.

19 {
20 return DART_VERSION;
21}

◆ GetDefaultPlatformData()

static PlatformData flutter::GetDefaultPlatformData ( )
static

Definition at line 79 of file android_shell_holder.cc.

79 {
80 PlatformData platform_data;
81 platform_data.lifecycle_state = "AppLifecycleState.detached";
82 return platform_data;
83}
std::string lifecycle_state
Definition: platform_data.h:44

◆ 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 130 of file dpi_utils.cc.

130 {
131 return GetHelper()->GetDpiForWindow(hwnd);
132}

◆ 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 134 of file dpi_utils.cc.

134 {
135 return GetHelper()->GetDpiForMonitor(monitor);
136}

◆ GetExecutableDirectory()

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

Definition at line 16 of file path_utils.cc.

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}
#define PATH_MAX
Definition: globals.h:708
#define MAX_PATH

◆ 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.

34 {
35 if (executable) {
37 } else {
39 }
40}
static std::unique_ptr< FileMapping > CreateReadExecute(const std::string &path)
Definition: mapping.cc:44
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
Definition: mapping.cc:20

◆ GetFillType()

API int flutter::GetFillType ( SkPath path)

Definition at line 48 of file path_ops.cc.

48 {
49 return static_cast<int>(path->getFillType());
50}

◆ GetFlutterEngineVersion()

const char * flutter::GetFlutterEngineVersion ( )

Definition at line 11 of file version.cc.

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

◆ GetFontFile()

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

Definition at line 20 of file flow_test_utils.cc.

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

◆ GetFunctionClassName()

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

Definition at line 196 of file dart_runtime_hooks.cc.

196 {
198
199 if (Dart_IsClosure(closure)) {
202 }
203
204 if (!Dart_IsFunction(closure)) {
205 return "";
206 }
207
208 bool is_static = false;
209 result = Dart_FunctionIsStatic(closure, &is_static);
211 if (!is_static) {
212 return "";
213 }
214
217
219 return "";
220 }
222}
DART_EXPORT Dart_Handle Dart_FunctionIsStatic(Dart_Handle function, bool *is_static)
DART_EXPORT Dart_Handle Dart_FunctionOwner(Dart_Handle function)
DART_EXPORT bool Dart_IsInstance(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_ClassName(Dart_Handle cls_type)
DART_EXPORT bool Dart_IsFunction(Dart_Handle handle)
DART_EXPORT Dart_Handle Dart_ClosureFunction(Dart_Handle closure)
DART_EXPORT bool Dart_IsLibrary(Dart_Handle object)
static void PropagateIfError(Dart_Handle result)

◆ GetFunctionLibraryUrl()

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

Definition at line 174 of file dart_runtime_hooks.cc.

174 {
175 if (Dart_IsClosure(closure)) {
178 }
179
180 if (!Dart_IsFunction(closure)) {
181 return "";
182 }
183
184 Dart_Handle url = Dart_Null();
186 if (Dart_IsInstance(owner)) {
187 owner = Dart_ClassLibrary(owner);
188 }
189 if (Dart_IsLibrary(owner)) {
190 url = Dart_LibraryUrl(owner);
191 PropagateIfError(url);
192 }
194}
DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library)
DART_EXPORT Dart_Handle Dart_ClassLibrary(Dart_Handle cls_type)

◆ GetFunctionName()

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

Definition at line 224 of file dart_runtime_hooks.cc.

224 {
225 if (Dart_IsClosure(func)) {
226 func = Dart_ClosureFunction(func);
227 PropagateIfError(func);
228 }
229
230 if (!Dart_IsFunction(func)) {
231 return "";
232 }
233
234 bool is_static = false;
235 Dart_Handle result = Dart_FunctionIsStatic(func, &is_static);
237 if (!is_static) {
238 return "";
239 }
240
243
245}
DART_EXPORT Dart_Handle Dart_FunctionName(Dart_Handle function)

◆ GetGoldenDir()

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

Definition at line 12 of file flow_test_utils.cc.

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

◆ getInfoIncludingExif()

static SkImageInfo flutter::getInfoIncludingExif ( SkCodec codec)
static

Definition at line 86 of file image_generator.cc.

86 {
87 SkImageInfo info = codec->getInfo();
90 }
91 if (kUnpremul_SkAlphaType == info.alphaType()) {
92 // Prefer premul over unpremul (this produces better filtering in general)
93 info = info.makeAlphaType(kPremul_SkAlphaType);
94 }
95 return info;
96}
static bool SkEncodedOriginSwapsWidthHeight(SkEncodedOrigin origin)
SkEncodedOrigin getOrigin() const
Definition: SkCodec.h:246
SkImageInfo getInfo() const
Definition: SkCodec.h:228
SK_API SkImageInfo SwapWidthHeight(const SkImageInfo &info)

◆ GetIsSoftwareRendering()

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

Definition at line 483 of file platform_view_android_jni_impl.cc.

483 {
484 return FlutterMain::Get().GetSettings().enable_software_rendering;
485}

◆ GetMaskBitmaps()

void flutter::GetMaskBitmaps ( HBITMAP  bitmap,
HBITMAP &  mask_bitmap 
)

Definition at line 249 of file cursor_handler.cc.

249 {
250 HDC h_dc = ::GetDC(NULL);
251 HDC h_main_dc = ::CreateCompatibleDC(h_dc);
252 HDC h_and_mask_dc = ::CreateCompatibleDC(h_dc);
253
254 // Get the dimensions of the source bitmap
255 BITMAP bm;
256 ::GetObject(bitmap, sizeof(BITMAP), &bm);
257 mask_bitmap = ::CreateCompatibleBitmap(h_dc, bm.bmWidth, bm.bmHeight);
258
259 // Select the bitmaps to DC
260 HBITMAP h_old_main_bitmap = (HBITMAP)::SelectObject(h_main_dc, bitmap);
261 HBITMAP h_old_and_mask_bitmap =
262 (HBITMAP)::SelectObject(h_and_mask_dc, mask_bitmap);
263
264 // Scan each pixel of the souce bitmap and create the masks
265 COLORREF main_bit_pixel;
266 for (int x = 0; x < bm.bmWidth; ++x) {
267 for (int y = 0; y < bm.bmHeight; ++y) {
268 main_bit_pixel = ::GetPixel(h_main_dc, x, y);
269 if (main_bit_pixel == RGB(0, 0, 0)) {
270 ::SetPixel(h_and_mask_dc, x, y, RGB(255, 255, 255));
271 } else {
272 ::SetPixel(h_and_mask_dc, x, y, RGB(0, 0, 0));
273 }
274 }
275 }
276 ::SelectObject(h_main_dc, h_old_main_bitmap);
277 ::SelectObject(h_and_mask_dc, h_old_and_mask_bitmap);
278
279 ::DeleteDC(h_and_mask_dc);
280 ::DeleteDC(h_main_dc);
281
282 ::ReleaseDC(NULL, h_dc);
283}
double x
static void GetObject(Thread *thread, JSONStream *js)
Definition: service.cc:5046

◆ GetNextPipelineTraceID()

size_t flutter::GetNextPipelineTraceID ( )

Definition at line 9 of file pipeline.cc.

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

◆ GetPreferredLanguageInfo() [1/2]

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

Definition at line 114 of file system_utils.cc.

114 {
115 const char* locale_string;
116 locale_string = GetLocaleStringFromEnvironment();
117 if (!locale_string || locale_string[0] == '\0') {
118 // This is the default locale if none is specified according to ISO C.
119 locale_string = "C";
120 }
121 std::istringstream locales_stream(locale_string);
122 std::vector<LanguageInfo> languages;
123 std::string s;
124 while (getline(locales_stream, s, ':')) {
125 LanguageInfo info = ParseLocale(s);
126 AppendLocaleVariants(languages, info);
127 }
128 return languages;
129}
struct MyStruct s

◆ GetPreferredLanguageInfo() [2/2]

std::vector< LanguageInfo > flutter::GetPreferredLanguageInfo ( const WindowsProcTable windows_proc_table)

Definition at line 15 of file system_utils.cc.

16 {
17 std::vector<std::wstring> languages =
18 GetPreferredLanguages(windows_proc_table);
19 std::vector<LanguageInfo> language_info;
20 language_info.reserve(languages.size());
21
22 for (auto language : languages) {
23 language_info.push_back(ParseLanguageName(language));
24 }
25 return language_info;
26}
std::vector< std::wstring > GetPreferredLanguages(const WindowsProcTable &windows_proc_table)
Definition: system_utils.cc:45
LanguageInfo ParseLanguageName(std::wstring language_name)
Definition: system_utils.cc:71

◆ GetPreferredLanguages()

std::vector< std::wstring > flutter::GetPreferredLanguages ( const WindowsProcTable windows_proc_table)

Definition at line 45 of file system_utils.cc.

46 {
47 std::vector<std::wstring> languages;
48
49 // Initialize the buffer
50 std::wstring buffer = GetPreferredLanguagesFromMUI(windows_proc_table);
51
52 // Extract the individual languages from the buffer.
53 size_t start = 0;
54 while (true) {
55 // The buffer is terminated by an empty string (i.e., a double null).
56 if (buffer[start] == L'\0') {
57 break;
58 }
59 // Read the next null-terminated language.
60 std::wstring language(buffer.c_str() + start);
61 if (language.empty()) {
62 break;
63 }
64 languages.push_back(language);
65 // Skip past that language and its terminating null in the buffer.
66 start += language.size() + 1;
67 }
68 return languages;
69}
std::wstring GetPreferredLanguagesFromMUI(const WindowsProcTable &windows_proc_table)
Definition: system_utils.cc:28

◆ GetPreferredLanguagesFromMUI()

std::wstring flutter::GetPreferredLanguagesFromMUI ( const WindowsProcTable windows_proc_table)

Definition at line 28 of file system_utils.cc.

29 {
31 ULONG count = 0;
32 DWORD flags = MUI_LANGUAGE_NAME | MUI_UI_FALLBACK;
33 if (!windows_proc_table.GetThreadPreferredUILanguages(flags, &count, nullptr,
34 &buffer_size)) {
35 return std::wstring();
36 }
37 std::wstring buffer(buffer_size, '\0');
38 if (!windows_proc_table.GetThreadPreferredUILanguages(
39 flags, &count, buffer.data(), &buffer_size)) {
40 return std::wstring();
41 }
42 return buffer;
43}
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
virtual LRESULT GetThreadPreferredUILanguages(DWORD flags, PULONG count, PZZWSTR languages, PULONG length) const
DWORD ULONG
Definition: windows_types.h:40
unsigned long DWORD
Definition: windows_types.h:22

◆ GetRasterData()

static sk_sp< SkData > flutter::GetRasterData ( const sk_sp< SkSurface > &  offscreen_surface,
bool  compressed 
)
static

Returns a buffer containing a snapshot of the surface.

If compressed is true the data is encoded as PNG.

Definition at line 39 of file offscreen_surface.cc.

40 {
41 // Prepare an image from the surface, this image may potentially be on th GPU.
42 auto potentially_gpu_snapshot = offscreen_surface->makeImageSnapshot();
43 if (!potentially_gpu_snapshot) {
44 FML_LOG(ERROR) << "Screenshot: unable to make image screenshot";
45 return nullptr;
46 }
47
48 // Copy the GPU image snapshot into CPU memory.
49 // TODO (https://github.com/flutter/flutter/issues/13498)
50 auto cpu_snapshot = potentially_gpu_snapshot->makeRasterImage();
51 if (!cpu_snapshot) {
52 FML_LOG(ERROR) << "Screenshot: unable to make raster image";
53 return nullptr;
54 }
55
56 // If the caller want the pixels to be compressed, there is a Skia utility to
57 // compress to PNG. Use that.
58 if (compressed) {
59 return SkPngEncoder::Encode(nullptr, cpu_snapshot.get(), {});
60 }
61
62 // Copy it into a bitmap and return the same.
63 SkPixmap pixmap;
64 if (!cpu_snapshot->peekPixels(&pixmap)) {
65 FML_LOG(ERROR) << "Screenshot: unable to obtain bitmap pixels";
66 return nullptr;
67 }
68 return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize());
69}
static sk_sp< SkData > MakeWithCopy(const void *data, size_t length)
Definition: SkData.cpp:111
const uint32_t * addr32() const
Definition: SkPixmap.h:352
size_t computeByteSize() const
Definition: SkPixmap.h:231
sk_sp< SkImage > makeImageSnapshot()
Definition: SkSurface.cpp:90

◆ GetRenderingAPIForProcess()

IOSRenderingAPI flutter::GetRenderingAPIForProcess ( bool  force_software)

Definition at line 31 of file rendering_api_selection.mm.

31 {
32#if TARGET_OS_SIMULATOR
33 if (force_software) {
35 }
36#else
37 if (force_software) {
38 FML_LOG(WARNING) << "The --enable-software-rendering is only supported on Simulator targets "
39 "and will be ignored.";
40 }
41#endif // TARGET_OS_SIMULATOR
42
43 static bool should_use_metal = ShouldUseMetalRenderer();
44 if (should_use_metal) {
46 }
47
48 // When Metal isn't available we use Skia software rendering since it performs
49 // a little better than emulated OpenGL. Also, omitting an OpenGL backend
50 // reduces binary footprint.
51#if TARGET_OS_SIMULATOR
53#else
54 FML_CHECK(false) << "Metal may only be unavailable on simulators";
56#endif // TARGET_OS_SIMULATOR
57}
bool ShouldUseMetalRenderer()

◆ GetSkiaVersion()

const char * flutter::GetSkiaVersion ( )

Definition at line 15 of file version.cc.

15 {
16 return SKIA_VERSION;
17}

◆ GetSwitchesFromEnvironment()

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

Definition at line 14 of file engine_switches.cc.

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 if (!switch_count_string) {
23 return switches;
24 }
25 int switch_count = std::min(kMaxSwitchCount, atoi(switch_count_string));
26 for (int i = 1; i <= switch_count; ++i) {
27 std::ostringstream switch_key;
28 switch_key << "FLUTTER_ENGINE_SWITCH_" << i;
29 const char* switch_value = std::getenv(switch_key.str().c_str());
30 if (switch_value) {
31 std::ostringstream switch_value_as_flag;
32 switch_value_as_flag << "--" << switch_value;
33 switches.push_back(switch_value_as_flag.str());
34 } else {
35 std::cerr << switch_count << " keys expected from " << switch_count_key
36 << ", but " << switch_key.str() << " is missing." << std::endl;
37 }
38 }
39#endif // !FLUTTER_RELEASE
40 return switches;
41}
static float min(float r, float g, float b)
Definition: hsl.cpp:48

◆ GetSwitchValue()

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

Definition at line 181 of file switches.cc.

183 {
184 std::string switch_string;
185
186 if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) {
187 return false;
188 }
189
190 std::stringstream stream(switch_string);
191 T value = 0;
192 if (stream >> value) {
193 *result = value;
194 return true;
195 }
196
197 return false;
198}
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:144
#define T
Definition: precompiler.cc:65

◆ GetSymbolMapping()

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

Definition at line 200 of file switches.cc.

202 {
203 const uint8_t* mapping = nullptr;
204 intptr_t size;
205
206 auto lookup_symbol = [&mapping, &size, symbol_prefix](
207 const fml::RefPtr<fml::NativeLibrary>& library) {
208 mapping = library->ResolveSymbol((symbol_prefix + "_start").c_str());
209 size = reinterpret_cast<intptr_t>(
210 library->ResolveSymbol((symbol_prefix + "_size").c_str()));
211 };
212
215 lookup_symbol(library);
216
217 if (!(mapping && size)) {
218 // Symbol lookup for the current process fails on some devices. As a
219 // fallback, try doing the lookup based on the path to the Flutter library.
220 library = fml::NativeLibrary::Create(native_lib_path.c_str());
221 lookup_symbol(library);
222 }
223
224 FML_CHECK(mapping && size) << "Unable to resolve symbols: " << symbol_prefix;
225 return std::make_unique<fml::NonOwnedMapping>(mapping, size);
226}
static fml::RefPtr< NativeLibrary > CreateForCurrentProcess()
static fml::RefPtr< NativeLibrary > Create(const char *path)

◆ GetTestFontData()

std::vector< sk_sp< SkTypeface > > flutter::GetTestFontData ( )

Definition at line 1625 of file test_font_data.cc.

1625 {
1626 std::vector<sk_sp<SkTypeface>> typefaces;
1627#if EMBED_TEST_FONT_DATA
1629 typefaces.push_back(font_mgr->makeFromStream(
1630 SkMemoryStream::MakeDirect(kFlutterTestFont, kFlutterTestFontLength)));
1631 typefaces.push_back(font_mgr->makeFromStream(
1632 SkMemoryStream::MakeDirect(kAhemFont, kAhemFontLength)));
1633 typefaces.push_back(font_mgr->makeFromStream(
1634 SkMemoryStream::MakeDirect(kCoughFont, kCoughFontLength)));
1635#endif // EMBED_TEST_FONT_DATA
1636 return typefaces;
1637}
sk_sp< SkTypeface > makeFromStream(std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
Definition: SkFontMgr.cpp:127
static std::unique_ptr< SkMemoryStream > MakeDirect(const void *data, size_t length)
Definition: SkStream.cpp:310
sk_sp< SkFontMgr > GetDefaultFontManager(uint32_t font_initialization_data)
Definition: platform.cc:17

◆ GetTestFontFamilyNames()

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

Definition at line 1639 of file test_font_data.cc.

1639 {
1640 std::vector<std::string> names;
1641#if EMBED_TEST_FONT_DATA
1642 names = {"FlutterTest", "Ahem", "Cough"};
1643#endif // EMBED_TEST_FONT_DATA
1644 return names;
1645}
static const char *const names[]
Definition: symbols.cc:24

◆ GetTracingResult()

TracingResult flutter::GetTracingResult ( )
inline

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.

Returns
The tracing result.

Definition at line 62 of file ptrace_check.h.

62 {
63#if TRACING_CHECKS_NECESSARY
64 return GetTracingResultImpl();
65#else // TRACING_CHECKS_NECESSARY
66 return TracingResult::kNotNecessary;
67#endif // TRACING_CHECKS_NECESSARY
68}

◆ GetUserTimeFormat()

std::wstring flutter::GetUserTimeFormat ( )

Definition at line 101 of file system_utils.cc.

101 {
102 // Rather than do the call-allocate-call-free dance, just use a sufficiently
103 // large buffer to handle any reasonable time format string.
104 const int kBufferSize = 100;
105 wchar_t buffer[kBufferSize];
106 if (::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_STIMEFORMAT, buffer,
107 kBufferSize) == 0) {
108 return std::wstring();
109 }
110 return std::wstring(buffer, kBufferSize);
111}
static const size_t kBufferSize
Definition: SkString.cpp:27

◆ GetVMServiceAssetsArchiveCallback()

Dart_Handle flutter::GetVMServiceAssetsArchiveCallback ( )

Definition at line 163 of file dart_vm.cc.

163 {
164#if FLUTTER_RELEASE
165 return nullptr;
166#elif OS_FUCHSIA
167 fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false,
170 if (mapping.GetSize() == 0 || mapping.GetMapping() == nullptr) {
171 FML_LOG(ERROR) << "Fail to load Observatory archive";
172 return nullptr;
173 }
174 return tonic::DartConverter<tonic::Uint8List>::ToDart(mapping.GetMapping(),
175 mapping.GetSize());
176#else
180#endif
181}
const uint8_t * observatory_assets_archive
unsigned int observatory_assets_archive_len
fml::UniqueFD OpenFile(const char *path, bool create_if_necessary, FilePermission permission)
This can open a directory on POSIX, but not on Windows.
Definition: file_posix.cc:66

◆ glyphInfoFrom()

Dart_Handle flutter::glyphInfoFrom ( Dart_Handle  constructor,
const skia::textlayout::Paragraph::GlyphInfo glyphInfo 
)

Definition at line 123 of file paragraph.cc.

125 {
126 std::array<Dart_Handle, 7> arguments = {
133 Dart_NewBoolean(glyphInfo.fDirection ==
135 };
136 return Dart_InvokeClosure(constructor, arguments.size(), arguments.data());
137}
DART_EXPORT Dart_Handle Dart_NewDouble(double value)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value)
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value)

◆ HandleMessageOnHandler()

static bool flutter::HandleMessageOnHandler ( ServiceProtocol::Handler handler,
std::string_view  method,
const ServiceProtocol::Handler::ServiceProtocolMap params,
rapidjson::Document *  document 
)
static

Definition at line 164 of file service_protocol.cc.

168 {
169 FML_DCHECK(handler);
171 bool result = false;
174 [&latch, //
175 &result, //
176 &handler, //
177 &method, //
178 &params, //
179 &document //
180 ]() {
181 result =
182 handler->HandleServiceProtocolMessage(method, params, document);
183 latch.Signal();
184 });
185 latch.Wait();
186 return result;
187}
virtual fml::RefPtr< fml::TaskRunner > GetServiceProtocolHandlerTaskRunner(std::string_view method) const =0
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
Definition: task_runner.cc:55
const EmbeddedViewParams * params

◆ ImageFromDecompressedData()

static sk_sp< SkImage > flutter::ImageFromDecompressedData ( ImageDescriptor descriptor,
uint32_t  target_width,
uint32_t  target_height,
const fml::tracing::TraceFlow flow 
)
static

Definition at line 78 of file image_decoder_skia.cc.

82 {
83 TRACE_EVENT0("flutter", __FUNCTION__);
84 flow.Step(__FUNCTION__);
86 descriptor->image_info(), descriptor->data(), descriptor->row_bytes());
87
88 if (!image) {
89 FML_LOG(ERROR) << "Could not create image from decompressed bytes.";
90 return nullptr;
91 }
92
93 if (!target_width && !target_height) {
94 // No resizing requested. Just rasterize the image.
95 return image->makeRasterImage();
96 }
97
98 return ResizeRasterImage(image, SkISize::Make(target_width, target_height),
99 flow);
100}
const SkImageInfo & image_info() const
The orientation corrected image info for this image.
int row_bytes() const
The byte length of the first row of the image. Defaults to width() * 4.
sk_sp< SkData > data() const
The underlying buffer for this image.
void Step(const char *label=nullptr) const
Definition: trace_event.h:484
static sk_sp< SkImage > ResizeRasterImage(const sk_sp< SkImage > &image, const SkISize &resized_dimensions, const fml::tracing::TraceFlow &flow)

◆ IMPLEMENT_WRAPPERTYPEINFO() [1/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( flutter_gpu  ,
FlutterGpuTestClass   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [2/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Canvas   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [3/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Codec   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [4/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ColorFilter   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [5/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
EngineLayer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [6/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
FragmentProgram   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [7/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Gradient   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [8/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageDescriptor   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [9/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageFilter   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [10/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageShader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [11/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImmutableBuffer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [12/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
NativeStringAttribute   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [13/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Paragraph   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [14/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ParagraphBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [15/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Path   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [16/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
PathMeasure   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [17/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Picture   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [18/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
PictureRecorder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [19/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ReusableFragmentShader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [20/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Scene   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [21/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SceneBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [22/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SceneNode   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [23/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SceneShader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [24/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SemanticsUpdate   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [25/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SemanticsUpdateBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [26/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Shader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [27/27]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Vertices   
)

◆ InitDartAsync()

static void flutter::InitDartAsync ( Dart_Handle  builtin_library,
bool  is_ui_isolate 
)
static

Definition at line 86 of file dart_runtime_hooks.cc.

86 {
87 Dart_Handle schedule_microtask;
88 if (is_ui_isolate) {
89 schedule_microtask =
90 InvokeFunction(builtin_library, "_getScheduleMicrotaskClosure");
91 } else {
92 Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
93 Dart_Handle method_name =
94 Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure");
95 schedule_microtask = Dart_Invoke(isolate_lib, method_name, 0, NULL);
96 }
97 Dart_Handle async_library = Dart_LookupLibrary(ToDart("dart:async"));
98 Dart_Handle set_schedule_microtask = ToDart("_setScheduleImmediateClosure");
99 Dart_Handle result = Dart_Invoke(async_library, set_schedule_microtask, 1,
100 &schedule_microtask);
102}
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
static Dart_Handle InvokeFunction(Dart_Handle builtin_library, const char *name)

◆ InitDartCore()

static void flutter::InitDartCore ( Dart_Handle  builtin,
const std::string &  script_uri 
)
static

Definition at line 76 of file dart_runtime_hooks.cc.

76 {
77 Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
78 Dart_Handle get_base_url =
79 Dart_Invoke(io_lib, ToDart("_getUriBaseClosure"), 0, NULL);
80 Dart_Handle core_library = Dart_LookupLibrary(ToDart("dart:core"));
82 Dart_SetField(core_library, ToDart("_uriBaseClosure"), get_base_url);
84}

◆ InitDartFFIForIsolateGroup()

static void flutter::InitDartFFIForIsolateGroup ( )
static

Definition at line 1178 of file dart_isolate.cc.

1178 {
1179 NativeAssetsApi native_assets;
1180 memset(&native_assets, 0, sizeof(native_assets));
1186 native_assets.dlsym = &dart::bin::NativeAssets::Dlsym;
1188};
static void * DlopenSystem(const char *path, char **error)
static void * DlopenExecutable(char **error)
static void * DlopenProcess(char **error)
static void * Dlsym(void *handle, const char *symbol, char **error)
static void * DlopenAbsolute(const char *path, char **error)
DART_EXPORT void Dart_InitializeNativeAssetsResolver(NativeAssetsApi *native_assets_api)
static void * NativeAssetsDlopenRelative(const char *path, char **error)
Dart_NativeAssetsDlopenCallback dlopen_system
Definition: dart_api.h:3394
Dart_NativeAssetsDlopenCallback dlopen_absolute
Definition: dart_api.h:3392
Dart_NativeAssetsDlopenCallbackNoPath dlopen_process
Definition: dart_api.h:3395
Dart_NativeAssetsDlopenCallback dlopen_relative
Definition: dart_api.h:3393
Dart_NativeAssetsDlsymCallback dlsym
Definition: dart_api.h:3397
Dart_NativeAssetsDlopenCallbackNoPath dlopen_executable
Definition: dart_api.h:3396

◆ InitDartInternal()

static void flutter::InitDartInternal ( Dart_Handle  builtin_library,
bool  is_ui_isolate 
)
static

Definition at line 49 of file dart_runtime_hooks.cc.

49 {
50 Dart_Handle print = InvokeFunction(builtin_library, "_getPrintClosure");
51
52 Dart_Handle internal_library = Dart_LookupLibrary(ToDart("dart:_internal"));
53
55 Dart_SetField(internal_library, ToDart("_printClosure"), print);
57
58 if (is_ui_isolate) {
59 // Call |_setupHooks| to configure |VMLibraryHooks|.
60 Dart_Handle method_name = Dart_NewStringFromCString("_setupHooks");
61 result = Dart_Invoke(builtin_library, method_name, 0, NULL);
63 }
64
65 Dart_Handle setup_hooks = Dart_NewStringFromCString("_setupHooks");
66
67 Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
68 result = Dart_Invoke(io_lib, setup_hooks, 0, NULL);
70
71 Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
72 result = Dart_Invoke(isolate_lib, setup_hooks, 0, NULL);
74}
def print(*args, **kwargs)
Definition: run_tests.py:49

◆ InitDartIO()

static void flutter::InitDartIO ( Dart_Handle  builtin_library,
const std::string &  script_uri 
)
static

Definition at line 104 of file dart_runtime_hooks.cc.

105 {
106 Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
107 Dart_Handle platform_type =
108 Dart_GetNonNullableType(io_lib, ToDart("_Platform"), 0, nullptr);
109 if (!script_uri.empty()) {
110 Dart_Handle result = Dart_SetField(platform_type, ToDart("_nativeScript"),
111 ToDart(script_uri));
113 }
114 // typedef _LocaleClosure = String Function();
115 Dart_Handle /* _LocaleClosure? */ locale_closure =
116 InvokeFunction(builtin_library, "_getLocaleClosure");
117 PropagateIfError(locale_closure);
118 // static String Function()? _localeClosure;
120 Dart_SetField(platform_type, ToDart("_localeClosure"), locale_closure);
122
123#if !FLUTTER_RELEASE
124 // Register dart:io service extensions used for network profiling.
125 Dart_Handle network_profiling_type =
126 Dart_GetNonNullableType(io_lib, ToDart("_NetworkProfiling"), 0, nullptr);
127 PropagateIfError(network_profiling_type);
128 result = Dart_Invoke(network_profiling_type,
129 ToDart("_registerServiceExtension"), 0, nullptr);
131#endif // !FLUTTER_RELEASE
132}

◆ InitSkiaEventTracer()

void flutter::InitSkiaEventTracer ( bool  enabled,
const std::optional< std::vector< std::string > > &  allowlist 
)

Definition at line 328 of file skia_event_tracer_impl.cc.

330 {
331 auto tracer = new FlutterEventTracer(enabled, allowlist);
332 // Initialize the binding to Skia's tracing events. Skia will
333 // take ownership of and clean up the memory allocated here.
335}
static bool SetInstance(SkEventTracer *, bool leakTracer=false)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia allowlist
Definition: switches.h:171

◆ InvokeDartPluginRegistrantIfAvailable()

bool flutter::InvokeDartPluginRegistrantIfAvailable ( Dart_Handle  library_handle)

Looks for the Dart Plugin Registrant in library_handle and invokes it if it is found.

Returns
true when the registrant has been invoked.

Definition at line 18 of file dart_plugin_registrant.cc.

18 {
19 TRACE_EVENT0("flutter", "InvokeDartPluginRegistrantIfAvailable");
20
21 // The Dart plugin registrant is a static method with signature `void
22 // register()` within the class `_PluginRegistrant` generated by the Flutter
23 // tool.
24 //
25 // This method binds a plugin implementation to their platform
26 // interface based on the configuration of the app's pubpec.yaml, and the
27 // plugin's pubspec.yaml.
28 //
29 // Since this method may or may not be defined, check if the class is defined
30 // in the default library before calling the method.
31 Dart_Handle plugin_registrant =
32 ::Dart_GetClass(library_handle, tonic::ToDart("_PluginRegistrant"));
33
34 if (Dart_IsError(plugin_registrant)) {
35 return false;
36 }
38 tonic::DartInvokeField(plugin_registrant, "register", {}));
39 return true;
40}
DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, Dart_Handle class_name)
Dart_Handle DartInvokeField(Dart_Handle target, const char *name, std::initializer_list< Dart_Handle > args)
Definition: dart_invoke.cc:12

◆ InvokeFunction()

static Dart_Handle flutter::InvokeFunction ( Dart_Handle  builtin_library,
const char *  name 
)
static

Definition at line 43 of file dart_runtime_hooks.cc.

44 {
45 Dart_Handle getter_name = ToDart(name);
46 return Dart_Invoke(builtin_library, getter_name, 0, nullptr);
47}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ InvokeMainEntrypoint()

static bool flutter::InvokeMainEntrypoint ( Dart_Handle  user_entrypoint_function,
Dart_Handle  args 
)
static

Definition at line 858 of file dart_isolate.cc.

860 {
861 if (tonic::CheckAndHandleError(user_entrypoint_function)) {
862 FML_LOG(ERROR) << "Could not resolve main entrypoint function.";
863 return false;
864 }
865
866 Dart_Handle start_main_isolate_function =
868 "_getStartMainIsolateFunction", {});
869
870 if (tonic::CheckAndHandleError(start_main_isolate_function)) {
871 FML_LOG(ERROR) << "Could not resolve main entrypoint trampoline.";
872 return false;
873 }
874
876 Dart_LookupLibrary(tonic::ToDart("dart:ui")), "_runMain",
877 {start_main_isolate_function, user_entrypoint_function, args}))) {
878 FML_LOG(ERROR) << "Could not invoke the main entrypoint.";
879 return false;
880 }
881
882 return true;
883}

◆ InvokeNextFrameCallback()

static void flutter::InvokeNextFrameCallback ( const fml::RefPtr< CanvasImage > &  image,
int  duration,
const std::string &  decode_error,
std::unique_ptr< tonic::DartPersistentValue callback,
size_t  trace_id 
)
static

Definition at line 38 of file multi_frame_codec.cc.

43 {
44 std::shared_ptr<tonic::DartState> dart_state = callback->dart_state().lock();
45 if (!dart_state) {
46 FML_DLOG(ERROR) << "Could not acquire Dart state while attempting to fire "
47 "next frame callback.";
48 return;
49 }
50 tonic::DartState::Scope scope(dart_state);
52 {tonic::ToDart(image), tonic::ToDart(duration),
53 tonic::ToDart(decode_error)});
54}
#define FML_DLOG(severity)
Definition: logging.h:102
Dart_Handle DartInvoke(Dart_Handle closure, std::initializer_list< Dart_Handle > args)
Definition: dart_invoke.cc:20

◆ InvokePlatformMessageEmptyResponseCallback()

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

Definition at line 544 of file platform_view_android_jni_impl.cc.

547 {
548 ANDROID_SHELL_HOLDER->GetPlatformMessageHandler()
549 ->InvokePlatformMessageEmptyResponseCallback(responseId);
550}

◆ InvokePlatformMessageResponseCallback()

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

Definition at line 529 of file platform_view_android_jni_impl.cc.

534 {
535 uint8_t* response_data =
536 static_cast<uint8_t*>(env->GetDirectBufferAddress(message));
537 FML_DCHECK(response_data != nullptr);
538 auto mapping = std::make_unique<fml::MallocMapping>(
539 fml::MallocMapping::Copy(response_data, response_data + position));
540 ANDROID_SHELL_HOLDER->GetPlatformMessageHandler()
541 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
542}

◆ is_power_of_two()

static constexpr bool flutter::is_power_of_two ( int  value)
inlinestaticconstexpr

Definition at line 38 of file dl_builder.cc.

38 {
39 return (value & (value - 1)) == 0;
40}

◆ IsAllowedDartVMFlag()

static bool flutter::IsAllowedDartVMFlag ( const std::string &  flag)
static

Definition at line 163 of file switches.cc.

163 {
164 for (uint32_t i = 0; i < fml::size(kAllowedDartFlags); ++i) {
165 const std::string& allowed = kAllowedDartFlags[i];
166 // Check that the prefix of the flag matches one of the allowed flags. This
167 // is to handle cases where flags take arguments, such as in
168 // "--max_profile_depth 1".
169 //
170 // We don't need to worry about cases like "--safe --sneaky_dangerous" as
171 // the VM will discard these as a single unrecognized flag.
172 if (flag.length() >= allowed.length() &&
173 std::equal(allowed.begin(), allowed.end(), flag.begin())) {
174 return true;
175 }
176 }
177 return false;
178}
FlutterSemanticsFlag flag
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
static const std::string kAllowedDartFlags[]
Definition: switches.cc:52

◆ IsDisplayListWorthRasterizing()

static bool flutter::IsDisplayListWorthRasterizing ( const DisplayList display_list,
bool  will_change,
bool  is_complex,
DisplayListComplexityCalculator complexity_calculator 
)
static

Definition at line 23 of file display_list_raster_cache_item.cc.

27 {
28 if (will_change) {
29 // If the display list is going to change in the future, there is no point
30 // in doing to extra work to rasterize.
31 return false;
32 }
33
34 if (display_list == nullptr ||
35 !RasterCacheUtil::CanRasterizeRect(display_list->bounds())) {
36 // No point in deciding whether the display list is worth rasterizing if it
37 // cannot be rasterized at all.
38 return false;
39 }
40
41 if (is_complex) {
42 // The caller seems to have extra information about the display list and
43 // thinks the display list is always worth rasterizing.
44 return true;
45 }
46
47 unsigned int complexity_score = complexity_calculator->Compute(display_list);
48 return complexity_calculator->ShouldBeCached(complexity_score);
49}
virtual bool ShouldBeCached(unsigned int complexity_score)=0
virtual unsigned int Compute(const DisplayList *display_list)=0
const SkRect & bounds() const
Definition: display_list.h:294

◆ isEasciiPrintable()

static bool flutter::isEasciiPrintable ( int  codeUnit)
static

Definition at line 71 of file keyboard_key_embedder_handler.cc.

71 {
72 return (codeUnit <= 0x7f && codeUnit >= 0x20) ||
73 (codeUnit <= 0xff && codeUnit >= 0x80);
74}

◆ IsEncodedVersionLessThanOrSame()

bool flutter::IsEncodedVersionLessThanOrSame ( uint32_t  encoded_lhs,
ProductVersion  rhs 
)

Definition at line 122 of file availability_version_check.cc.

122 {
123 // Parse the values out of encoded_lhs, then compare against rhs.
124 const int32_t major = (encoded_lhs >> 16) & 0xffff;
125 const int32_t minor = (encoded_lhs >> 8) & 0xff;
126 const int32_t subminor = encoded_lhs & 0xff;
127 auto lhs = ProductVersion{major, minor, subminor};
128
129 return lhs <= rhs;
130}
std::tuple< int32_t, int32_t, int32_t > ProductVersion

◆ IsIosEmbeddedViewsPreviewEnabled()

bool flutter::IsIosEmbeddedViewsPreviewEnabled ( )

◆ IsProcResolverOpenGLES()

static bool flutter::IsProcResolverOpenGLES ( const GPUSurfaceGLDelegate::GLProcResolver proc_resolver)
static

Definition at line 56 of file gpu_surface_gl_delegate.cc.

57 {
58 // Version string prefix that identifies an OpenGL ES implementation.
59#define GPU_GL_VERSION 0x1F02
60 constexpr char kGLESVersionPrefix[] = "OpenGL ES";
61
62#ifdef WIN32
63 using GLGetStringProc = const char*(__stdcall*)(uint32_t);
64#else
65 using GLGetStringProc = const char* (*)(uint32_t);
66#endif
67
68 GLGetStringProc gl_get_string =
69 reinterpret_cast<GLGetStringProc>(proc_resolver("glGetString"));
70
71 FML_CHECK(gl_get_string)
72 << "The GL proc resolver could not resolve glGetString";
73
74 const char* gl_version_string = gl_get_string(GPU_GL_VERSION);
75
76 FML_CHECK(gl_version_string)
77 << "The GL proc resolver's glGetString(GL_VERSION) failed";
78
79 return strncmp(gl_version_string, kGLESVersionPrefix,
80 strlen(kGLESVersionPrefix)) == 0;
81}
#define GPU_GL_VERSION

◆ kSkiaCleanupExpiration()

static constexpr std::chrono::milliseconds flutter::kSkiaCleanupExpiration ( 15000  )
staticconstexpr

◆ LineTo()

API void flutter::LineTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 22 of file path_ops.cc.

22 {
23 path->lineTo(x, y);
24}

◆ LoadDartDeferredLibrary()

static void flutter::LoadDartDeferredLibrary ( JNIEnv *  env,
jobject  obj,
jlong  shell_holder,
jint  jLoadingUnitId,
jobjectArray  jSearchPaths 
)
static

Definition at line 604 of file platform_view_android_jni_impl.cc.

608 {
609 // Convert java->c++
610 intptr_t loading_unit_id = static_cast<intptr_t>(jLoadingUnitId);
611 std::vector<std::string> search_paths =
612 fml::jni::StringArrayToVector(env, jSearchPaths);
613
614 // Use dlopen here to directly check if handle is nullptr before creating a
615 // NativeLibrary.
616 void* handle = nullptr;
617 while (handle == nullptr && !search_paths.empty()) {
618 std::string path = search_paths.back();
619 handle = ::dlopen(path.c_str(), RTLD_NOW);
620 search_paths.pop_back();
621 }
622 if (handle == nullptr) {
623 LoadLoadingUnitFailure(loading_unit_id,
624 "No lib .so found for provided search paths.", true);
625 return;
626 }
629
630 // Resolve symbols.
631 std::unique_ptr<const fml::SymbolMapping> data_mapping =
632 std::make_unique<const fml::SymbolMapping>(
633 native_lib, DartSnapshot::kIsolateDataSymbol);
634 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
635 std::make_unique<const fml::SymbolMapping>(
636 native_lib, DartSnapshot::kIsolateInstructionsSymbol);
637
638 ANDROID_SHELL_HOLDER->GetPlatformView()->LoadDartDeferredLibrary(
639 loading_unit_id, std::move(data_mapping),
640 std::move(instructions_mapping));
641}
static fml::RefPtr< NativeLibrary > CreateWithHandle(Handle handle, bool close_handle_when_done)
std::vector< std::string > StringArrayToVector(JNIEnv *env, jobjectArray array)
Definition: jni_util.cc:96

◆ LoadLibraryFromKernel()

EXPORTED Dart_Handle flutter::LoadLibraryFromKernel ( const char *  path)

Definition at line 524 of file tester_main.cc.

524 {
525 std::shared_ptr<fml::FileMapping> mapping =
527 if (!mapping) {
528 return Dart_Null();
529 }
531}
EXPORTED Dart_Handle LoadLibraryFromKernel(const char *path)
Definition: tester_main.cc:524

◆ LoadLoadingUnitFailure()

static void flutter::LoadLoadingUnitFailure ( intptr_t  loading_unit_id,
const std::string &  message,
bool  transient 
)
static

Definition at line 588 of file platform_view_android_jni_impl.cc.

590 {
591 // TODO(garyq): Implement
592}

◆ LogLastEGLError()

void flutter::LogLastEGLError ( )

Definition at line 17 of file android_egl_surface.cc.

17 {
18 struct EGLNameErrorPair {
19 const char* name;
20 EGLint code;
21 };
22
23#define _EGL_ERROR_DESC(a) \
24 { #a, a }
25
26 const EGLNameErrorPair pairs[] = {
27 _EGL_ERROR_DESC(EGL_SUCCESS),
28 _EGL_ERROR_DESC(EGL_NOT_INITIALIZED),
29 _EGL_ERROR_DESC(EGL_BAD_ACCESS),
30 _EGL_ERROR_DESC(EGL_BAD_ALLOC),
31 _EGL_ERROR_DESC(EGL_BAD_ATTRIBUTE),
32 _EGL_ERROR_DESC(EGL_BAD_CONTEXT),
33 _EGL_ERROR_DESC(EGL_BAD_CONFIG),
34 _EGL_ERROR_DESC(EGL_BAD_CURRENT_SURFACE),
35 _EGL_ERROR_DESC(EGL_BAD_DISPLAY),
36 _EGL_ERROR_DESC(EGL_BAD_SURFACE),
37 _EGL_ERROR_DESC(EGL_BAD_MATCH),
38 _EGL_ERROR_DESC(EGL_BAD_PARAMETER),
39 _EGL_ERROR_DESC(EGL_BAD_NATIVE_PIXMAP),
40 _EGL_ERROR_DESC(EGL_BAD_NATIVE_WINDOW),
41 _EGL_ERROR_DESC(EGL_CONTEXT_LOST),
42 };
43
44#undef _EGL_ERROR_DESC
45
46 const auto count = sizeof(pairs) / sizeof(EGLNameErrorPair);
47
48 EGLint last_error = eglGetError();
49
50 for (size_t i = 0; i < count; i++) {
51 if (last_error == pairs[i].code) {
52 FML_LOG(ERROR) << "EGL Error: " << pairs[i].name << " (" << pairs[i].code
53 << ")";
54 return;
55 }
56 }
57
58 FML_LOG(ERROR) << "Unknown EGL Error";
59}
#define _EGL_ERROR_DESC(a)

◆ LookupCallbackInformation()

static jobject flutter::LookupCallbackInformation ( JNIEnv *  env,
jobject  ,
jlong  handle 
)
static

Definition at line 289 of file platform_view_android_jni_impl.cc.

291 {
293 if (cbInfo == nullptr) {
294 return nullptr;
295 }
296 return CreateFlutterCallbackInformation(env, cbInfo->name, cbInfo->class_name,
297 cbInfo->library_path);
298}
static std::unique_ptr< DartCallbackRepresentation > GetCallbackInformation(int64_t handle)
jobject CreateFlutterCallbackInformation(JNIEnv *env, const std::string &callbackName, const std::string &callbackClassName, const std::string &callbackLibraryPath)

◆ LookupEntryPoint()

EXPORTED Dart_Handle flutter::LookupEntryPoint ( const char *  uri,
const char *  name 
)

Definition at line 533 of file tester_main.cc.

533 {
534 if (!uri || !name) {
535 return Dart_Null();
536 }
538 if (Dart_IsError(lib)) {
539 return lib;
540 }
542}

◆ MakeBackingStoreConfig()

static FlutterBackingStoreConfig flutter::MakeBackingStoreConfig ( int64_t  view_id,
const SkISize backing_store_size 
)
static

Definition at line 120 of file embedder_external_view_embedder.cc.

122 {
123 FlutterBackingStoreConfig config = {};
124
125 config.struct_size = sizeof(config);
126
127 config.size.width = backing_store_size.width();
128 config.size.height = backing_store_size.height();
129 config.view_id = view_id;
130
131 return config;
132}
FlutterViewId view_id
Definition: embedder.h:1787
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
Definition: embedder.h:1782
FlutterSize size
The size of the render target the engine expects to render into.
Definition: embedder.h:1784
double height
Definition: embedder.h:425
double width
Definition: embedder.h:424
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ MakeDefaultContextOptions()

GrContextOptions flutter::MakeDefaultContextOptions ( ContextType  type,
std::optional< GrBackendApi api = std::nullopt 
)

Initializes GrContextOptions with values suitable for Flutter. The options can be further tweaked before a GrContext is created from these options.

Parameters
[in]typeThe type of context that will be created using these options.
[in]typeThe client rendering API that will be wrapped using a context with these options. This argument is only required if the context is going to be used with a particular client rendering API.
Returns
The default graphics context options.

Definition at line 13 of file context_options.cc.

14 {
16
17 if (PersistentCache::cache_sksl()) {
19 }
20 PersistentCache::MarkStrategySet();
21 options.fPersistentCache = PersistentCache::GetCacheForProcess();
22
23 if (api.has_value() && api.value() == GrBackendApi::kOpenGL) {
24 // Using stencil buffers has caused memory and performance regressions.
25 // See b/226484927 for internal customer regressions doc.
26 // Before enabling, we need to show a motivating case for where it will
27 // improve performance on OpenGL backend.
28 options.fAvoidStencilBuffers = true;
29
30 // To get video playback on the widest range of devices, we limit Skia to
31 // ES2 shading language when the ES3 external image extension is missing.
32 options.fPreferExternalImagesOverES3 = true;
33 }
34
35 // TODO(goderbauer): remove option when skbug.com/7523 is fixed.
36 options.fDisableGpuYUVConversion = true;
37
38 options.fReduceOpsTaskSplitting = GrContextOptions::Enable::kNo;
39
40 options.fReducedShaderVariations = false;
41
42 return options;
43};
const char * options

◆ MakeThreadConfig()

fml::Thread::ThreadConfig flutter::MakeThreadConfig ( flutter::ThreadHost::Type  type,
fml::Thread::ThreadPriority  priority 
)

Definition at line 115 of file embedder_thread_host.cc.

117 {
121 priority);
122}
constexpr const char * kFlutterThreadName
fml::Thread::ThreadConfig ThreadConfig
Definition: thread_host.h:17
static std::string MakeThreadName(Type type, const std::string &prefix)
Use the prefix and thread type to generator a thread name.
Definition: thread_host.cc:15

◆ MarkTextureFrameAvailable()

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

Definition at line 517 of file platform_view_android_jni_impl.cc.

520 {
521 ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable(
522 static_cast<int64_t>(texture_id));
523}
int64_t texture_id

◆ MoveTo()

API void flutter::MoveTo ( SkPath path,
SkScalar  x,
SkScalar  y 
)

Definition at line 18 of file path_ops.cc.

18 {
19 path->moveTo(x, y);
20}

◆ NativeActivityMain()

std::unique_ptr< NativeActivity > flutter::NativeActivityMain ( ANativeActivity *  activity,
std::unique_ptr< fml::Mapping saved_state 
)

Definition at line 43 of file gtest_activity.cc.

45 {
46 return std::make_unique<GTestActivity>(activity);
47}

◆ NativeAssetsDlopenRelative()

static void * flutter::NativeAssetsDlopenRelative ( const char *  path,
char **  error 
)
static

Definition at line 1169 of file dart_isolate.cc.

1169 {
1170 auto* isolate_group_data =
1171 static_cast<std::shared_ptr<DartIsolateGroupData>*>(
1173 const std::string& script_uri = (*isolate_group_data)->GetAdvisoryScriptURI();
1174 return dart::bin::NativeAssets::DlopenRelative(path, script_uri.data(),
1175 error);
1176}
static void * DlopenRelative(const char *path, const char *script_uri, char **error)
DART_EXPORT void * Dart_CurrentIsolateGroupData(void)
const uint8_t uint32_t uint32_t GError ** error

◆ normalizeScancode()

static uint16_t flutter::normalizeScancode ( int  windowsScanCode,
bool  extended 
)
static

Definition at line 104 of file keyboard_key_embedder_handler.cc.

104 {
105 // In Chromium spec the extended bit is shown as 0xe000 bit,
106 // e.g. PageUp is represented as 0xe049.
107 return (windowsScanCode & 0xff) | (extended ? 0xe000 : 0);
108}

◆ NotEquals() [1/4]

template<class T >
bool flutter::NotEquals ( const T a,
const T b 
)

Definition at line 70 of file dl_comparable.h.

70 {
71 return !Equals<T>(a, b);
72}

◆ NotEquals() [2/4]

template<class T >
bool flutter::NotEquals ( const T a,
std::shared_ptr< const T b 
)

Definition at line 85 of file dl_comparable.h.

85 {
86 return !Equals(a, b.get());
87}

◆ NotEquals() [3/4]

template<class T >
bool flutter::NotEquals ( std::shared_ptr< const T a,
const T b 
)

Definition at line 75 of file dl_comparable.h.

75 {
76 return !Equals(a.get(), b);
77}

◆ NotEquals() [4/4]

template<class T >
bool flutter::NotEquals ( std::shared_ptr< const T a,
std::shared_ptr< const T b 
)

Definition at line 95 of file dl_comparable.h.

95 {
96 return !Equals(a.get(), b.get());
97}

◆ NotifyLowMemoryWarning()

static void flutter::NotifyLowMemoryWarning ( JNIEnv *  env,
jobject  obj,
jlong  shell_holder 
)
static

Definition at line 552 of file platform_view_android_jni_impl.cc.

554 {
555 ANDROID_SHELL_HOLDER->NotifyLowMemoryWarning();
556}

◆ NumWindowsForThread()

static int64_t flutter::NumWindowsForThread ( const THREADENTRY32 &  thread)
static

Definition at line 149 of file windows_lifecycle_manager.cc.

149 {
150 int64_t num_windows = 0;
151 ::EnumThreadWindows(
152 thread.th32ThreadID,
153 [](HWND hwnd, LPARAM lparam) {
154 int64_t* windows_ptr = reinterpret_cast<int64_t*>(lparam);
155 if (::GetParent(hwnd) == nullptr) {
156 (*windows_ptr)++;
157 }
158 return *windows_ptr <= 1 ? TRUE : FALSE;
159 },
160 reinterpret_cast<LPARAM>(&num_windows));
161 return num_windows;
162}
return FALSE
LONG_PTR LPARAM
Definition: windows_types.h:60

◆ Op()

API void flutter::Op ( SkPath one,
SkPath two,
SkPathOp  op 
)

Definition at line 44 of file path_ops.cc.

44 {
45 Op(*one, *two, op, one);
46}
void Op(SkPath *one, SkPath *two, SkPathOp op)
Definition: path_ops.cc:44

◆ operator<<()

std::ostream & flutter::operator<< ( std::ostream &  os,
const ViewportMetrics a 
)

Definition at line 97 of file viewport_metrics.cc.

97 {
98 os << "DPR: " << a.device_pixel_ratio << " " << "Size: [" << a.physical_width
99 << "W " << a.physical_height << "H] " << "Padding: ["
100 << a.physical_padding_top << "T " << a.physical_padding_right << "R "
101 << a.physical_padding_bottom << "B " << a.physical_padding_left << "L] "
102 << "Insets: [" << a.physical_view_inset_top << "T "
103 << a.physical_view_inset_right << "R " << a.physical_view_inset_bottom
104 << "B " << a.physical_view_inset_left << "L] " << "Gesture Insets: ["
105 << a.physical_system_gesture_inset_top << "T "
106 << a.physical_system_gesture_inset_right << "R "
107 << a.physical_system_gesture_inset_bottom << "B "
108 << a.physical_system_gesture_inset_left << "L] "
109 << "Display Features: " << a.physical_display_features_type.size() << " "
110 << "Display ID: " << a.display_id;
111 return os;
112}

◆ operator==() [1/2]

bool flutter::operator== ( const LayoutGoal a,
const LayoutGoal b 
)

Definition at line 12 of file KeyCodeMapTest.mm.

12 {
13 return a.keyCode == b.keyCode && a.keyChar == b.keyChar && a.mandatory == b.mandatory;
14}

◆ operator==() [2/2]

bool flutter::operator== ( const ViewportMetrics a,
const ViewportMetrics b 
)

Definition at line 68 of file viewport_metrics.cc.

68 {
69 return a.device_pixel_ratio == b.device_pixel_ratio &&
70 a.physical_width == b.physical_width &&
71 a.physical_height == b.physical_height &&
72 a.physical_padding_top == b.physical_padding_top &&
73 a.physical_padding_right == b.physical_padding_right &&
74 a.physical_padding_bottom == b.physical_padding_bottom &&
75 a.physical_padding_left == b.physical_padding_left &&
76 a.physical_view_inset_top == b.physical_view_inset_top &&
77 a.physical_view_inset_right == b.physical_view_inset_right &&
78 a.physical_view_inset_bottom == b.physical_view_inset_bottom &&
79 a.physical_view_inset_left == b.physical_view_inset_left &&
80 a.physical_system_gesture_inset_top ==
81 b.physical_system_gesture_inset_top &&
82 a.physical_system_gesture_inset_right ==
83 b.physical_system_gesture_inset_right &&
84 a.physical_system_gesture_inset_bottom ==
85 b.physical_system_gesture_inset_bottom &&
86 a.physical_system_gesture_inset_left ==
87 b.physical_system_gesture_inset_left &&
88 a.physical_touch_slop == b.physical_touch_slop &&
89 a.physical_display_features_bounds ==
90 b.physical_display_features_bounds &&
91 a.physical_display_features_type == b.physical_display_features_type &&
92 a.physical_display_features_state ==
93 b.physical_display_features_state &&
94 a.display_id == b.display_id;
95}

◆ ParseBase32()

sk_sp< SkData > flutter::ParseBase32 ( const std::string &  input)

Definition at line 163 of file persistent_cache.cc.

163 {
164 std::pair<bool, std::string> decode_result = fml::Base32Decode(input);
165 if (!decode_result.first) {
166 FML_LOG(ERROR) << "Base32 can't decode: " << input;
167 return nullptr;
168 }
169 const std::string& data_string = decode_result.second;
170 return SkData::MakeWithCopy(data_string.data(), data_string.length());
171}
std::pair< bool, std::string > Base32Decode(const std::string &input)
Definition: base32.cc:55

◆ ParseBase64()

sk_sp< SkData > flutter::ParseBase64 ( const std::string &  input)

Definition at line 173 of file persistent_cache.cc.

173 {
175
176 size_t output_len;
177 error = Base64::Decode(input.c_str(), input.length(), nullptr, &output_len);
179 FML_LOG(ERROR) << "Base64 decode error: " << (int)error;
180 FML_LOG(ERROR) << "Base64 can't decode: " << input;
181 return nullptr;
182 }
183
185 void* output = data->writable_data();
186 error = Base64::Decode(input.c_str(), input.length(), output, &output_len);
188 FML_LOG(ERROR) << "Base64 decode error: " << (int)error;
189 FML_LOG(ERROR) << "Base64 can't decode: " << input;
190 return nullptr;
191 }
192
193 return data;
194}
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)

◆ ParseCommaDelimited()

static std::vector< std::string > flutter::ParseCommaDelimited ( const std::string &  input)
static

Definition at line 153 of file switches.cc.

153 {
154 std::istringstream ss(input);
155 std::vector<std::string> result;
156 std::string token;
157 while (std::getline(ss, token, ',')) {
158 result.push_back(token);
159 }
160 return result;
161}

◆ ParseKernelListPaths()

static std::vector< std::string > flutter::ParseKernelListPaths ( std::unique_ptr< fml::Mapping kernel_list)
static

Definition at line 148 of file isolate_configuration.cc.

149 {
150 FML_DCHECK(kernel_list);
151
152 std::vector<std::string> kernel_pieces_paths;
153
154 const char* kernel_list_str =
155 reinterpret_cast<const char*>(kernel_list->GetMapping());
156 size_t kernel_list_size = kernel_list->GetSize();
157
158 size_t piece_path_start = 0;
159 while (piece_path_start < kernel_list_size) {
160 size_t piece_path_end = piece_path_start;
161 while ((piece_path_end < kernel_list_size) &&
162 (kernel_list_str[piece_path_end] != '\n')) {
163 piece_path_end++;
164 }
165 std::string piece_path(&kernel_list_str[piece_path_start],
166 piece_path_end - piece_path_start);
167 kernel_pieces_paths.emplace_back(std::move(piece_path));
168
169 piece_path_start = piece_path_end + 1;
170 }
171
172 return kernel_pieces_paths;
173}

◆ ParseLanguageName()

LanguageInfo flutter::ParseLanguageName ( std::wstring  language_name)

Definition at line 71 of file system_utils.cc.

71 {
73
74 // Split by '-', discarding any suplemental language info (-x-foo).
75 std::vector<std::string> components;
76 std::istringstream stream(fml::WideStringToUtf8(language_name));
77 std::string component;
78 while (getline(stream, component, '-')) {
79 if (component == "x") {
80 break;
81 }
82 components.push_back(component);
83 }
84
85 // Determine which components are which.
86 info.language = components[0];
87 if (components.size() == 3) {
88 info.script = components[1];
89 info.region = components[2];
90 } else if (components.size() == 2) {
91 // A script code will always be four characters long.
92 if (components[1].size() == 4) {
93 info.script = components[1];
94 } else {
95 info.region = components[1];
96 }
97 }
98 return info;
99}
std::string WideStringToUtf8(const std::wstring_view str)

◆ PersistentCacheStore()

static void flutter::PersistentCacheStore ( const fml::RefPtr< fml::TaskRunner > &  worker,
const std::shared_ptr< fml::UniqueFD > &  cache_directory,
std::string  key,
std::unique_ptr< fml::Mapping value 
)
static

Definition at line 349 of file persistent_cache.cc.

353 {
354 // The static leak checker gets confused by the use of fml::MakeCopyable.
355 // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
356 auto task = fml::MakeCopyable([cache_directory, //
357 file_name = std::move(key), //
358 mapping = std::move(value) //
359 ]() mutable {
360 TRACE_EVENT0("flutter", "PersistentCacheStore");
361 if (!fml::WriteAtomically(*cache_directory, //
362 file_name.c_str(), //
363 *mapping) //
364 ) {
365 FML_LOG(WARNING) << "Could not write cache contents to persistent store.";
366 }
367 });
368
369 if (!worker) {
370 FML_LOG(WARNING)
371 << "The persistent cache has no available workers. Performing the task "
372 "on the current thread. This slow operation is going to occur on a "
373 "frame workload.";
374 task();
375 } else {
376 worker->PostTask(std::move(task));
377 }
378}
bool WriteAtomically(const fml::UniqueFD &base_directory, const char *file_name, const Mapping &mapping)
Definition: file_posix.cc:191

◆ Prefer24HourTime()

bool flutter::Prefer24HourTime ( std::wstring  time_format)

Definition at line 113 of file system_utils.cc.

113 {
114 return time_format.find(L"H") != std::wstring::npos;
115}

◆ PrefetchDefaultFontManager()

static void flutter::PrefetchDefaultFontManager ( JNIEnv *  env,
jclass  jcaller 
)
static

Definition at line 204 of file flutter_main.cc.

204 {
205 // Initialize a singleton owned by Skia.
207}

◆ PrepareKernelMappings()

static std::vector< std::future< std::unique_ptr< const fml::Mapping > > > flutter::PrepareKernelMappings ( const std::vector< std::string > &  kernel_pieces_paths,
const std::shared_ptr< AssetManager > &  asset_manager,
const fml::RefPtr< fml::TaskRunner > &  io_worker 
)
static

Definition at line 176 of file isolate_configuration.cc.

178 {
179 FML_DCHECK(asset_manager);
180 std::vector<std::future<std::unique_ptr<const fml::Mapping>>> fetch_futures;
181
182 for (const auto& kernel_pieces_path : kernel_pieces_paths) {
183 std::promise<std::unique_ptr<const fml::Mapping>> fetch_promise;
184 fetch_futures.push_back(fetch_promise.get_future());
185 auto fetch_task =
186 fml::MakeCopyable([asset_manager, kernel_pieces_path,
187 fetch_promise = std::move(fetch_promise)]() mutable {
188 fetch_promise.set_value(
189 asset_manager->GetAsMapping(kernel_pieces_path));
190 });
191 // Fulfill the promise on the worker if one is available or the current
192 // thread if one is not.
193 if (io_worker) {
194 io_worker->PostTask(fetch_task);
195 } else {
196 fetch_task();
197 }
198 }
199
200 return fetch_futures;
201}

◆ PrintUsage()

void flutter::PrintUsage ( const std::string &  executable_name)

Definition at line 90 of file switches.cc.

90 {
91 std::cerr << std::endl << " " << executable_name << std::endl << std::endl;
92
93 std::cerr << "Versions: " << std::endl << std::endl;
94
95 std::cerr << "Flutter Engine Version: " << GetFlutterEngineVersion()
96 << std::endl;
97 std::cerr << "Skia Version: " << GetSkiaVersion() << std::endl;
98
99 std::cerr << "Dart Version: " << GetDartVersion() << std::endl << std::endl;
100
101 std::cerr << "Available Flags:" << std::endl;
102
103 const uint32_t column_width = 80;
104
105 const uint32_t flags_count = static_cast<uint32_t>(Switch::Sentinel);
106
107 uint32_t max_width = 2;
108 for (uint32_t i = 0; i < flags_count; i++) {
109 auto desc = gSwitchDescs[i];
110 max_width = std::max<uint32_t>(desc.flag.size() + 2, max_width);
111 }
112
113 const uint32_t help_width = column_width - max_width - 3;
114
115 std::cerr << std::string(column_width, '-') << std::endl;
116 for (uint32_t i = 0; i < flags_count; i++) {
117 auto desc = gSwitchDescs[i];
118
119 std::cerr << std::setw(max_width)
120 << std::string("--") +
121 std::string{desc.flag.data(), desc.flag.size()}
122 << " : ";
123
124 std::istringstream stream(desc.help);
125 int32_t remaining = help_width;
126
127 std::string word;
128 while (stream >> word && remaining > 0) {
129 remaining -= (word.size() + 1);
130 if (remaining <= 0) {
131 std::cerr << std::endl
132 << std::string(max_width, ' ') << " " << word << " ";
133 remaining = help_width;
134 } else {
135 std::cerr << word << " ";
136 }
137 }
138
139 std::cerr << std::endl;
140 }
141 std::cerr << std::string(column_width, '-') << std::endl;
142}
intptr_t word
Definition: globals.h:500
const char * GetDartVersion()
Definition: version.cc:19
const char * GetSkiaVersion()
Definition: version.cc:15
const char * GetFlutterEngineVersion()
Definition: version.cc:11

◆ ProductVersionFromSystemVersionPList()

std::optional< ProductVersion > flutter::ProductVersionFromSystemVersionPList ( )

Definition at line 53 of file availability_version_check.cc.

53 {
54 std::string plist_path = "/System/Library/CoreServices/SystemVersion.plist";
55#if FML_OS_IOS_SIMULATOR
56 char* plist_path_prefix = getenv("IPHONE_SIMULATOR_ROOT");
57 if (!plist_path_prefix) {
58 FML_DLOG(ERROR) << "Failed to getenv IPHONE_SIMULATOR_ROOT";
59 return std::nullopt;
60 }
61 plist_path = std::string(plist_path_prefix) + plist_path;
62#endif // FML_OS_IOS_SIMULATOR
63
64 auto plist_mapping = fml::FileMapping::CreateReadOnly(plist_path);
65
66 // Get the file buffer into CF's format. We pass in a null allocator here *
67 // because we free PListBuf ourselves
68 auto file_contents = fml::CFRef<CFDataRef>(CFDataCreateWithBytesNoCopy(
69 nullptr, plist_mapping->GetMapping(),
70 static_cast<CFIndex>(plist_mapping->GetSize()), kCFAllocatorNull));
71 if (!file_contents) {
72 FML_DLOG(ERROR) << "Failed to CFDataCreateWithBytesNoCopyFunc";
73 return std::nullopt;
74 }
75
76 auto plist = fml::CFRef<CFDictionaryRef>(
77 reinterpret_cast<CFDictionaryRef>(CFPropertyListCreateWithData(
78 nullptr, file_contents, CF_PROPERTY_LIST_IMMUTABLE, nullptr,
79 nullptr)));
80 if (!plist) {
81 FML_DLOG(ERROR) << "Failed to CFPropertyListCreateWithDataFunc or "
82 "CFPropertyListCreateFromXMLDataFunc";
83 return std::nullopt;
84 }
85
86 auto product_version =
87 fml::CFRef<CFStringRef>(CFStringCreateWithCStringNoCopy(
88 nullptr, "ProductVersion", kCFStringEncodingASCII, kCFAllocatorNull));
89 if (!product_version) {
90 FML_DLOG(ERROR) << "Failed to CFStringCreateWithCStringNoCopyFunc";
91 return std::nullopt;
92 }
93 CFTypeRef opaque_value = CFDictionaryGetValue(plist, product_version);
94 if (!opaque_value || CFGetTypeID(opaque_value) != CFStringGetTypeID()) {
95 FML_DLOG(ERROR) << "Failed to CFDictionaryGetValueFunc";
96 return std::nullopt;
97 }
98
99 char version_str[32];
100 if (!CFStringGetCString(reinterpret_cast<CFStringRef>(opaque_value),
101 version_str, sizeof(version_str),
102 kCFStringEncodingUTF8)) {
103 FML_DLOG(ERROR) << "Failed to CFStringGetCStringFunc";
104 return std::nullopt;
105 }
106
107 int32_t major = 0;
108 int32_t minor = 0;
109 int32_t subminor = 0;
110 int matches = sscanf(version_str, "%d.%d.%d", &major, &minor, &subminor);
111 // A major version number is sufficient. The minor and subminor numbers might
112 // not be present.
113 if (matches < 1) {
114 FML_DLOG(ERROR) << "Failed to match product version string: "
115 << version_str;
116 return std::nullopt;
117 }
118
119 return ProductVersion{major, minor, subminor};
120}
#define CF_PROPERTY_LIST_IMMUTABLE
def matches(file)
Definition: gen_manifest.py:38

◆ ProfilingFlags()

static std::vector< const char * > flutter::ProfilingFlags ( bool  enable_profiling)
static

Definition at line 209 of file dart_vm.cc.

209 {
210// Disable Dart's built in profiler when building a debug build. This
211// works around a race condition that would sometimes stop a crash's
212// stack trace from being printed on Android.
213#ifndef NDEBUG
214 enable_profiling = false;
215#endif
216
217 // We want to disable profiling by default because it overwhelms LLDB. But
218 // the VM enables the same by default. In either case, we have some profiling
219 // flags.
220 if (enable_profiling) {
221 return {
222 // This is the default. But just be explicit.
223 "--profiler",
224 // This instructs the profiler to walk C++ frames, and to include
225 // them in the profile.
226 "--profile-vm",
227#if FML_OS_IOS && FML_ARCH_CPU_ARM_FAMILY && FML_ARCH_CPU_ARMEL
228 // Set the profiler interrupt period to 500Hz instead of the
229 // default 1000Hz on 32-bit iOS devices to reduce average and worst
230 // case frame build times.
231 //
232 // Note: profile_period is time in microseconds between sampling
233 // events, not frequency. Frequency is calculated 1/period (or
234 // 1,000,000 / 2,000 -> 500Hz in this case).
235 "--profile_period=2000",
236#else
237 "--profile_period=1000",
238#endif // FML_OS_IOS && FML_ARCH_CPU_ARM_FAMILY && FML_ARCH_CPU_ARMEL
239 };
240 } else {
241 return {"--no-profiler"};
242 }
243}

◆ PropagateIfError()

static void flutter::PropagateIfError ( Dart_Handle  result)
static

Definition at line 36 of file dart_runtime_hooks.cc.

36 {
37 if (Dart_IsError(result)) {
38 FML_LOG(ERROR) << "Dart Error: " << ::Dart_GetError(result);
40 }
41}
DART_EXPORT void Dart_PropagateError(Dart_Handle handle)
DART_EXPORT const char * Dart_GetError(Dart_Handle handle)

◆ ProtectEmpty() [1/3]

static const DlRect & flutter::ProtectEmpty ( const DlRect rect)
static

Definition at line 28 of file dl_matrix_clip_tracker.cc.

28 {
29 // isEmpty protects us against NaN while we normalize any empty cull rects
30 return rect.IsEmpty() ? kEmpty : rect;
31}
static constexpr DlRect kEmpty

◆ ProtectEmpty() [2/3]

static const DlRect & flutter::ProtectEmpty ( const SkRect rect)
static

Definition at line 119 of file dl_builder.cc.

119 {
120 // isEmpty protects us against NaN while we normalize any empty cull rects
121 return rect.isEmpty() ? kEmpty : ToDlRect(rect);
122}
const DlRect & ToDlRect(const SkRect &rect)

◆ ProtectEmpty() [3/3]

static const DlRect & flutter::ProtectEmpty ( const SkRect rect)
static

Definition at line 23 of file dl_matrix_clip_tracker.cc.

23 {
24 // isEmpty protects us against NaN while we normalize any empty cull rects
25 return rect.isEmpty() ? kEmpty : ToDlRect(rect);
26}

◆ PushBackAll()

void flutter::PushBackAll ( std::vector< const char * > *  args,
const char **  argv,
size_t  argc 
)

Definition at line 245 of file dart_vm.cc.

247 {
248 for (size_t i = 0; i < argc; ++i) {
249 args->push_back(argv[i]);
250 }
251}
char ** argv
Definition: library.h:9

◆ pushStringAttributes()

void flutter::pushStringAttributes ( StringAttributes destination,
const std::vector< NativeStringAttribute * > &  native_attributes 
)

Definition at line 19 of file semantics_update_builder.cc.

21 {
22 for (const auto& native_attribute : native_attributes) {
23 destination.push_back(native_attribute->GetAttribute());
24 }
25}

◆ putStringAttributesIntoBuffer()

void flutter::putStringAttributesIntoBuffer ( const StringAttributes attributes,
int32_t *  buffer_int32,
size_t &  position,
std::vector< std::vector< uint8_t > > &  string_attribute_args 
)

Definition at line 11 of file platform_view_android_delegate.cc.

15 {
16 if (attributes.empty()) {
17 buffer_int32[position++] = -1;
18 return;
19 }
20 buffer_int32[position++] = attributes.size();
21 for (const auto& attribute : attributes) {
22 buffer_int32[position++] = attribute->start;
23 buffer_int32[position++] = attribute->end;
24 buffer_int32[position++] = static_cast<int32_t>(attribute->type);
25 switch (attribute->type) {
27 buffer_int32[position++] = -1;
28 break;
30 buffer_int32[position++] = string_attribute_args.size();
31 std::shared_ptr<LocaleStringAttribute> locale_attribute =
32 std::static_pointer_cast<LocaleStringAttribute>(attribute);
33 string_attribute_args.push_back(
34 {locale_attribute->locale.begin(), locale_attribute->locale.end()});
35 break;
36 }
37 }
38}

◆ Rasterize()

bool flutter::Rasterize ( RasterCacheItem::CacheState  cache_state,
Layer layer,
const PaintContext paint_context,
DlCanvas canvas 
)

Definition at line 104 of file layer_raster_cache_item.cc.

107 {
109 LayerStateStack state_stack;
110 state_stack.set_delegate(canvas);
111 PaintContext context = {
112 // clang-format off
113 .state_stack = state_stack,
114 .canvas = canvas,
115 .gr_context = paint_context.gr_context,
116 .dst_color_space = paint_context.dst_color_space,
117 .view_embedder = paint_context.view_embedder,
118 .raster_time = paint_context.raster_time,
119 .ui_time = paint_context.ui_time,
120 .texture_registry = paint_context.texture_registry,
121 .raster_cache = paint_context.raster_cache,
122 // clang-format on
123 };
124
125 switch (cache_state) {
126 case RasterCacheItem::CacheState::kCurrent:
127 FML_DCHECK(layer->needs_painting(context));
128 layer->Paint(context);
129 break;
130 case RasterCacheItem::CacheState::kChildren:
131 layer->PaintChildren(context);
132 break;
135 return false;
136 }
137 return true;
138}
void set_delegate(DlCanvas *canvas)
virtual void PaintChildren(PaintContext &context) const
Definition: layer.h:199
bool needs_painting(PaintContext &context) const
Definition: layer.h:232
virtual void Paint(PaintContext &context) const =0
ExternalViewEmbedder * view_embedder
Definition: layer.h:111
sk_sp< SkColorSpace > dst_color_space
Definition: layer.h:110
const Stopwatch & raster_time
Definition: layer.h:112
const Stopwatch & ui_time
Definition: layer.h:113
std::shared_ptr< TextureRegistry > texture_registry
Definition: layer.h:114
GrDirectContext * gr_context
Definition: layer.h:109
LayerStateStack & state_stack
Definition: layer.h:101

◆ RegisterApi()

bool flutter::RegisterApi ( JNIEnv *  env)

Definition at line 658 of file platform_view_android_jni_impl.cc.

658 {
659 static const JNINativeMethod flutter_jni_methods[] = {
660 // Start of methods from FlutterJNI
661 {
662 .name = "nativeAttach",
663 .signature = "(Lio/flutter/embedding/engine/FlutterJNI;)J",
664 .fnPtr = reinterpret_cast<void*>(&AttachJNI),
665 },
666 {
667 .name = "nativeDestroy",
668 .signature = "(J)V",
669 .fnPtr = reinterpret_cast<void*>(&DestroyJNI),
670 },
671 {
672 .name = "nativeSpawn",
673 .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
674 "String;Ljava/util/List;)Lio/flutter/"
675 "embedding/engine/FlutterJNI;",
676 .fnPtr = reinterpret_cast<void*>(&SpawnJNI),
677 },
678 {
679 .name = "nativeRunBundleAndSnapshotFromLibrary",
680 .signature = "(JLjava/lang/String;Ljava/lang/String;"
681 "Ljava/lang/String;Landroid/content/res/"
682 "AssetManager;Ljava/util/List;)V",
683 .fnPtr = reinterpret_cast<void*>(&RunBundleAndSnapshotFromLibrary),
684 },
685 {
686 .name = "nativeDispatchEmptyPlatformMessage",
687 .signature = "(JLjava/lang/String;I)V",
688 .fnPtr = reinterpret_cast<void*>(&DispatchEmptyPlatformMessage),
689 },
690 {
691 .name = "nativeCleanupMessageData",
692 .signature = "(J)V",
693 .fnPtr = reinterpret_cast<void*>(&CleanupMessageData),
694 },
695 {
696 .name = "nativeDispatchPlatformMessage",
697 .signature = "(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
698 .fnPtr = reinterpret_cast<void*>(&DispatchPlatformMessage),
699 },
700 {
701 .name = "nativeInvokePlatformMessageResponseCallback",
702 .signature = "(JILjava/nio/ByteBuffer;I)V",
703 .fnPtr =
704 reinterpret_cast<void*>(&InvokePlatformMessageResponseCallback),
705 },
706 {
707 .name = "nativeInvokePlatformMessageEmptyResponseCallback",
708 .signature = "(JI)V",
709 .fnPtr = reinterpret_cast<void*>(
711 },
712 {
713 .name = "nativeNotifyLowMemoryWarning",
714 .signature = "(J)V",
715 .fnPtr = reinterpret_cast<void*>(&NotifyLowMemoryWarning),
716 },
717
718 // Start of methods from FlutterView
719 {
720 .name = "nativeGetBitmap",
721 .signature = "(J)Landroid/graphics/Bitmap;",
722 .fnPtr = reinterpret_cast<void*>(&GetBitmap),
723 },
724 {
725 .name = "nativeSurfaceCreated",
726 .signature = "(JLandroid/view/Surface;)V",
727 .fnPtr = reinterpret_cast<void*>(&SurfaceCreated),
728 },
729 {
730 .name = "nativeSurfaceWindowChanged",
731 .signature = "(JLandroid/view/Surface;)V",
732 .fnPtr = reinterpret_cast<void*>(&SurfaceWindowChanged),
733 },
734 {
735 .name = "nativeSurfaceChanged",
736 .signature = "(JII)V",
737 .fnPtr = reinterpret_cast<void*>(&SurfaceChanged),
738 },
739 {
740 .name = "nativeSurfaceDestroyed",
741 .signature = "(J)V",
742 .fnPtr = reinterpret_cast<void*>(&SurfaceDestroyed),
743 },
744 {
745 .name = "nativeSetViewportMetrics",
746 .signature = "(JFIIIIIIIIIIIIIII[I[I[I)V",
747 .fnPtr = reinterpret_cast<void*>(&SetViewportMetrics),
748 },
749 {
750 .name = "nativeDispatchPointerDataPacket",
751 .signature = "(JLjava/nio/ByteBuffer;I)V",
752 .fnPtr = reinterpret_cast<void*>(&DispatchPointerDataPacket),
753 },
754 {
755 .name = "nativeDispatchSemanticsAction",
756 .signature = "(JIILjava/nio/ByteBuffer;I)V",
757 .fnPtr = reinterpret_cast<void*>(&DispatchSemanticsAction),
758 },
759 {
760 .name = "nativeSetSemanticsEnabled",
761 .signature = "(JZ)V",
762 .fnPtr = reinterpret_cast<void*>(&SetSemanticsEnabled),
763 },
764 {
765 .name = "nativeSetAccessibilityFeatures",
766 .signature = "(JI)V",
767 .fnPtr = reinterpret_cast<void*>(&SetAccessibilityFeatures),
768 },
769 {
770 .name = "nativeGetIsSoftwareRenderingEnabled",
771 .signature = "()Z",
772 .fnPtr = reinterpret_cast<void*>(&GetIsSoftwareRendering),
773 },
774 {
775 .name = "nativeRegisterTexture",
776 .signature = "(JJLjava/lang/ref/"
777 "WeakReference;)V",
778 .fnPtr = reinterpret_cast<void*>(&RegisterTexture),
779 },
780 {
781 .name = "nativeRegisterImageTexture",
782 .signature = "(JJLjava/lang/ref/"
783 "WeakReference;)V",
784 .fnPtr = reinterpret_cast<void*>(&RegisterImageTexture),
785 },
786 {
787 .name = "nativeMarkTextureFrameAvailable",
788 .signature = "(JJ)V",
789 .fnPtr = reinterpret_cast<void*>(&MarkTextureFrameAvailable),
790 },
791 {
792 .name = "nativeScheduleFrame",
793 .signature = "(J)V",
794 .fnPtr = reinterpret_cast<void*>(&ScheduleFrame),
795 },
796 {
797 .name = "nativeUnregisterTexture",
798 .signature = "(JJ)V",
799 .fnPtr = reinterpret_cast<void*>(&UnregisterTexture),
800 },
801 // Methods for Dart callback functionality.
802 {
803 .name = "nativeLookupCallbackInformation",
804 .signature = "(J)Lio/flutter/view/FlutterCallbackInformation;",
805 .fnPtr = reinterpret_cast<void*>(&LookupCallbackInformation),
806 },
807
808 // Start of methods for FlutterTextUtils
809 {
810 .name = "nativeFlutterTextUtilsIsEmoji",
811 .signature = "(I)Z",
812 .fnPtr = reinterpret_cast<void*>(&FlutterTextUtilsIsEmoji),
813 },
814 {
815 .name = "nativeFlutterTextUtilsIsEmojiModifier",
816 .signature = "(I)Z",
817 .fnPtr = reinterpret_cast<void*>(&FlutterTextUtilsIsEmojiModifier),
818 },
819 {
820 .name = "nativeFlutterTextUtilsIsEmojiModifierBase",
821 .signature = "(I)Z",
822 .fnPtr =
823 reinterpret_cast<void*>(&FlutterTextUtilsIsEmojiModifierBase),
824 },
825 {
826 .name = "nativeFlutterTextUtilsIsVariationSelector",
827 .signature = "(I)Z",
828 .fnPtr =
829 reinterpret_cast<void*>(&FlutterTextUtilsIsVariationSelector),
830 },
831 {
832 .name = "nativeFlutterTextUtilsIsRegionalIndicator",
833 .signature = "(I)Z",
834 .fnPtr =
835 reinterpret_cast<void*>(&FlutterTextUtilsIsRegionalIndicator),
836 },
837 {
838 .name = "nativeLoadDartDeferredLibrary",
839 .signature = "(JI[Ljava/lang/String;)V",
840 .fnPtr = reinterpret_cast<void*>(&LoadDartDeferredLibrary),
841 },
842 {
843 .name = "nativeUpdateJavaAssetManager",
844 .signature =
845 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
846 .fnPtr = reinterpret_cast<void*>(&UpdateJavaAssetManager),
847 },
848 {
849 .name = "nativeDeferredComponentInstallFailure",
850 .signature = "(ILjava/lang/String;Z)V",
851 .fnPtr = reinterpret_cast<void*>(&DeferredComponentInstallFailure),
852 },
853 {
854 .name = "nativeUpdateDisplayMetrics",
855 .signature = "(J)V",
856 .fnPtr = reinterpret_cast<void*>(&UpdateDisplayMetrics),
857 },
858 };
859
860 if (env->RegisterNatives(g_flutter_jni_class->obj(), flutter_jni_methods,
861 fml::size(flutter_jni_methods)) != 0) {
862 FML_LOG(ERROR) << "Failed to RegisterNatives with FlutterJNI";
863 return false;
864 }
865
866 g_jni_shell_holder_field = env->GetFieldID(
867 g_flutter_jni_class->obj(), "nativeShellHolderId", "Ljava/lang/Long;");
868
869 if (g_jni_shell_holder_field == nullptr) {
870 FML_LOG(ERROR) << "Could not locate FlutterJNI's nativeShellHolderId field";
871 return false;
872 }
873
875 env->GetMethodID(g_flutter_jni_class->obj(), "<init>", "()V");
876
877 if (g_jni_constructor == nullptr) {
878 FML_LOG(ERROR) << "Could not locate FlutterJNI's constructor";
879 return false;
880 }
881
882 g_long_constructor = env->GetStaticMethodID(g_java_long_class->obj(),
883 "valueOf", "(J)Ljava/lang/Long;");
884 if (g_long_constructor == nullptr) {
885 FML_LOG(ERROR) << "Could not locate Long's constructor";
886 return false;
887 }
888
890 env->GetMethodID(g_flutter_jni_class->obj(), "handlePlatformMessage",
891 "(Ljava/lang/String;Ljava/nio/ByteBuffer;IJ)V");
892
893 if (g_handle_platform_message_method == nullptr) {
894 FML_LOG(ERROR) << "Could not locate handlePlatformMessage method";
895 return false;
896 }
897
899 g_flutter_jni_class->obj(), "handlePlatformMessageResponse",
900 "(ILjava/nio/ByteBuffer;)V");
901
903 FML_LOG(ERROR) << "Could not locate handlePlatformMessageResponse method";
904 return false;
905 }
906
907 g_get_scaled_font_size_method = env->GetMethodID(
908 g_flutter_jni_class->obj(), "getScaledFontSize", "(FI)F");
909
910 if (g_get_scaled_font_size_method == nullptr) {
911 FML_LOG(ERROR) << "Could not locate FlutterJNI#getScaledFontSize method";
912 return false;
913 }
914
915 g_update_semantics_method = env->GetMethodID(
916 g_flutter_jni_class->obj(), "updateSemantics",
917 "(Ljava/nio/ByteBuffer;[Ljava/lang/String;[Ljava/nio/ByteBuffer;)V");
918
919 if (g_update_semantics_method == nullptr) {
920 FML_LOG(ERROR) << "Could not locate updateSemantics method";
921 return false;
922 }
923
925 g_flutter_jni_class->obj(), "updateCustomAccessibilityActions",
926 "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V");
927
930 << "Could not locate updateCustomAccessibilityActions method";
931 return false;
932 }
933
935 env->GetMethodID(g_flutter_jni_class->obj(), "onFirstFrame", "()V");
936
937 if (g_on_first_frame_method == nullptr) {
938 FML_LOG(ERROR) << "Could not locate onFirstFrame method";
939 return false;
940 }
941
943 env->GetMethodID(g_flutter_jni_class->obj(), "onPreEngineRestart", "()V");
944
945 if (g_on_engine_restart_method == nullptr) {
946 FML_LOG(ERROR) << "Could not locate onEngineRestart method";
947 return false;
948 }
949
951 env->GetMethodID(g_flutter_jni_class->obj(), "createOverlaySurface",
952 "()Lio/flutter/embedding/engine/FlutterOverlaySurface;");
953
954 if (g_create_overlay_surface_method == nullptr) {
955 FML_LOG(ERROR) << "Could not locate createOverlaySurface method";
956 return false;
957 }
958
960 g_flutter_jni_class->obj(), "destroyOverlaySurfaces", "()V");
961
962 if (g_destroy_overlay_surfaces_method == nullptr) {
963 FML_LOG(ERROR) << "Could not locate destroyOverlaySurfaces method";
964 return false;
965 }
966
967 fml::jni::ScopedJavaLocalRef<jclass> overlay_surface_class(
968 env, env->FindClass("io/flutter/embedding/engine/FlutterOverlaySurface"));
969 if (overlay_surface_class.is_null()) {
970 FML_LOG(ERROR) << "Could not locate FlutterOverlaySurface class";
971 return false;
972 }
974 env->GetMethodID(overlay_surface_class.obj(), "getId", "()I");
975 if (g_overlay_surface_id_method == nullptr) {
976 FML_LOG(ERROR) << "Could not locate FlutterOverlaySurface#getId() method";
977 return false;
978 }
980 overlay_surface_class.obj(), "getSurface", "()Landroid/view/Surface;");
981 if (g_overlay_surface_surface_method == nullptr) {
983 << "Could not locate FlutterOverlaySurface#getSurface() method";
984 return false;
985 }
986
988 env, env->FindClass("android/graphics/Bitmap"));
989 if (g_bitmap_class->is_null()) {
990 FML_LOG(ERROR) << "Could not locate Bitmap Class";
991 return false;
992 }
993
994 g_bitmap_create_bitmap_method = env->GetStaticMethodID(
995 g_bitmap_class->obj(), "createBitmap",
996 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
997 if (g_bitmap_create_bitmap_method == nullptr) {
998 FML_LOG(ERROR) << "Could not locate Bitmap.createBitmap method";
999 return false;
1000 }
1001
1003 g_bitmap_class->obj(), "copyPixelsFromBuffer", "(Ljava/nio/Buffer;)V");
1005 FML_LOG(ERROR) << "Could not locate Bitmap.copyPixelsFromBuffer method";
1006 return false;
1007 }
1008
1010 env, env->FindClass("android/graphics/Bitmap$Config"));
1011 if (g_bitmap_config_class->is_null()) {
1012 FML_LOG(ERROR) << "Could not locate Bitmap.Config Class";
1013 return false;
1014 }
1015
1016 g_bitmap_config_value_of = env->GetStaticMethodID(
1017 g_bitmap_config_class->obj(), "valueOf",
1018 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1019 if (g_bitmap_config_value_of == nullptr) {
1020 FML_LOG(ERROR) << "Could not locate Bitmap.Config.valueOf method";
1021 return false;
1022 }
1023
1024 return true;
1025}
static void RunBundleAndSnapshotFromLibrary(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jBundlePath, jstring jEntrypoint, jstring jLibraryUrl, jobject jAssetManager, jobject jEntrypointArgs)
static jmethodID g_handle_platform_message_method
static jfieldID g_jni_shell_holder_field
static void InvokePlatformMessageResponseCallback(JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId, jobject message, jint position)
static jboolean GetIsSoftwareRendering(JNIEnv *env, jobject jcaller)
static void DispatchPointerDataPacket(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject buffer, jint position)
static jboolean FlutterTextUtilsIsEmojiModifier(JNIEnv *env, jobject obj, jint codePoint)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_java_long_class
static jmethodID g_on_engine_restart_method
static void InvokePlatformMessageEmptyResponseCallback(JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId)
static jmethodID g_handle_platform_message_response_method
static void SurfaceDestroyed(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID g_create_overlay_surface_method
static jmethodID g_destroy_overlay_surfaces_method
static jmethodID g_long_constructor
static void DestroyJNI(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID g_get_scaled_font_size_method
static void DispatchSemanticsAction(JNIEnv *env, jobject jcaller, jlong shell_holder, jint id, jint action, jobject args, jint args_position)
static jmethodID g_jni_constructor
static void MarkTextureFrameAvailable(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
static void RegisterImageTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject image_texture_entry)
static void SetSemanticsEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder, jboolean enabled)
static void DeferredComponentInstallFailure(JNIEnv *env, jobject obj, jint jLoadingUnitId, jstring jError, jboolean jTransient)
static void LoadDartDeferredLibrary(JNIEnv *env, jobject obj, jlong shell_holder, jint jLoadingUnitId, jobjectArray jSearchPaths)
static void NotifyLowMemoryWarning(JNIEnv *env, jobject obj, jlong shell_holder)
static jboolean FlutterTextUtilsIsVariationSelector(JNIEnv *env, jobject obj, jint codePoint)
static jmethodID g_update_custom_accessibility_actions_method
static void CleanupMessageData(JNIEnv *env, jobject jcaller, jlong message_data)
static jmethodID g_overlay_surface_surface_method
static void DispatchPlatformMessage(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jobject message, jint position, jint responseId)
static jmethodID g_overlay_surface_id_method
static void SurfaceWindowChanged(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
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, jint physicalTouchSlop, jintArray javaDisplayFeaturesBounds, jintArray javaDisplayFeaturesType, jintArray javaDisplayFeaturesState)
static fml::jni::ScopedJavaGlobalRef< jclass > * g_flutter_jni_class
static void SurfaceCreated(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject jsurface)
static void DispatchEmptyPlatformMessage(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring channel, jint responseId)
static void ScheduleFrame(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jlong AttachJNI(JNIEnv *env, jclass clazz, jobject flutterJNI)
static void SetAccessibilityFeatures(JNIEnv *env, jobject jcaller, jlong shell_holder, jint flags)
static void UpdateDisplayMetrics(JNIEnv *env, jobject jcaller, jlong shell_holder)
static void SurfaceChanged(JNIEnv *env, jobject jcaller, jlong shell_holder, jint width, jint height)
static jmethodID g_on_first_frame_method
static void UpdateJavaAssetManager(JNIEnv *env, jobject obj, jlong shell_holder, jobject jAssetManager, jstring jAssetBundlePath)
static jobject GetBitmap(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID g_update_semantics_method
static void UnregisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
static jboolean FlutterTextUtilsIsEmojiModifierBase(JNIEnv *env, jobject obj, jint codePoint)
static jobject LookupCallbackInformation(JNIEnv *env, jobject, jlong handle)
static jboolean FlutterTextUtilsIsRegionalIndicator(JNIEnv *env, jobject obj, jint codePoint)
static jobject SpawnJNI(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jEntrypoint, jstring jLibraryUrl, jstring jInitialRoute, jobject jEntrypointArgs)
static jboolean FlutterTextUtilsIsEmoji(JNIEnv *env, jobject obj, jint codePoint)
static void RegisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject surface_texture)

◆ RegisterImageTexture()

static void flutter::RegisterImageTexture ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jlong  texture_id,
jobject  image_texture_entry 
)
static

Definition at line 498 of file platform_view_android_jni_impl.cc.

502 {
503 ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterImageTexture(
504 static_cast<int64_t>(texture_id), //
505 fml::jni::ScopedJavaGlobalRef<jobject>(env, image_texture_entry) //
506 );
507}

◆ RegisterTexture()

static void flutter::RegisterTexture ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jlong  texture_id,
jobject  surface_texture 
)
static

Definition at line 487 of file platform_view_android_jni_impl.cc.

491 {
492 ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture(
493 static_cast<int64_t>(texture_id), //
495 );
496}

◆ RenderFrameForScreenshot()

static void flutter::RenderFrameForScreenshot ( flutter::CompositorContext compositor_context,
DlCanvas canvas,
flutter::LayerTree tree,
GrDirectContext surface_context,
const std::shared_ptr< impeller::AiksContext > &  aiks_context 
)
static

Definition at line 861 of file rasterizer.cc.

866 {
867 // There is no root surface transformation for the screenshot layer. Reset
868 // the matrix to identity.
869 SkMatrix root_surface_transformation;
870 root_surface_transformation.reset();
871
872 auto frame = compositor_context.AcquireFrame(
873 /*gr_context=*/surface_context,
874 /*canvas=*/canvas,
875 /*view_embedder=*/nullptr,
876 /*root_surface_transformation=*/root_surface_transformation,
877 /*instrumentation_enabled=*/false,
878 /*surface_supports_readback=*/true,
879 /*raster_thread_merger=*/nullptr,
880 /*aiks_context=*/aiks_context.get());
881 canvas->Clear(DlColor::kTransparent());
882 frame->Raster(*tree, true, nullptr);
883 canvas->Flush();
884}
SkMatrix & reset()
Definition: SkMatrix.cpp:49
virtual std::unique_ptr< ScopedFrame > AcquireFrame(GrDirectContext *gr_context, DlCanvas *canvas, ExternalViewEmbedder *view_embedder, const SkMatrix &root_surface_transformation, bool instrumentation_enabled, bool surface_supports_readback, fml::RefPtr< fml::RasterThreadMerger > raster_thread_merger, impeller::AiksContext *aiks_context)
void Clear(DlColor color)
Definition: dl_canvas.h:132
virtual void Flush()=0
double frame
Definition: examples.cpp:31
constexpr SkColor4f kTransparent
Definition: SkColor.h:434

◆ Reset()

API void flutter::Reset ( SkPath path)

Definition at line 40 of file path_ops.cc.

40 {
41 path->reset();
42}

◆ ResetAnchor()

void flutter::ResetAnchor ( CALayer *  layer)

Definition at line 58 of file FlutterPlatformViews_Internal.mm.

58 {
59 // Flow uses (0, 0) to apply transform matrix so we need to match that in Quartz.
60 layer.anchorPoint = CGPointZero;
61 layer.position = CGPointZero;
62}

◆ ResizeRasterImage()

static sk_sp< SkImage > flutter::ResizeRasterImage ( const sk_sp< SkImage > &  image,
const SkISize resized_dimensions,
const fml::tracing::TraceFlow flow 
)
static

Definition at line 30 of file image_decoder_skia.cc.

32 {
34
35 TRACE_EVENT0("flutter", __FUNCTION__);
36 flow.Step(__FUNCTION__);
37
38 if (resized_dimensions.isEmpty()) {
39 FML_LOG(ERROR) << "Could not resize to empty dimensions.";
40 return nullptr;
41 }
42
43 if (image->dimensions() == resized_dimensions) {
44 return image->makeRasterImage();
45 }
46
47 const auto scaled_image_info =
48 image->imageInfo().makeDimensions(resized_dimensions);
49
50 SkBitmap scaled_bitmap;
51 if (!scaled_bitmap.tryAllocPixels(scaled_image_info)) {
52 FML_LOG(ERROR) << "Failed to allocate memory for bitmap of size "
53 << scaled_image_info.computeMinByteSize() << "B";
54 return nullptr;
55 }
56
57 if (!image->scalePixels(
58 scaled_bitmap.pixmap(),
61 FML_LOG(ERROR) << "Could not scale pixels";
62 return nullptr;
63 }
64
65 // Marking this as immutable makes the MakeFromBitmap call share the pixels
66 // instead of copying.
67 scaled_bitmap.setImmutable();
68
69 auto scaled_image = SkImages::RasterFromBitmap(scaled_bitmap);
70 if (!scaled_image) {
71 FML_LOG(ERROR) << "Could not create a scaled image from a scaled bitmap.";
72 return nullptr;
73 }
74
75 return scaled_image;
76}
void setImmutable()
Definition: SkBitmap.cpp:400
const SkPixmap & pixmap() const
Definition: SkBitmap.h:133
bool tryAllocPixels(const SkImageInfo &info, size_t rowBytes)
Definition: SkBitmap.cpp:271
const SkImageInfo & imageInfo() const
Definition: SkImage.h:279
virtual bool isTextureBacked() const =0
@ kDisallow_CachingHint
disallows internally caching decoded and copied pixels
Definition: SkImage.h:465
bool scalePixels(const SkPixmap &dst, const SkSamplingOptions &, CachingHint cachingHint=kAllow_CachingHint) const
Definition: SkImage.cpp:127
SK_API sk_sp< SkImage > RasterFromBitmap(const SkBitmap &bitmap)
bool isEmpty() const
Definition: SkSize.h:31
SkImageInfo makeDimensions(SkISize newSize) const
Definition: SkImageInfo.h:454

◆ ResolveIsolateData()

static std::shared_ptr< const fml::Mapping > flutter::ResolveIsolateData ( const Settings settings)
static

Definition at line 140 of file dart_snapshot.cc.

141 {
142#if DART_SNAPSHOT_STATIC_LINK
143 return std::make_unique<fml::NonOwnedMapping>(kDartIsolateSnapshotData,
144 0, // size
145 nullptr, // release_func
146 true // dontneed_safe
147 );
148#else // DART_SNAPSHOT_STATIC_LINK
149 return SearchMapping(
150 settings.isolate_snapshot_data, // embedder_mapping_callback
151 settings.isolate_snapshot_data_path, // file_path
152 settings.application_library_path, // native_library_path
153 DartSnapshot::kIsolateDataSymbol, // native_library_symbol_name
154 false // is_executable
155 );
156#endif // DART_SNAPSHOT_STATIC_LINK
157}
const uint8_t kDartIsolateSnapshotData[]
static std::shared_ptr< const fml::Mapping > SearchMapping(const 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)

◆ ResolveIsolateInstructions()

static std::shared_ptr< const fml::Mapping > flutter::ResolveIsolateInstructions ( const Settings settings)
static

Definition at line 159 of file dart_snapshot.cc.

160 {
161#if DART_SNAPSHOT_STATIC_LINK
162 return std::make_unique<fml::NonOwnedMapping>(
164 0, // size
165 nullptr, // release_func
166 true // dontneed_safe
167 );
168#else // DART_SNAPSHOT_STATIC_LINK
169 return SearchMapping(
170 settings.isolate_snapshot_instr, // embedder_mapping_callback
171 settings.isolate_snapshot_instr_path, // file_path
172 settings.application_library_path, // native_library_path
173 DartSnapshot::kIsolateInstructionsSymbol, // native_library_symbol_name
174 true // is_executable
175 );
176#endif // DART_SNAPSHOT_STATIC_LINK
177}
const uint8_t kDartIsolateSnapshotInstructions[]

◆ ResolveVMData()

static std::shared_ptr< const fml::Mapping > flutter::ResolveVMData ( const Settings settings)
static

Definition at line 102 of file dart_snapshot.cc.

103 {
104#if DART_SNAPSHOT_STATIC_LINK
105 return std::make_unique<fml::NonOwnedMapping>(kDartVmSnapshotData,
106 0, // size
107 nullptr, // release_func
108 true // dontneed_safe
109 );
110#else // DART_SNAPSHOT_STATIC_LINK
111 return SearchMapping(
112 settings.vm_snapshot_data, // embedder_mapping_callback
113 settings.vm_snapshot_data_path, // file_path
114 settings.application_library_path, // native_library_path
115 DartSnapshot::kVMDataSymbol, // native_library_symbol_name
116 false // is_executable
117 );
118#endif // DART_SNAPSHOT_STATIC_LINK
119}
const uint8_t kDartVmSnapshotData[]

◆ ResolveVMInstructions()

static std::shared_ptr< const fml::Mapping > flutter::ResolveVMInstructions ( const Settings settings)
static

Definition at line 121 of file dart_snapshot.cc.

122 {
123#if DART_SNAPSHOT_STATIC_LINK
124 return std::make_unique<fml::NonOwnedMapping>(kDartVmSnapshotInstructions,
125 0, // size
126 nullptr, // release_func
127 true // dontneed_safe
128 );
129#else // DART_SNAPSHOT_STATIC_LINK
130 return SearchMapping(
131 settings.vm_snapshot_instr, // embedder_mapping_callback
132 settings.vm_snapshot_instr_path, // file_path
133 settings.application_library_path, // native_library_path
134 DartSnapshot::kVMInstructionsSymbol, // native_library_symbol_name
135 true // is_executable
136 );
137#endif // DART_SNAPSHOT_STATIC_LINK
138}
const uint8_t kDartVmSnapshotInstructions[]

◆ RunBundleAndSnapshotFromLibrary()

static void flutter::RunBundleAndSnapshotFromLibrary ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jstring  jBundlePath,
jstring  jEntrypoint,
jstring  jLibraryUrl,
jobject  jAssetManager,
jobject  jEntrypointArgs 
)
static

Definition at line 268 of file platform_view_android_jni_impl.cc.

275 {
276 auto apk_asset_provider = std::make_unique<flutter::APKAssetProvider>(
277 env, // jni environment
278 jAssetManager, // asset manager
279 fml::jni::JavaStringToString(env, jBundlePath) // apk asset dir
280 );
281 auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint);
282 auto libraryUrl = fml::jni::JavaStringToString(env, jLibraryUrl);
283 auto entrypoint_args = fml::jni::StringListToVector(env, jEntrypointArgs);
284
285 ANDROID_SHELL_HOLDER->Launch(std::move(apk_asset_provider), entrypoint,
286 libraryUrl, entrypoint_args);
287}
std::vector< std::string > StringListToVector(JNIEnv *env, jobject list)
Definition: jni_util.cc:118

◆ RunTester()

int flutter::RunTester ( const flutter::Settings settings,
bool  run_forever,
bool  multithreaded 
)

Definition at line 334 of file tester_main.cc.

336 {
337 const auto thread_label = "io.flutter.test.";
338
339 // Necessary if we want to use the CPU profiler on the main isolate's mutator
340 // thread.
341 //
342 // OSX WARNING: avoid spawning additional threads before this call due to a
343 // kernel bug that may enable SIGPROF on an unintended thread in the process.
345
347
348 auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner();
349
350 std::unique_ptr<ThreadHost> threadhost;
351 fml::RefPtr<fml::TaskRunner> platform_task_runner;
352 fml::RefPtr<fml::TaskRunner> raster_task_runner;
353 fml::RefPtr<fml::TaskRunner> ui_task_runner;
354 fml::RefPtr<fml::TaskRunner> io_task_runner;
355
356 if (multithreaded) {
357 threadhost = std::make_unique<ThreadHost>(
358 thread_label, ThreadHost::Type::kPlatform | ThreadHost::Type::kIo |
359 ThreadHost::Type::kUi | ThreadHost::Type::kRaster);
360 platform_task_runner = current_task_runner;
361 raster_task_runner = threadhost->raster_thread->GetTaskRunner();
362 ui_task_runner = threadhost->ui_thread->GetTaskRunner();
363 io_task_runner = threadhost->io_thread->GetTaskRunner();
364 } else {
365 platform_task_runner = raster_task_runner = ui_task_runner =
366 io_task_runner = current_task_runner;
367 }
368
369 const flutter::TaskRunners task_runners(thread_label, // dart thread label
370 platform_task_runner, // platform
371 raster_task_runner, // raster
372 ui_task_runner, // ui
373 io_task_runner // io
374 );
375
376 ImpellerVulkanContextHolder impeller_context_holder;
377
378#if ALLOW_IMPELLER
379 if (settings.enable_impeller) {
380 if (!impeller_context_holder.Initialize(
381 settings.enable_vulkan_validation)) {
382 return EXIT_FAILURE;
383 }
384 }
385#endif // ALLOW_IMPELLER
386
387 Shell::CreateCallback<PlatformView> on_create_platform_view =
388 fml::MakeCopyable([impeller_context_holder = std::move(
389 impeller_context_holder)](Shell& shell) mutable {
390 return std::make_unique<TesterPlatformView>(
391 shell, shell.GetTaskRunners(), std::move(impeller_context_holder));
392 });
393
394 Shell::CreateCallback<Rasterizer> on_create_rasterizer = [](Shell& shell) {
395 return std::make_unique<Rasterizer>(
396 shell, Rasterizer::MakeGpuImageBehavior::kBitmap);
397 };
398
400 task_runners, //
401 settings, //
402 on_create_platform_view, //
403 on_create_rasterizer //
404 )
405 .release());
406 auto shell = g_shell->get();
407
408 if (!shell || !shell->IsSetup()) {
409 FML_LOG(ERROR) << "Could not set up the shell.";
410 return EXIT_FAILURE;
411 }
412
413 if (settings.application_kernel_asset.empty()) {
414 FML_LOG(ERROR) << "Dart kernel file not specified.";
415 return EXIT_FAILURE;
416 }
417
418 shell->GetPlatformView()->NotifyCreated();
419
420 // Initialize default testing locales. There is no platform to
421 // pass locales on the tester, so to retain expected locale behavior,
422 // we emulate it in here by passing in 'en_US' and 'zh_CN' as test locales.
423 const char* locale_json =
424 "{\"method\":\"setLocale\",\"args\":[\"en\",\"US\",\"\",\"\",\"zh\","
425 "\"CN\",\"\",\"\"]}";
426 auto locale_bytes = fml::MallocMapping::Copy(
427 locale_json, locale_json + std::strlen(locale_json));
429 shell->GetPlatformView()->DispatchPlatformMessage(
430 std::make_unique<flutter::PlatformMessage>(
431 "flutter/localization", std::move(locale_bytes), response));
432
433 std::initializer_list<fml::FileMapping::Protection> protection = {
435 auto main_dart_file_mapping = std::make_unique<fml::FileMapping>(
437 fml::paths::AbsolutePath(settings.application_kernel_asset).c_str(),
439 protection);
440
441 auto isolate_configuration =
442 IsolateConfiguration::CreateForKernel(std::move(main_dart_file_mapping));
443
444 if (!isolate_configuration) {
445 FML_LOG(ERROR) << "Could create isolate configuration.";
446 return EXIT_FAILURE;
447 }
448
449 auto asset_manager = std::make_shared<flutter::AssetManager>();
450 asset_manager->PushBack(std::make_unique<flutter::DirectoryAssetBundle>(
451 fml::Duplicate(settings.assets_dir), true));
452 asset_manager->PushBack(std::make_unique<flutter::DirectoryAssetBundle>(
453 fml::OpenDirectory(settings.assets_path.c_str(), false,
455 true));
456
457 RunConfiguration run_configuration(std::move(isolate_configuration),
458 std::move(asset_manager));
459
460 // The script completion task observer that will be installed on the UI thread
461 // that watched if the engine has any live ports.
462 ScriptCompletionTaskObserver completion_observer(
463 *shell, // a valid shell
465 .GetTaskRunner(), // the message loop to terminate
466 run_forever // should the exit be ignored
467 );
468
469 bool engine_did_run = false;
470
472 auto task_observer_add = [&completion_observer]() {
474 reinterpret_cast<intptr_t>(&completion_observer),
475 [&completion_observer]() { completion_observer.DidProcessTask(); });
476 };
477
478 auto task_observer_remove = [&completion_observer, &latch]() {
480 reinterpret_cast<intptr_t>(&completion_observer));
481 latch.Signal();
482 };
483
484 shell->RunEngine(std::move(run_configuration),
485 [&engine_did_run, &ui_task_runner,
486 &task_observer_add](Engine::RunStatus run_status) mutable {
487 if (run_status != flutter::Engine::RunStatus::Failure) {
488 engine_did_run = true;
489 // Now that our engine is initialized we can install the
490 // ScriptCompletionTaskObserver
492 task_observer_add);
493 }
494 });
495
497
498 // Run the message loop and wait for the script to do its thing.
500
501 // Cleanup the completion observer synchronously as it is living on the
502 // stack.
503 fml::TaskRunner::RunNowOrPostTask(ui_task_runner, task_observer_remove);
504 latch.Wait();
505
506 delete g_shell->release();
507
508 if (!engine_did_run) {
509 // If the engine itself didn't have a chance to run, there is no point in
510 // asking it if there was an error. Signal a failure unconditionally.
511 return EXIT_FAILURE;
512 }
513
514 return completion_observer.GetExitCodeForLastError();
515}
void RemoveTaskObserver(intptr_t key)
Definition: message_loop.cc:68
void AddTaskObserver(intptr_t key, const fml::closure &callback)
Definition: message_loop.cc:64
static void UnblockSIGPROF()
Definition: tester_main.cc:325
static void ConfigureShell(Shell *shell)
Definition: tester_main.cc:131
static absl::NoDestructor< std::unique_ptr< Shell > > g_shell
Definition: tester_main.cc:127
std::string AbsolutePath(const std::string &path)
Definition: paths_posix.cc:29
fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor)
Definition: file_posix.cc:123
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
Definition: file_posix.cc:97

◆ RuntimeStageBackendToString()

static std::string flutter::RuntimeStageBackendToString ( impeller::RuntimeStageBackend  backend)
static

Definition at line 25 of file fragment_program.cc.

26 {
27 switch (backend) {
29 return "SkSL";
31 return "Metal";
33 return "OpenGLES";
35 return "Vulkan";
36 }
37}
const char * backend

◆ safe_intersection_test()

static bool flutter::safe_intersection_test ( const SkRect rect1,
const SkRect rect2 
)
static

Definition at line 122 of file container_layer.cc.

122 {
123 if (rect1->isEmpty() || rect2.isEmpty()) {
124 return false;
125 }
126 return rect1->intersects(rect2);
127}
bool intersects(const SkRect &r) const
Definition: SkRect.h:1121
bool isEmpty() const
Definition: SkRect.h:693

◆ SafeNarrow()

static float flutter::SafeNarrow ( double  value)
static

Converts a double to a float, truncating finite values that are larger than FLT_MAX or smaller than FLT_MIN to those values.

Definition at line 15 of file floating_point.h.

15 {
16 if (std::isinf(value) || std::isnan(value)) {
17 return static_cast<float>(value);
18 } else {
19 // Avoid truncation to inf/-inf.
20 return std::clamp(static_cast<float>(value),
21 std::numeric_limits<float>::lowest(),
23 }
24}
static unsigned clamp(SkFixed fx, int max)
static float max(float r, float g, float b)
Definition: hsl.cpp:49

◆ ScheduleFrame()

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

Definition at line 525 of file platform_view_android_jni_impl.cc.

525 {
526 ANDROID_SHELL_HOLDER->GetPlatformView()->ScheduleFrame();
527}

◆ ScreenshotLayerTreeAsPicture()

static sk_sp< SkData > flutter::ScreenshotLayerTreeAsPicture ( flutter::LayerTree tree,
flutter::CompositorContext compositor_context 
)
static

Definition at line 823 of file rasterizer.cc.

825 {
826#if SLIMPELLER
827 return nullptr;
828#else // SLIMPELLER
829 FML_DCHECK(tree != nullptr);
830 SkPictureRecorder recorder;
831 recorder.beginRecording(
832 SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height()));
833
834 SkMatrix root_surface_transformation;
835 root_surface_transformation.reset();
836 DlSkCanvasAdapter canvas(recorder.getRecordingCanvas());
837
838 // TODO(amirh): figure out how to take a screenshot with embedded UIView.
839 // https://github.com/flutter/flutter/issues/23435
840 auto frame = compositor_context.AcquireFrame(nullptr, &canvas, nullptr,
841 root_surface_transformation,
842 false, true, nullptr, nullptr);
843 frame->Raster(*tree, true, nullptr);
844
845#if defined(OS_FUCHSIA)
846 SkSerialProcs procs = {0};
849#else
850 SkSerialProcs procs = {0};
852 procs.fImageProc = [](SkImage* img, void*) -> sk_sp<SkData> {
853 return SkPngEncoder::Encode(nullptr, img, SkPngEncoder::Options{});
854 };
855#endif
856
857 return recorder.finishRecordingAsPicture()->serialize(&procs);
858#endif // SLIMPELLER
859}
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
SkCanvas * getRecordingCanvas()
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkData > serialize(const SkSerialProcs *procs=nullptr) const
Definition: SkPicture.cpp:249
Backend implementation of |DlCanvas| for |SkCanvas|.
Definition: dl_sk_canvas.h:20
const SkISize & frame_size() const
Definition: layer_tree.h:54
sk_sp< SkData > SerializeTypefaceWithData(SkTypeface *typeface, void *ctx)
sk_sp< SkData > SerializeTypefaceWithoutData(SkTypeface *typeface, void *ctx)
sk_sp< SkData > SerializeImageWithoutData(SkImage *image, void *ctx)
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609
SkSerialImageProc fImageProc
Definition: SkSerialProcs.h:90
SkSerialTypefaceProc fTypefaceProc
Definition: SkSerialProcs.h:93

◆ SearchMapping()

static std::shared_ptr< const fml::Mapping > flutter::SearchMapping ( const 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

Definition at line 53 of file dart_snapshot.cc.

58 {
59 // Ask the embedder. There is no fallback as we expect the embedders (via
60 // their embedding APIs) to just specify the mappings directly.
61 if (embedder_mapping_callback) {
62 // Note that mapping will be nullptr if the mapping callback returns an
63 // invalid mapping. If all the other methods for resolving the data also
64 // fail, the engine will stop with accompanying error logs.
65 if (auto mapping = embedder_mapping_callback()) {
66 return mapping;
67 }
68 }
69
70 // Attempt to open file at path specified.
71 if (!file_path.empty()) {
72 if (auto file_mapping = GetFileMapping(file_path, is_executable)) {
73 return file_mapping;
74 }
75 }
76
77 // Look in application specified native library if specified.
78 for (const std::string& path : native_library_path) {
79 auto native_library = fml::NativeLibrary::Create(path.c_str());
80 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>(
81 native_library, native_library_symbol_name);
82 if (symbol_mapping->GetMapping() != nullptr) {
83 return symbol_mapping;
84 }
85 }
86
87 // Look inside the currently loaded process.
88 {
89 auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess();
90 auto symbol_mapping = std::make_unique<const fml::SymbolMapping>(
91 loaded_process, native_library_symbol_name);
92 if (symbol_mapping->GetMapping() != nullptr) {
93 return symbol_mapping;
94 }
95 }
96
97 return nullptr;
98}
static std::unique_ptr< const fml::Mapping > GetFileMapping(const std::string &path, bool executable)

◆ SerializeImageWithoutData()

sk_sp< SkData > flutter::SerializeImageWithoutData ( SkImage image,
void *  ctx 
)

Definition at line 36 of file serialization_callbacks.cc.

36 {
37 const auto& info = image->imageInfo();
39
40 ImageMetaData metadata = {info.width(), info.height(),
41 static_cast<uint32_t>(info.colorType()),
42 static_cast<uint32_t>(info.alphaType()),
43 static_cast<bool>(info.colorSpace())};
44 stream.write(&metadata, sizeof(ImageMetaData));
45
46 if (info.colorSpace()) {
47 auto color_space_data = info.colorSpace()->serialize();
48 FML_CHECK(color_space_data);
49 SkMemoryStream color_space_stream(color_space_data);
50 stream.writeStream(&color_space_stream, color_space_data->size());
51 }
52
53 return stream.detachAsData();
54};

◆ SerializeLayerSnapshot()

static rapidjson::Value flutter::SerializeLayerSnapshot ( double  device_pixel_ratio,
const LayerSnapshotData snapshot,
rapidjson::Document *  response 
)
static

Definition at line 2001 of file shell.cc.

2004 {
2005 auto& allocator = response->GetAllocator();
2006 rapidjson::Value result;
2007 result.SetObject();
2008 result.AddMember("layer_unique_id", snapshot.GetLayerUniqueId(), allocator);
2009 result.AddMember("duration_micros", snapshot.GetDuration().ToMicroseconds(),
2010 allocator);
2011
2012 const SkRect bounds = snapshot.GetBounds();
2013 result.AddMember("top", bounds.top(), allocator);
2014 result.AddMember("left", bounds.left(), allocator);
2015 result.AddMember("width", bounds.width(), allocator);
2016 result.AddMember("height", bounds.height(), allocator);
2017
2018 sk_sp<SkData> snapshot_bytes = snapshot.GetSnapshot();
2019 if (snapshot_bytes) {
2020 rapidjson::Value image;
2021 image.SetArray();
2022 const uint8_t* data =
2023 reinterpret_cast<const uint8_t*>(snapshot_bytes->data());
2024 for (size_t i = 0; i < snapshot_bytes->size(); i++) {
2025 image.PushBack(data[i], allocator);
2026 }
2027 result.AddMember("snapshot", image, allocator);
2028 }
2029 return result;
2030}
const void * data() const
Definition: SkData.h:37
sk_sp< SkData > GetSnapshot() const
fml::TimeDelta GetDuration() const
constexpr int64_t ToMicroseconds() const
Definition: time_delta.h:62
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ SerializeTypefaceWithData()

sk_sp< SkData > flutter::SerializeTypefaceWithData ( SkTypeface typeface,
void *  ctx 
)

Definition at line 18 of file serialization_callbacks.cc.

18 {
20}
void serialize(SkWStream *, SerializeBehavior=SerializeBehavior::kIncludeDataIfLocal) const
Definition: SkTypeface.cpp:202

◆ SerializeTypefaceWithoutData()

sk_sp< SkData > flutter::SerializeTypefaceWithoutData ( SkTypeface typeface,
void *  ctx 
)

Definition at line 14 of file serialization_callbacks.cc.

14 {
15 return SkData::MakeEmpty();
16}
static sk_sp< SkData > MakeEmpty()
Definition: SkData.cpp:94

◆ ServiceProtocolFailureError()

static void flutter::ServiceProtocolFailureError ( rapidjson::Document *  response,
std::string  message 
)
static

Definition at line 1716 of file shell.cc.

1717 {
1718 auto& allocator = response->GetAllocator();
1719 response->SetObject();
1720 const int64_t kJsonServerError = -32000;
1721 response->AddMember("code", kJsonServerError, allocator);
1722 response->AddMember("message", std::move(message), allocator);
1723}

◆ ServiceProtocolParameterError()

static void flutter::ServiceProtocolParameterError ( rapidjson::Document *  response,
std::string  error_details 
)
static

Definition at line 1702 of file shell.cc.

1703 {
1704 auto& allocator = response->GetAllocator();
1705 response->SetObject();
1706 const int64_t kInvalidParams = -32602;
1707 response->AddMember("code", kInvalidParams, allocator);
1708 response->AddMember("message", "Invalid params", allocator);
1709 {
1710 rapidjson::Value details(rapidjson::kObjectType);
1711 details.AddMember("details", std::move(error_details), allocator);
1712 response->AddMember("data", details, allocator);
1713 }
1714}
@ kInvalidParams
Definition: json_stream.h:48

◆ ServiceStreamCancelCallback()

static void flutter::ServiceStreamCancelCallback ( const char *  stream_id)
static

Definition at line 197 of file dart_vm.cc.

197 {
198 if (strcmp(stream_id, kStdoutStreamId) == 0) {
200 } else if (strcmp(stream_id, kStderrStreamId) == 0) {
202 }
203}
void SetCaptureStdout(bool value)
Definition: file_support.cc:25
void SetCaptureStderr(bool value)
Definition: file_support.cc:29
static const char kStderrStreamId[]
Definition: dart_vm.cc:184
static const char kStdoutStreamId[]
Definition: dart_vm.cc:183

◆ ServiceStreamListenCallback()

static bool flutter::ServiceStreamListenCallback ( const char *  stream_id)
static

Definition at line 186 of file dart_vm.cc.

186 {
187 if (strcmp(stream_id, kStdoutStreamId) == 0) {
189 return true;
190 } else if (strcmp(stream_id, kStderrStreamId) == 0) {
192 return true;
193 }
194 return false;
195}

◆ SetAccessibilityFeatures()

static void flutter::SetAccessibilityFeatures ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jint  flags 
)
static

Definition at line 476 of file platform_view_android_jni_impl.cc.

479 {
480 ANDROID_SHELL_HOLDER->GetPlatformView()->SetAccessibilityFeatures(flags);
481}

◆ SetFontFile()

void flutter::SetFontFile ( const std::string &  file)

Definition at line 24 of file flow_test_utils.cc.

◆ SetGoldenDir()

void flutter::SetGoldenDir ( const std::string &  dir)

Definition at line 16 of file flow_test_utils.cc.

16 {
18}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
Definition: switches.h:145

◆ SetSemanticsEnabled()

static void flutter::SetSemanticsEnabled ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jboolean  enabled 
)
static

Definition at line 469 of file platform_view_android_jni_impl.cc.

472 {
473 ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled);
474}

◆ SettingsFromCommandLine()

Settings flutter::SettingsFromCommandLine ( const fml::CommandLine command_line)

Definition at line 228 of file switches.cc.

228 {
229 Settings settings = {};
230
231 // Set executable name.
232 if (command_line.has_argv0()) {
233 settings.executable_name = command_line.argv0();
234 }
235
236 // Enable the VM Service
237 settings.enable_vm_service =
238 !command_line.HasOption(FlagForSwitch(Switch::DisableVMService)) &&
239 // TODO(bkonyi): remove once flutter_tools no longer uses this option.
240 // See https://github.com/dart-lang/sdk/issues/50233
241 !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory));
242
243 // Enable mDNS VM Service Publication
244 settings.enable_vm_service_publication =
245 !command_line.HasOption(
246 FlagForSwitch(Switch::DisableVMServicePublication)) &&
247 !command_line.HasOption(
248 FlagForSwitch(Switch::DisableObservatoryPublication));
249
250 // Set VM Service Host
251 if (command_line.HasOption(FlagForSwitch(Switch::DeviceVMServiceHost))) {
252 command_line.GetOptionValue(FlagForSwitch(Switch::DeviceVMServiceHost),
253 &settings.vm_service_host);
254 } else if (command_line.HasOption(
255 FlagForSwitch(Switch::DeviceObservatoryHost))) {
256 // TODO(bkonyi): remove once flutter_tools no longer uses this option.
257 // See https://github.com/dart-lang/sdk/issues/50233
258 command_line.GetOptionValue(FlagForSwitch(Switch::DeviceObservatoryHost),
259 &settings.vm_service_host);
260 }
261 // Default the VM Service port based on --ipv6 if not set.
262 if (settings.vm_service_host.empty()) {
263 settings.vm_service_host =
264 command_line.HasOption(FlagForSwitch(Switch::IPv6)) ? "::1"
265 : "127.0.0.1";
266 }
267
268 // Set VM Service Port
269 if (command_line.HasOption(FlagForSwitch(Switch::DeviceVMServicePort))) {
270 if (!GetSwitchValue(command_line, Switch::DeviceVMServicePort,
271 &settings.vm_service_port)) {
272 FML_LOG(INFO)
273 << "VM Service port specified was malformed. Will default to "
274 << settings.vm_service_port;
275 }
276 } else if (command_line.HasOption(
277 FlagForSwitch(Switch::DeviceObservatoryPort))) {
278 // TODO(bkonyi): remove once flutter_tools no longer uses this option.
279 // See https://github.com/dart-lang/sdk/issues/50233
280 if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort,
281 &settings.vm_service_port)) {
282 FML_LOG(INFO)
283 << "VM Service port specified was malformed. Will default to "
284 << settings.vm_service_port;
285 }
286 }
287
288 settings.may_insecurely_connect_to_all_domains = !command_line.HasOption(
289 FlagForSwitch(Switch::DisallowInsecureConnections));
290
291 command_line.GetOptionValue(FlagForSwitch(Switch::DomainNetworkPolicy),
292 &settings.domain_network_policy);
293
294 // Disable need for authentication codes for VM service communication, if
295 // specified.
296 settings.disable_service_auth_codes =
297 command_line.HasOption(FlagForSwitch(Switch::DisableServiceAuthCodes));
298
299 // Allow fallback to automatic port selection if binding to a specified port
300 // fails.
301 settings.enable_service_port_fallback =
302 command_line.HasOption(FlagForSwitch(Switch::EnableServicePortFallback));
303
304 // Checked mode overrides.
305 settings.disable_dart_asserts =
306 command_line.HasOption(FlagForSwitch(Switch::DisableDartAsserts));
307
308 settings.start_paused =
309 command_line.HasOption(FlagForSwitch(Switch::StartPaused));
310
311 settings.enable_checked_mode =
312 command_line.HasOption(FlagForSwitch(Switch::EnableCheckedMode));
313
314 settings.enable_dart_profiling =
315 command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling));
316
317 settings.enable_software_rendering =
318 command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering));
319
320 settings.endless_trace_buffer =
321 command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer));
322
323 settings.trace_startup =
324 command_line.HasOption(FlagForSwitch(Switch::TraceStartup));
325
326 settings.enable_serial_gc =
327 command_line.HasOption(FlagForSwitch(Switch::EnableSerialGC));
328
329#if !FLUTTER_RELEASE
330 settings.trace_skia = true;
331
332 if (command_line.HasOption(FlagForSwitch(Switch::TraceSkia))) {
333 // If --trace-skia is specified, then log all Skia events.
334 settings.trace_skia_allowlist.reset();
335 } else {
336 std::string trace_skia_allowlist;
337 command_line.GetOptionValue(FlagForSwitch(Switch::TraceSkiaAllowlist),
338 &trace_skia_allowlist);
339 if (trace_skia_allowlist.size()) {
340 settings.trace_skia_allowlist = ParseCommaDelimited(trace_skia_allowlist);
341 } else {
342 settings.trace_skia_allowlist = {"skia.shaders"};
343 }
344 }
345#endif // !FLUTTER_RELEASE
346
347 std::string trace_allowlist;
348 command_line.GetOptionValue(FlagForSwitch(Switch::TraceAllowlist),
349 &trace_allowlist);
350 settings.trace_allowlist = ParseCommaDelimited(trace_allowlist);
351
352 settings.trace_systrace =
353 command_line.HasOption(FlagForSwitch(Switch::TraceSystrace));
354
355 command_line.GetOptionValue(FlagForSwitch(Switch::TraceToFile),
356 &settings.trace_to_file);
357
358 settings.skia_deterministic_rendering_on_cpu =
359 command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering));
360
361 settings.verbose_logging =
362 command_line.HasOption(FlagForSwitch(Switch::VerboseLogging));
363
364 command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir),
365 &settings.assets_path);
366
367 std::vector<std::string_view> aot_shared_library_name =
368 command_line.GetOptionValues(FlagForSwitch(Switch::AotSharedLibraryName));
369
370 std::vector<std::string_view> vmservice_shared_library_name =
371 command_line.GetOptionValues(
372 FlagForSwitch(Switch::AotVMServiceSharedLibraryName));
373 for (auto path : vmservice_shared_library_name) {
374 settings.vmservice_snapshot_library_path.emplace_back(path);
375 }
376
377 std::string snapshot_asset_path;
378 command_line.GetOptionValue(FlagForSwitch(Switch::SnapshotAssetPath),
379 &snapshot_asset_path);
380
381 std::string vm_snapshot_data_filename;
382 command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotData),
383 &vm_snapshot_data_filename);
384
385 command_line.GetOptionValue(FlagForSwitch(Switch::Route), &settings.route);
386
387 std::string vm_snapshot_instr_filename;
388 command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotInstructions),
389 &vm_snapshot_instr_filename);
390
391 std::string isolate_snapshot_data_filename;
392 command_line.GetOptionValue(FlagForSwitch(Switch::IsolateSnapshotData),
393 &isolate_snapshot_data_filename);
394
395 std::string isolate_snapshot_instr_filename;
396 command_line.GetOptionValue(
397 FlagForSwitch(Switch::IsolateSnapshotInstructions),
398 &isolate_snapshot_instr_filename);
399
400 if (!aot_shared_library_name.empty()) {
401 for (std::string_view name : aot_shared_library_name) {
402 settings.application_library_path.emplace_back(name);
403 }
404 } else if (!snapshot_asset_path.empty()) {
405 settings.vm_snapshot_data_path =
406 fml::paths::JoinPaths({snapshot_asset_path, vm_snapshot_data_filename});
407 settings.vm_snapshot_instr_path = fml::paths::JoinPaths(
408 {snapshot_asset_path, vm_snapshot_instr_filename});
409 settings.isolate_snapshot_data_path = fml::paths::JoinPaths(
410 {snapshot_asset_path, isolate_snapshot_data_filename});
411 settings.isolate_snapshot_instr_path = fml::paths::JoinPaths(
412 {snapshot_asset_path, isolate_snapshot_instr_filename});
413 }
414
415 command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath),
416 &settings.temp_directory_path);
417
418 bool leak_vm = "true" == command_line.GetOptionValueWithDefault(
419 FlagForSwitch(Switch::LeakVM), "true");
420 settings.leak_vm = leak_vm;
421
422 if (settings.icu_initialization_required) {
423 command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath),
424 &settings.icu_data_path);
425 if (command_line.HasOption(FlagForSwitch(Switch::ICUSymbolPrefix))) {
426 std::string icu_symbol_prefix, native_lib_path;
427 command_line.GetOptionValue(FlagForSwitch(Switch::ICUSymbolPrefix),
428 &icu_symbol_prefix);
429 command_line.GetOptionValue(FlagForSwitch(Switch::ICUNativeLibPath),
430 &native_lib_path);
431
432#if FML_OS_ANDROID
433 settings.icu_mapper = GetICUStaticMapping;
434#else
435 settings.icu_mapper = [icu_symbol_prefix, native_lib_path] {
436 return GetSymbolMapping(icu_symbol_prefix, native_lib_path);
437 };
438#endif
439 }
440 }
441
442 settings.use_test_fonts =
443 command_line.HasOption(FlagForSwitch(Switch::UseTestFonts));
444 settings.use_asset_fonts =
445 !command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts));
446
447 {
448 std::string enable_impeller_value;
449 if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableImpeller),
450 &enable_impeller_value)) {
451 settings.enable_impeller =
452 enable_impeller_value.empty() || "true" == enable_impeller_value;
453 }
454 }
455
456 {
457 std::string impeller_backend_value;
458 if (command_line.GetOptionValue(FlagForSwitch(Switch::ImpellerBackend),
459 &impeller_backend_value)) {
460 if (!impeller_backend_value.empty()) {
461 settings.requested_rendering_backend = impeller_backend_value;
462 }
463 }
464 }
465
466 settings.enable_vulkan_validation =
467 command_line.HasOption(FlagForSwitch(Switch::EnableVulkanValidation));
468 settings.enable_opengl_gpu_tracing =
469 command_line.HasOption(FlagForSwitch(Switch::EnableOpenGLGPUTracing));
470 settings.enable_vulkan_gpu_tracing =
471 command_line.HasOption(FlagForSwitch(Switch::EnableVulkanGPUTracing));
472
473 settings.enable_embedder_api =
474 command_line.HasOption(FlagForSwitch(Switch::EnableEmbedderAPI));
475
476 settings.prefetched_default_font_manager = command_line.HasOption(
477 FlagForSwitch(Switch::PrefetchedDefaultFontManager));
478
479 std::string all_dart_flags;
480 if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags),
481 &all_dart_flags)) {
482 // Assume that individual flags are comma separated.
483 std::vector<std::string> flags = ParseCommaDelimited(all_dart_flags);
484 for (const auto& flag : flags) {
486 FML_LOG(FATAL) << "Encountered disallowed Dart VM flag: " << flag;
487 }
488 settings.dart_flags.push_back(flag);
489 }
490 }
491
492#if !FLUTTER_RELEASE
493 command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag);
494#endif
495
496 settings.dump_skp_on_shader_compilation =
497 command_line.HasOption(FlagForSwitch(Switch::DumpSkpOnShaderCompilation));
498
499 settings.cache_sksl =
500 command_line.HasOption(FlagForSwitch(Switch::CacheSkSL));
501
502 settings.purge_persistent_cache =
503 command_line.HasOption(FlagForSwitch(Switch::PurgePersistentCache));
504
505 if (command_line.HasOption(FlagForSwitch(Switch::OldGenHeapSize))) {
506 std::string old_gen_heap_size;
507 command_line.GetOptionValue(FlagForSwitch(Switch::OldGenHeapSize),
508 &old_gen_heap_size);
509 settings.old_gen_heap_size = std::stoi(old_gen_heap_size);
510 }
511
512 if (command_line.HasOption(
513 FlagForSwitch(Switch::ResourceCacheMaxBytesThreshold))) {
514 std::string resource_cache_max_bytes_threshold;
515 command_line.GetOptionValue(
516 FlagForSwitch(Switch::ResourceCacheMaxBytesThreshold),
517 &resource_cache_max_bytes_threshold);
518 settings.resource_cache_max_bytes_threshold =
519 std::stoi(resource_cache_max_bytes_threshold);
520 }
521
522 settings.enable_platform_isolates =
523 command_line.HasOption(FlagForSwitch(Switch::EnablePlatformIsolates));
524
525 return settings;
526}
const std::string & argv0() const
Definition: command_line.h:94
std::vector< std::string_view > GetOptionValues(std::string_view name) const
Definition: command_line.cc:61
std::string GetOptionValueWithDefault(std::string_view name, std::string_view default_value) const
Definition: command_line.cc:72
bool HasOption(std::string_view name, size_t *index=nullptr) const
Definition: command_line.cc:40
bool has_argv0() const
Definition: command_line.h:93
bool stoi(std::string_view s, SKSL_INT *value)
Definition: SkSLString.cpp:66
static bool IsAllowedDartVMFlag(const std::string &flag)
Definition: switches.cc:163
static bool GetSwitchValue(const fml::CommandLine &command_line, Switch sw, T *result)
Definition: switches.cc:181
static std::vector< std::string > ParseCommaDelimited(const std::string &input)
Definition: switches.cc:153
std::unique_ptr< fml::Mapping > GetSymbolMapping(const std::string &symbol_prefix, const std::string &native_lib_path)
Definition: switches.cc:200
std::string JoinPaths(std::initializer_list< std::string > components)
Definition: paths.cc:14

◆ SetViewportMetrics()

static void flutter::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,
jint  physicalTouchSlop,
jintArray  javaDisplayFeaturesBounds,
jintArray  javaDisplayFeaturesType,
jintArray  javaDisplayFeaturesState 
)
static

Definition at line 300 of file platform_view_android_jni_impl.cc.

321 {
322 // Convert java->c++. javaDisplayFeaturesBounds, javaDisplayFeaturesType and
323 // javaDisplayFeaturesState cannot be null
324 jsize rectSize = env->GetArrayLength(javaDisplayFeaturesBounds);
325 std::vector<int> boundsIntVector(rectSize);
326 env->GetIntArrayRegion(javaDisplayFeaturesBounds, 0, rectSize,
327 &boundsIntVector[0]);
328 std::vector<double> displayFeaturesBounds(boundsIntVector.begin(),
329 boundsIntVector.end());
330 jsize typeSize = env->GetArrayLength(javaDisplayFeaturesType);
331 std::vector<int> displayFeaturesType(typeSize);
332 env->GetIntArrayRegion(javaDisplayFeaturesType, 0, typeSize,
333 &displayFeaturesType[0]);
334
335 jsize stateSize = env->GetArrayLength(javaDisplayFeaturesState);
336 std::vector<int> displayFeaturesState(stateSize);
337 env->GetIntArrayRegion(javaDisplayFeaturesState, 0, stateSize,
338 &displayFeaturesState[0]);
339
340 const flutter::ViewportMetrics metrics{
341 static_cast<double>(devicePixelRatio),
342 static_cast<double>(physicalWidth),
343 static_cast<double>(physicalHeight),
344 static_cast<double>(physicalPaddingTop),
345 static_cast<double>(physicalPaddingRight),
346 static_cast<double>(physicalPaddingBottom),
347 static_cast<double>(physicalPaddingLeft),
348 static_cast<double>(physicalViewInsetTop),
349 static_cast<double>(physicalViewInsetRight),
350 static_cast<double>(physicalViewInsetBottom),
351 static_cast<double>(physicalViewInsetLeft),
352 static_cast<double>(systemGestureInsetTop),
353 static_cast<double>(systemGestureInsetRight),
354 static_cast<double>(systemGestureInsetBottom),
355 static_cast<double>(systemGestureInsetLeft),
356 static_cast<double>(physicalTouchSlop),
357 displayFeaturesBounds,
358 displayFeaturesType,
359 displayFeaturesState,
360 0, // Display ID
361 };
362
363 ANDROID_SHELL_HOLDER->GetPlatformView()->SetViewportMetrics(
364 kFlutterImplicitViewId, metrics);
365}
static constexpr FlutterViewId kFlutterImplicitViewId
Definition: embedder.cc:108

◆ ShouldUseMetalRenderer()

bool flutter::ShouldUseMetalRenderer ( )

Definition at line 22 of file rendering_api_selection.mm.

22 {
23 bool ios_version_supports_metal = false;
24 if (@available(iOS METAL_IOS_VERSION_BASELINE, *)) {
25 id<MTLDevice> device = MTLCreateSystemDefaultDevice();
26 ios_version_supports_metal = [device supportsFeatureSet:MTLFeatureSet_iOS_GPUFamily1_v3];
27 }
28 return ios_version_supports_metal;
29}
VkDevice device
Definition: main.cc:53

◆ Spawn()

EXPORTED void flutter::Spawn ( const char *  entrypoint,
const char *  route 
)

Definition at line 544 of file tester_main.cc.

544 {
545 auto shell = g_shell->get();
546 auto isolate = Dart_CurrentIsolate();
547 auto spawn_task = [shell, entrypoint = std::string(entrypoint),
548 route = std::string(route)]() {
549 auto configuration = RunConfiguration::InferFromSettings(
550 shell->GetSettings(), /*io_worker=*/nullptr,
551 /*launch_type=*/IsolateLaunchType::kExistingGroup);
552 configuration.SetEntrypoint(entrypoint);
553
554 Shell::CreateCallback<PlatformView> on_create_platform_view =
555 fml::MakeCopyable([](Shell& shell) mutable {
556 ImpellerVulkanContextHolder impeller_context_holder;
557 return std::make_unique<TesterPlatformView>(
558 shell, shell.GetTaskRunners(),
559 std::move(impeller_context_holder));
560 });
561
562 Shell::CreateCallback<Rasterizer> on_create_rasterizer = [](Shell& shell) {
563 return std::make_unique<Rasterizer>(
564 shell, Rasterizer::MakeGpuImageBehavior::kBitmap);
565 };
566
567 // Spawn a shell, and keep it running until it has no live ports, then
568 // delete it on the platform thread.
569 auto spawned_shell =
570 shell
571 ->Spawn(std::move(configuration), route, on_create_platform_view,
572 on_create_rasterizer)
573 .release();
574
575 ConfigureShell(spawned_shell);
576
578 spawned_shell->GetTaskRunners().GetUITaskRunner(), [spawned_shell]() {
579 fml::MessageLoop::GetCurrent().AddTaskObserver(
580 reinterpret_cast<intptr_t>(spawned_shell), [spawned_shell]() {
581 if (spawned_shell->EngineHasLivePorts()) {
582 return;
583 }
584
585 fml::MessageLoop::GetCurrent().RemoveTaskObserver(
586 reinterpret_cast<intptr_t>(spawned_shell));
587 // Shell must be deleted on the platform task runner.
588 fml::TaskRunner::RunNowOrPostTask(
589 spawned_shell->GetTaskRunners().GetPlatformTaskRunner(),
590 [spawned_shell]() { delete spawned_shell; });
591 });
592 });
593 };
595 // The global shell pointer is never deleted, short of application exit.
596 // This UI task runner cannot be latched because it will block spawning a new
597 // shell in the case where flutter_tester is running multithreaded.
599 shell->GetTaskRunners().GetPlatformTaskRunner(), spawn_task);
600
601 Dart_EnterIsolate(isolate);
602}
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
Definition: shell.h:120
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate)
DART_EXPORT void Dart_ExitIsolate(void)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however route
Definition: switches.h:137

◆ SpawnJNI()

static jobject flutter::SpawnJNI ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jstring  jEntrypoint,
jstring  jLibraryUrl,
jstring  jInitialRoute,
jobject  jEntrypointArgs 
)
static

Definition at line 185 of file platform_view_android_jni_impl.cc.

191 {
192 jobject jni = env->NewObject(g_flutter_jni_class->obj(), g_jni_constructor);
193 if (jni == nullptr) {
194 FML_LOG(ERROR) << "Could not create a FlutterJNI instance";
195 return nullptr;
196 }
197
199 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
200 std::make_shared<PlatformViewAndroidJNIImpl>(java_jni);
201
202 auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint);
203 auto libraryUrl = fml::jni::JavaStringToString(env, jLibraryUrl);
204 auto initial_route = fml::jni::JavaStringToString(env, jInitialRoute);
205 auto entrypoint_args = fml::jni::StringListToVector(env, jEntrypointArgs);
206
207 auto spawned_shell_holder = ANDROID_SHELL_HOLDER->Spawn(
208 jni_facade, entrypoint, libraryUrl, initial_route, entrypoint_args);
209
210 if (spawned_shell_holder == nullptr || !spawned_shell_holder->IsValid()) {
211 FML_LOG(ERROR) << "Could not spawn Shell";
212 return nullptr;
213 }
214
215 jobject javaLong = env->CallStaticObjectMethod(
217 reinterpret_cast<jlong>(spawned_shell_holder.release()));
218 if (javaLong == nullptr) {
219 FML_LOG(ERROR) << "Could not create a Long instance";
220 return nullptr;
221 }
222
223 env->SetObjectField(jni, g_jni_shell_holder_field, javaLong);
224
225 return jni;
226}

◆ StartTestSuite()

static void flutter::StartTestSuite ( const impeller::android::NativeWindow window)
static

Definition at line 18 of file gtest_activity.cc.

18 {
19 auto timeout_listener = new flutter::testing::TestTimeoutListener(
21 auto logger_listener = new flutter::testing::LoggerListener();
22
23 auto& listeners = ::testing::UnitTest::GetInstance()->listeners();
24
25 listeners.Append(timeout_listener);
26 listeners.Append(logger_listener);
27
28 int result = RUN_ALL_TESTS();
29
30 delete listeners.Release(timeout_listener);
31 delete listeners.Release(logger_listener);
32
33 FML_CHECK(result == 0);
34}

◆ StartupAndShutdownShell()

static void flutter::StartupAndShutdownShell ( benchmark::State &  state,
bool  measure_startup,
bool  measure_shutdown 
)
static

Definition at line 16 of file shell_benchmarks.cc.

18 {
19 auto assets_dir = fml::OpenDirectory(testing::GetFixturesPath(), false,
21 std::unique_ptr<Shell> shell;
22 std::unique_ptr<ThreadHost> thread_host;
23 testing::ELFAOTSymbols aot_symbols;
24
25 {
26 benchmarking::ScopedPauseTiming pause(state, !measure_startup);
27 Settings settings = {};
28 settings.task_observer_add = [](intptr_t, const fml::closure&) {};
29 settings.task_observer_remove = [](intptr_t) {};
30
31 if (DartVM::IsRunningPrecompiledCode()) {
36 << "Could not set up settings with AOT symbols.";
37 } else {
38 settings.application_kernels = [&]() {
39 std::vector<std::unique_ptr<const fml::Mapping>> kernel_mappings;
40 kernel_mappings.emplace_back(
41 fml::FileMapping::CreateReadOnly(assets_dir, "kernel_blob.bin"));
42 return kernel_mappings;
43 };
44 }
45
46 thread_host = std::make_unique<ThreadHost>(ThreadHost::ThreadHostConfig(
47 "io.flutter.bench.",
48 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
49 ThreadHost::Type::kIo | ThreadHost::Type::kUi));
50
51 TaskRunners task_runners("test",
52 thread_host->platform_thread->GetTaskRunner(),
53 thread_host->raster_thread->GetTaskRunner(),
54 thread_host->ui_thread->GetTaskRunner(),
55 thread_host->io_thread->GetTaskRunner());
56
58 flutter::PlatformData(), task_runners, settings,
59 [](Shell& shell) {
60 return std::make_unique<PlatformView>(shell, shell.GetTaskRunners());
61 },
62 [](Shell& shell) { return std::make_unique<Rasterizer>(shell); });
63 }
64
66
67 {
68 // The ui thread could be busy processing tasks after shell created, e.g.,
69 // default font manager setup. The measurement of shell shutdown should be
70 // considered after those ui tasks have been done.
71 //
72 // However, if we're measuring the complete time from startup to shutdown,
73 // this time should still be included.
75 state, !measure_shutdown || !measure_startup);
77 fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
78 [&latch]() { latch.Signal(); });
79 latch.Wait();
80 }
81
82 {
83 benchmarking::ScopedPauseTiming pause(state, !measure_shutdown);
84 // Shutdown must occur synchronously on the platform thread.
87 thread_host->platform_thread->GetTaskRunner(),
88 [&shell, &latch]() mutable {
89 shell.reset();
90 latch.Signal();
91 });
92 latch.Wait();
93 thread_host.reset();
94 }
95
97}
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
ELFAOTSymbols LoadELFSymbolFromFixturesIfNeccessary(std::string elf_filename)
Attempts to resolve AOT symbols from the portable ELF loader. This location is automatically resolved...
Definition: elf_loader.cc:17
bool PrepareSettingsForAOTWithSymbols(Settings &settings, const ELFAOTSymbols &symbols)
Prepare the settings objects various AOT mappings resolvers with the symbols already loaded....
Definition: elf_loader.cc:116
constexpr const char * kDefaultAOTAppELFFileName
Definition: elf_loader.h:17

◆ store_points()

static void flutter::store_points ( char *  dst,
int  offset,
const float *  src,
int  count 
)
static

Definition at line 218 of file dl_vertices.cc.

218 {
219 SkPoint* points = reinterpret_cast<SkPoint*>(dst + offset);
220 for (int i = 0; i < count; i++) {
221 points[i] = SkPoint::Make(src[i * 2], src[i * 2 + 1]);
222 }
223}
SeparatedVector2 offset

◆ StringToAppExitType()

static AppExitType flutter::StringToAppExitType ( const std::string &  string)
static

Definition at line 212 of file platform_handler.cc.

212 {
214 return AppExitType::required;
215 } else if (string.compare(PlatformHandler::kExitTypeCancelable) == 0) {
216 return AppExitType::cancelable;
217 }
218 FML_LOG(ERROR) << string << " is not recognized as a valid exit type.";
219 return AppExitType::required;
220}
static constexpr char kExitTypeCancelable[]
static constexpr char kExitTypeRequired[]
int compare(const void *untyped_lhs, const void *untyped_rhs)
Definition: skdiff.h:161

◆ SurfaceChanged()

static void flutter::SurfaceChanged ( JNIEnv *  env,
jobject  jcaller,
jlong  shell_holder,
jint  width,
jint  height 
)
static

Definition at line 255 of file platform_view_android_jni_impl.cc.

259 {
260 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged(
262}

◆ SurfaceCreated()

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

Definition at line 228 of file platform_view_android_jni_impl.cc.

231 {
232 // Note: This frame ensures that any local references used by
233 // ANativeWindow_fromSurface are released immediately. This is needed as a
234 // workaround for https://code.google.com/p/android/issues/detail?id=68174
235 fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env);
236 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
237 ANativeWindow_fromSurface(env, jsurface));
238 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window));
239}
GLFWwindow * window
Definition: main.cc:45

◆ SurfaceDestroyed()

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

Definition at line 264 of file platform_view_android_jni_impl.cc.

264 {
265 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed();
266}

◆ SurfaceWindowChanged()

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

Definition at line 241 of file platform_view_android_jni_impl.cc.

244 {
245 // Note: This frame ensures that any local references used by
246 // ANativeWindow_fromSurface are released immediately. This is needed as a
247 // workaround for https://code.google.com/p/android/issues/detail?id=68174
248 fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env);
249 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
250 ANativeWindow_fromSurface(env, jsurface));
251 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifySurfaceWindowChanged(
252 std::move(window));
253}

◆ TeardownContext()

static bool flutter::TeardownContext ( EGLDisplay  display,
EGLContext  context 
)
static

Definition at line 55 of file android_context_gl_skia.cc.

55 {
56 if (context != EGL_NO_CONTEXT) {
57 return eglDestroyContext(display, context) == EGL_TRUE;
58 }
59
60 return true;
61}

◆ TemplaterMain()

bool flutter::TemplaterMain ( const fml::CommandLine command_line)

Definition at line 19 of file templater_main.cc.

19 {
20 std::string input_path;
21 std::string output_path;
22
23 if (!command_line.GetOptionValue("templater-input", &input_path)) {
25 << "Input template path not specified. Use --templater-input.";
26 return false;
27 }
28 if (!command_line.GetOptionValue("templater-output", &output_path)) {
30 << "Input template path not specified. Use --templater-output.";
31 return false;
32 }
33
34 auto input = fml::FileMapping::CreateReadOnly(input_path);
35 if (!input) {
36 FML_LOG(ERROR) << "Could not open input file: " << input_path;
37 return false;
38 }
39
40 nlohmann::json arguments;
41 for (const auto& option : command_line.options()) {
42 arguments[option.name] = option.value;
43 }
44 inja::Environment env;
45 auto rendered_template = env.render(
46 std::string_view{reinterpret_cast<const char*>(input->GetMapping()),
47 input->GetSize()},
48 arguments);
50 reinterpret_cast<const uint8_t*>(rendered_template.data()),
51 rendered_template.size()};
52
53 auto current_dir =
54 fml::OpenDirectory(std::filesystem::current_path().u8string().c_str(),
56 if (!current_dir.is_valid()) {
57 FML_LOG(ERROR) << "Could not open current directory.";
58 return false;
59 }
60 if (!fml::WriteAtomically(current_dir, output_path.c_str(), output)) {
61 FML_LOG(ERROR) << "Could not write output to path: " << output_path;
62 return false;
63 }
64 return true;
65}
const std::vector< Option > & options() const
Definition: command_line.h:95

◆ TEST() [1/363]

flutter::TEST ( BasicMessageChannelTest  ,
Registration   
)

Definition at line 58 of file basic_message_channel_unittests.cc.

58 {
59 TestBinaryMessenger messenger;
60 const std::string channel_name("some_channel");
61 const StandardMessageCodec& codec = StandardMessageCodec::GetInstance();
62 BasicMessageChannel channel(&messenger, channel_name, &codec);
63
64 bool callback_called = false;
65 const std::string message_value("hello");
66 channel.SetMessageHandler(
67 [&callback_called, message_value](const auto& message, auto reply) {
68 callback_called = true;
69 // Ensure that the wrapper received a correctly decoded message and a
70 // reply.
71 EXPECT_EQ(std::get<std::string>(message), message_value);
72 EXPECT_NE(reply, nullptr);
73 });
74 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
75 EXPECT_NE(messenger.last_message_handler(), nullptr);
76 // Send a test message to trigger the handler test assertions.
77 auto message = codec.EncodeMessage(EncodableValue(message_value));
78
79 messenger.last_message_handler()(
80 message->data(), message->size(),
81 [](const uint8_t* reply, const size_t reply_size) {});
82 EXPECT_EQ(callback_called, true);
83}

◆ TEST() [2/363]

flutter::TEST ( BasicMessageChannelTest  ,
Resize   
)

Definition at line 103 of file basic_message_channel_unittests.cc.

103 {
104 TestBinaryMessenger messenger;
105 const std::string channel_name("flutter/test");
106 BasicMessageChannel channel(&messenger, channel_name,
108
109 channel.Resize(3);
110
111 // Because the Dart implementation for the control channel implements its own
112 // custom deserialization logic, this test compares the generated bytes array
113 // to the expected one (for instance, the deserialization logic expects the
114 // size parameter of the resize method call to be an uint32).
115 //
116 // The expected content was created from the following Dart code:
117 // MethodCall call = MethodCall('resize', ['flutter/test',3]);
118 // StandardMethodCodec().encodeMethodCall(call).buffer.asUint8List();
119 const int expected_message_size = 29;
120
121 EXPECT_EQ(messenger.send_called(), true);
122 EXPECT_EQ(static_cast<int>(messenger.last_message().size()),
123 expected_message_size);
124
125 int expected[expected_message_size] = {
126 7, 6, 114, 101, 115, 105, 122, 101, 12, 2, 7, 12, 102, 108, 117,
127 116, 116, 101, 114, 47, 116, 101, 115, 116, 3, 3, 0, 0, 0};
128 for (int i = 0; i < expected_message_size; i++) {
129 EXPECT_EQ(messenger.last_message()[i], expected[i]);
130 }
131}
static const StandardMessageCodec & GetInstance(const StandardCodecSerializer *serializer=nullptr)

◆ TEST() [3/363]

flutter::TEST ( BasicMessageChannelTest  ,
SetWarnsOnOverflow   
)

Definition at line 135 of file basic_message_channel_unittests.cc.

135 {
136 TestBinaryMessenger messenger;
137
138 const std::string channel_name("flutter/test");
139 BasicMessageChannel channel(&messenger, channel_name,
141
142 channel.SetWarnsOnOverflow(false);
143
144 // Because the Dart implementation for the control channel implements its own
145 // custom deserialization logic, this test compares the generated bytes array
146 // to the expected one.
147 //
148 // The expected content was created from the following Dart code:
149 // MethodCall call = MethodCall('overflow',['flutter/test', true]);
150 // StandardMethodCodec().encodeMethodCall(call).buffer.asUint8List();
151 const int expected_message_size = 27;
152
153 EXPECT_EQ(messenger.send_called(), true);
154 EXPECT_EQ(static_cast<int>(messenger.last_message().size()),
155 expected_message_size);
156
157 int expected[expected_message_size] = {
158 7, 8, 111, 118, 101, 114, 102, 108, 111, 119, 12, 2, 7, 12,
159 102, 108, 117, 116, 116, 101, 114, 47, 116, 101, 115, 116, 1};
160 for (int i = 0; i < expected_message_size; i++) {
161 EXPECT_EQ(messenger.last_message()[i], expected[i]);
162 }
163}

◆ TEST() [4/363]

flutter::TEST ( BasicMessageChannelTest  ,
Unregistration   
)

Definition at line 86 of file basic_message_channel_unittests.cc.

86 {
87 TestBinaryMessenger messenger;
88 const std::string channel_name("some_channel");
89 BasicMessageChannel channel(&messenger, channel_name,
91
92 channel.SetMessageHandler([](const auto& message, auto reply) {});
93 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
94 EXPECT_NE(messenger.last_message_handler(), nullptr);
95
96 channel.SetMessageHandler(nullptr);
97 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
98 EXPECT_EQ(messenger.last_message_handler(), nullptr);
99}

◆ TEST() [5/363]

flutter::TEST ( DartServiceIsolateTest  ,
CanAddAndRemoveHandles   
)

Definition at line 11 of file dart_service_isolate_unittests.cc.

11 {
12 ASSERT_EQ(DartServiceIsolate::AddServerStatusCallback(nullptr), 0);
13 auto handle = DartServiceIsolate::AddServerStatusCallback([](const auto&) {});
14 ASSERT_NE(handle, 0);
15 ASSERT_TRUE(DartServiceIsolate::RemoveServerStatusCallback(handle));
16}

◆ TEST() [6/363]

flutter::TEST ( EncodableValueTest  ,
Bool   
)

Definition at line 18 of file encodable_value_unittests.cc.

18 {
19 EncodableValue value(false);
20
21 EXPECT_FALSE(std::get<bool>(value));
22 value = true;
23 EXPECT_TRUE(std::get<bool>(value));
24}

◆ TEST() [7/363]

flutter::TEST ( EncodableValueTest  ,
Comparison   
)

Definition at line 177 of file encodable_value_unittests.cc.

177 {
179 // Null
181 // Bool
182 EncodableValue(true),
183 EncodableValue(false),
184 // Int
185 EncodableValue(-7),
187 EncodableValue(100),
188 // Long
189 EncodableValue(INT64_C(-7)),
190 EncodableValue(INT64_C(0)),
191 EncodableValue(INT64_C(100)),
192 // Double
193 EncodableValue(-7.0),
194 EncodableValue(0.0),
195 EncodableValue(100.0),
196 // String
197 EncodableValue("one"),
198 EncodableValue("two"),
199 // ByteList
200 EncodableValue(std::vector<uint8_t>{0, 1}),
201 EncodableValue(std::vector<uint8_t>{0, 10}),
202 // IntList
203 EncodableValue(std::vector<int32_t>{0, 1}),
204 EncodableValue(std::vector<int32_t>{0, 100}),
205 // LongList
206 EncodableValue(std::vector<int64_t>{0, INT64_C(1)}),
207 EncodableValue(std::vector<int64_t>{0, INT64_C(100)}),
208 // DoubleList
209 EncodableValue(std::vector<double>{0, INT64_C(1)}),
210 EncodableValue(std::vector<double>{0, INT64_C(100)}),
211 // List
212 EncodableValue(EncodableList{EncodableValue(), EncodableValue(true)}),
213 EncodableValue(EncodableList{EncodableValue(), EncodableValue(1.0)}),
214 // Map
215 EncodableValue(EncodableMap{{EncodableValue(), EncodableValue(true)},
216 {EncodableValue(7), EncodableValue(7.0)}}),
217 EncodableValue(
218 EncodableMap{{EncodableValue(), EncodableValue(1.0)},
219 {EncodableValue("key"), EncodableValue("value")}}),
220 // FloatList
221 EncodableValue(std::vector<float>{0, 1}),
222 EncodableValue(std::vector<float>{0, 100}),
223 };
224
225 for (size_t i = 0; i < values.size(); ++i) {
226 const auto& a = values[i];
227 for (size_t j = 0; j < values.size(); ++j) {
228 const auto& b = values[j];
229 if (i == j) {
230 // Identical objects should always be equal.
231 EXPECT_FALSE(a < b);
232 EXPECT_FALSE(b < a);
233 } else {
234 // All other comparisons should be consistent, but the direction doesn't
235 // matter.
236 EXPECT_NE(a < b, b < a) << "Indexes: " << i << ", " << j;
237 }
238 }
239
240 // Copies should always be equal.
241 EncodableValue copy(a);
242 EXPECT_FALSE(a < copy || copy < a);
243 }
244}
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
Definition: SkSwizzler.cpp:31
Definition: copy.py:1
std::vector< EncodableValue > EncodableList
std::map< EncodableValue, EncodableValue > EncodableMap

◆ TEST() [8/363]

flutter::TEST ( EncodableValueTest  ,
CString   
)

Definition at line 68 of file encodable_value_unittests.cc.

68 {
69 const char* hello = "Hello, world!";
70 EncodableValue value(hello);
71
72 EXPECT_EQ(std::get<std::string>(value), hello);
73 value = "Goodbye";
74 EXPECT_EQ(std::get<std::string>(value), "Goodbye");
75}

◆ TEST() [9/363]

flutter::TEST ( EncodableValueTest  ,
DeepCopy   
)

Definition at line 247 of file encodable_value_unittests.cc.

247 {
248 EncodableList original = {
250 {EncodableValue(), EncodableValue(std::vector<int32_t>{1, 2, 3})},
251 {EncodableValue(1), EncodableValue(INT64_C(0000))},
252 {EncodableValue("two"), EncodableValue(7)},
253 }),
254 EncodableValue(EncodableList{
255 EncodableValue(),
256 EncodableValue(),
257 EncodableValue(
258 EncodableMap{{EncodableValue("a"), EncodableValue("b")}}),
259 }),
260 };
261
262 EncodableValue copy(original);
263 ASSERT_TRUE(std::holds_alternative<EncodableList>(copy));
264
265 // Spot-check innermost collection values.
266 auto& root_list = std::get<EncodableList>(copy);
267 auto& first_child = std::get<EncodableMap>(root_list[0]);
268 EXPECT_EQ(std::get<int32_t>(first_child[EncodableValue("two")]), 7);
269 auto& second_child = std::get<EncodableList>(root_list[1]);
270 auto& innermost_map = std::get<EncodableMap>(second_child[2]);
271 EXPECT_EQ(std::get<std::string>(innermost_map[EncodableValue("a")]), "b");
272
273 // Modify those values in the original structure.
274 first_child[EncodableValue("two")] = EncodableValue();
275 innermost_map[EncodableValue("a")] = 99;
276
277 // Re-check innermost collection values of the original to ensure that they
278 // haven't changed.
279 first_child = std::get<EncodableMap>(original[0]);
280 EXPECT_EQ(std::get<int32_t>(first_child[EncodableValue("two")]), 7);
281 second_child = std::get<EncodableList>(original[1]);
282 innermost_map = std::get<EncodableMap>(second_child[2]);
283 EXPECT_EQ(std::get<std::string>(innermost_map[EncodableValue("a")]), "b");
284}

◆ TEST() [10/363]

flutter::TEST ( EncodableValueTest  ,
Double   
)

Definition at line 50 of file encodable_value_unittests.cc.

50 {
52
53 EXPECT_EQ(std::get<double>(value), 3.14);
55 EXPECT_EQ(std::get<double>(value), std::numeric_limits<double>::max());
56}

◆ TEST() [11/363]

flutter::TEST ( EncodableValueTest  ,
DoubleList   
)

Definition at line 119 of file encodable_value_unittests.cc.

119 {
120 std::vector<double> data = {-10.0, 2.0};
121 EncodableValue value(data);
122
123 auto& list_value = std::get<std::vector<double>>(value);
124 list_value.push_back(std::numeric_limits<double>::max());
125 EXPECT_EQ(list_value[0], -10.0);
126 EXPECT_EQ(list_value[1], 2.0);
127
128 ASSERT_EQ(list_value.size(), 3u);
129 EXPECT_EQ(data.size(), 2u);
130 EXPECT_EQ(list_value[2], std::numeric_limits<double>::max());
131}

◆ TEST() [12/363]

flutter::TEST ( EncodableValueTest  ,
Int   
)

Definition at line 26 of file encodable_value_unittests.cc.

26 {
28
29 EXPECT_EQ(std::get<int32_t>(value), 42);
31 EXPECT_EQ(std::get<int32_t>(value), std::numeric_limits<int32_t>::max());
32}

◆ TEST() [13/363]

flutter::TEST ( EncodableValueTest  ,
Int32List   
)

Definition at line 91 of file encodable_value_unittests.cc.

91 {
92 std::vector<int32_t> data = {-10, 2};
93 EncodableValue value(data);
94
95 auto& list_value = std::get<std::vector<int32_t>>(value);
96 list_value.push_back(std::numeric_limits<int32_t>::max());
97 EXPECT_EQ(list_value[0], -10);
98 EXPECT_EQ(list_value[1], 2);
99
100 ASSERT_EQ(list_value.size(), 3u);
101 EXPECT_EQ(data.size(), 2u);
102 EXPECT_EQ(list_value[2], std::numeric_limits<int32_t>::max());
103}

◆ TEST() [14/363]

flutter::TEST ( EncodableValueTest  ,
Int64List   
)

Definition at line 105 of file encodable_value_unittests.cc.

105 {
106 std::vector<int64_t> data = {-10, 2};
107 EncodableValue value(data);
108
109 auto& list_value = std::get<std::vector<int64_t>>(value);
110 list_value.push_back(std::numeric_limits<int64_t>::max());
111 EXPECT_EQ(list_value[0], -10);
112 EXPECT_EQ(list_value[1], 2);
113
114 ASSERT_EQ(list_value.size(), 3u);
115 EXPECT_EQ(data.size(), 2u);
116 EXPECT_EQ(list_value[2], std::numeric_limits<int64_t>::max());
117}

◆ TEST() [15/363]

flutter::TEST ( EncodableValueTest  ,
List   
)

Definition at line 133 of file encodable_value_unittests.cc.

133 {
134 EncodableList encodables = {
136 EncodableValue(2.0),
137 EncodableValue("Three"),
138 };
139 EncodableValue value(encodables);
140
141 auto& list_value = std::get<EncodableList>(value);
142 EXPECT_EQ(std::get<int32_t>(list_value[0]), 1);
143 EXPECT_EQ(std::get<double>(list_value[1]), 2.0);
144 EXPECT_EQ(std::get<std::string>(list_value[2]), "Three");
145
146 // Ensure that it's a modifiable copy of the original array.
147 list_value.push_back(EncodableValue(true));
148 ASSERT_EQ(list_value.size(), 4u);
149 EXPECT_EQ(encodables.size(), 3u);
150 EXPECT_EQ(std::get<bool>(std::get<EncodableList>(value)[3]), true);
151}

◆ TEST() [16/363]

flutter::TEST ( EncodableValueTest  ,
Long   
)

Definition at line 42 of file encodable_value_unittests.cc.

42 {
43 EncodableValue value(INT64_C(42));
44
45 EXPECT_EQ(std::get<int64_t>(value), 42);
47 EXPECT_EQ(std::get<int64_t>(value), std::numeric_limits<int64_t>::max());
48}

◆ TEST() [17/363]

flutter::TEST ( EncodableValueTest  ,
LongValue   
)

Definition at line 35 of file encodable_value_unittests.cc.

35 {
37 EXPECT_EQ(int_value.LongValue(), std::numeric_limits<int32_t>::max());
39 EXPECT_EQ(long_value.LongValue(), std::numeric_limits<int64_t>::max());
40}

◆ TEST() [18/363]

flutter::TEST ( EncodableValueTest  ,
Map   
)

Definition at line 153 of file encodable_value_unittests.cc.

153 {
154 EncodableMap encodables = {
155 {EncodableValue(), EncodableValue(std::vector<int32_t>{1, 2, 3})},
156 {EncodableValue(1), EncodableValue(INT64_C(10000))},
157 {EncodableValue("two"), EncodableValue(7)},
158 };
159 EncodableValue value(encodables);
160
161 auto& map_value = std::get<EncodableMap>(value);
162 EXPECT_EQ(
163 std::holds_alternative<std::vector<int32_t>>(map_value[EncodableValue()]),
164 true);
165 EXPECT_EQ(std::get<int64_t>(map_value[EncodableValue(1)]), INT64_C(10000));
166 EXPECT_EQ(std::get<int32_t>(map_value[EncodableValue("two")]), 7);
167
168 // Ensure that it's a modifiable copy of the original map.
169 map_value[EncodableValue(true)] = EncodableValue(false);
170 ASSERT_EQ(map_value.size(), 4u);
171 EXPECT_EQ(encodables.size(), 3u);
172 EXPECT_EQ(std::get<bool>(map_value[EncodableValue(true)]), false);
173}

◆ TEST() [19/363]

flutter::TEST ( EncodableValueTest  ,
Null   
)

Definition at line 13 of file encodable_value_unittests.cc.

13 {
15 value.IsNull();
16}

◆ TEST() [20/363]

flutter::TEST ( EncodableValueTest  ,
String   
)

Definition at line 58 of file encodable_value_unittests.cc.

58 {
59 std::string hello("Hello, world!");
60 EncodableValue value(hello);
61
62 EXPECT_EQ(std::get<std::string>(value), hello);
63 value = std::string("Goodbye");
64 EXPECT_EQ(std::get<std::string>(value), "Goodbye");
65}

◆ TEST() [21/363]

flutter::TEST ( EncodableValueTest  ,
TypeIndexesCorrect   
)

Definition at line 301 of file encodable_value_unittests.cc.

301 {
302 // Null
303 EXPECT_EQ(EncodableValue().index(), 0u);
304 // Bool
305 EXPECT_EQ(EncodableValue(true).index(), 1u);
306 // Int32
307 EXPECT_EQ(EncodableValue(100).index(), 2u);
308 // Int64
309 EXPECT_EQ(EncodableValue(INT64_C(100)).index(), 3u);
310 // Double
311 EXPECT_EQ(EncodableValue(7.0).index(), 4u);
312 // String
313 EXPECT_EQ(EncodableValue("one").index(), 5u);
314 // ByteList
315 EXPECT_EQ(EncodableValue(std::vector<uint8_t>()).index(), 6u);
316 // IntList
317 EXPECT_EQ(EncodableValue(std::vector<int32_t>()).index(), 7u);
318 // LongList
319 EXPECT_EQ(EncodableValue(std::vector<int64_t>()).index(), 8u);
320 // DoubleList
321 EXPECT_EQ(EncodableValue(std::vector<double>()).index(), 9u);
322 // List
323 EXPECT_EQ(EncodableValue(EncodableList()).index(), 10u);
324 // Map
325 EXPECT_EQ(EncodableValue(EncodableMap()).index(), 11u);
326 // Custom type
327 TestCustomValue customValue;
328 EXPECT_EQ(((EncodableValue)CustomEncodableValue(customValue)).index(), 12u);
329 // FloatList
330 EXPECT_EQ(EncodableValue(std::vector<float>()).index(), 13u);
331} // namespace flutter

◆ TEST() [22/363]

flutter::TEST ( EncodableValueTest  ,
UInt8List   
)

Definition at line 77 of file encodable_value_unittests.cc.

77 {
78 std::vector<uint8_t> data = {0, 2};
79 EncodableValue value(data);
80
81 auto& list_value = std::get<std::vector<uint8_t>>(value);
82 list_value.push_back(std::numeric_limits<uint8_t>::max());
83 EXPECT_EQ(list_value[0], 0);
84 EXPECT_EQ(list_value[1], 2);
85
86 ASSERT_EQ(list_value.size(), 3u);
87 EXPECT_EQ(data.size(), 2u);
88 EXPECT_EQ(list_value[2], std::numeric_limits<uint8_t>::max());
89}

◆ TEST() [23/363]

flutter::TEST ( EventChannelTest  ,
Cancel   
)

Definition at line 102 of file event_channel_unittests.cc.

102 {
103 TestBinaryMessenger messenger;
104 const std::string channel_name("some_channel");
105 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
106 EventChannel channel(&messenger, channel_name, &codec);
107
108 bool on_listen_called = false;
109 bool on_cancel_called = false;
110 auto handler = std::make_unique<StreamHandlerFunctions<>>(
111 [&on_listen_called](const EncodableValue* arguments,
112 std::unique_ptr<EventSink<>>&& events)
113 -> std::unique_ptr<StreamHandlerError<>> {
114 on_listen_called = true;
115 return nullptr;
116 },
117 [&on_cancel_called](const EncodableValue* arguments)
118 -> std::unique_ptr<StreamHandlerError<>> {
119 on_cancel_called = true;
120 return nullptr;
121 });
122 channel.SetStreamHandler(std::move(handler));
123 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
124 EXPECT_NE(messenger.last_message_handler(), nullptr);
125
126 // Send test listen message.
127 MethodCall<> call_listen("listen", nullptr);
128 auto message = codec.EncodeMethodCall(call_listen);
129 messenger.last_message_handler()(
130 message->data(), message->size(),
131 [](const uint8_t* reply, const size_t reply_size) {});
132 EXPECT_EQ(on_listen_called, true);
133
134 // Send test cancel message.
135 MethodCall<> call_cancel("cancel", nullptr);
136 message = codec.EncodeMethodCall(call_cancel);
137 messenger.last_message_handler()(
138 message->data(), message->size(),
139 [](const uint8_t* reply, const size_t reply_size) {});
140
141 // Check results.
142 EXPECT_EQ(on_cancel_called, true);
143}
std::unique_ptr< std::vector< uint8_t > > EncodeMethodCall(const MethodCall< T > &method_call) const
Definition: method_codec.h:48

◆ TEST() [24/363]

flutter::TEST ( EventChannelTest  ,
HandlerOutlivesEventChannel   
)

Definition at line 232 of file event_channel_unittests.cc.

232 {
233 TestBinaryMessenger messenger;
234 const std::string channel_name("some_channel");
235 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
236
237 bool on_listen_called = false;
238 bool on_cancel_called = false;
239 {
240 EventChannel channel(&messenger, channel_name, &codec);
241 auto handler = std::make_unique<StreamHandlerFunctions<>>(
242 [&on_listen_called](const EncodableValue* arguments,
243 std::unique_ptr<EventSink<>>&& events)
244 -> std::unique_ptr<StreamHandlerError<>> {
245 on_listen_called = true;
246 return nullptr;
247 },
248 [&on_cancel_called](const EncodableValue* arguments)
249 -> std::unique_ptr<StreamHandlerError<>> {
250 on_cancel_called = true;
251 return nullptr;
252 });
253 channel.SetStreamHandler(std::move(handler));
254 }
255
256 // The event channel was destroyed but the handler should still be alive.
257 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
258 EXPECT_NE(messenger.last_message_handler(), nullptr);
259
260 // Send test listen message.
261 MethodCall<> call_listen("listen", nullptr);
262 auto message = codec.EncodeMethodCall(call_listen);
263 messenger.last_message_handler()(
264 message->data(), message->size(),
265 [](const uint8_t* reply, const size_t reply_size) {});
266 EXPECT_EQ(on_listen_called, true);
267
268 // Send test cancel message.
269 MethodCall<> call_cancel("cancel", nullptr);
270 message = codec.EncodeMethodCall(call_cancel);
271 messenger.last_message_handler()(
272 message->data(), message->size(),
273 [](const uint8_t* reply, const size_t reply_size) {});
274 EXPECT_EQ(on_cancel_called, true);
275}

◆ TEST() [25/363]

flutter::TEST ( EventChannelTest  ,
ListenNotCancel   
)

Definition at line 146 of file event_channel_unittests.cc.

146 {
147 TestBinaryMessenger messenger;
148 const std::string channel_name("some_channel");
149 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
150 EventChannel channel(&messenger, channel_name, &codec);
151
152 bool on_listen_called = false;
153 bool on_cancel_called = false;
154 auto handler = std::make_unique<StreamHandlerFunctions<>>(
155 [&on_listen_called](const EncodableValue* arguments,
156 std::unique_ptr<EventSink<>>&& events)
157 -> std::unique_ptr<StreamHandlerError<>> {
158 on_listen_called = true;
159 return nullptr;
160 },
161 [&on_cancel_called](const EncodableValue* arguments)
162 -> std::unique_ptr<StreamHandlerError<>> {
163 on_cancel_called = true;
164 return nullptr;
165 });
166 channel.SetStreamHandler(std::move(handler));
167 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
168 EXPECT_NE(messenger.last_message_handler(), nullptr);
169
170 // Send test listen message.
171 MethodCall<> call_listen("listen", nullptr);
172 auto message = codec.EncodeMethodCall(call_listen);
173 messenger.last_message_handler()(
174 message->data(), message->size(),
175 [](const uint8_t* reply, const size_t reply_size) {});
176
177 // Check results.
178 EXPECT_EQ(on_listen_called, true);
179 EXPECT_EQ(on_cancel_called, false);
180}

◆ TEST() [26/363]

flutter::TEST ( EventChannelTest  ,
Registration   
)

Definition at line 49 of file event_channel_unittests.cc.

49 {
50 TestBinaryMessenger messenger;
51 const std::string channel_name("some_channel");
52 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
53 EventChannel channel(&messenger, channel_name, &codec);
54
55 bool on_listen_called = false;
56 auto handler = std::make_unique<StreamHandlerFunctions<>>(
57 [&on_listen_called](const EncodableValue* arguments,
58 std::unique_ptr<EventSink<>>&& events)
59 -> std::unique_ptr<StreamHandlerError<>> {
60 on_listen_called = true;
61 return nullptr;
62 },
63 [](const EncodableValue* arguments)
64 -> std::unique_ptr<StreamHandlerError<>> { return nullptr; });
65 channel.SetStreamHandler(std::move(handler));
66 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
67 EXPECT_NE(messenger.last_message_handler(), nullptr);
68
69 // Send test listen message.
70 MethodCall<> call("listen", nullptr);
71 auto message = codec.EncodeMethodCall(call);
72 messenger.last_message_handler()(
73 message->data(), message->size(),
74 [](const uint8_t* reply, const size_t reply_size) {});
75
76 // Check results.
77 EXPECT_EQ(on_listen_called, true);
78}
def call(args)
Definition: dom.py:159

◆ TEST() [27/363]

flutter::TEST ( EventChannelTest  ,
ReRegistration   
)

Definition at line 186 of file event_channel_unittests.cc.

186 {
187 TestBinaryMessenger messenger;
188 const std::string channel_name("some_channel");
189 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
190 EventChannel channel(&messenger, channel_name, &codec);
191
192 bool on_listen_called = false;
193 bool on_cancel_called = false;
194 auto handler = std::make_unique<StreamHandlerFunctions<>>(
195 [&on_listen_called](const EncodableValue* arguments,
196 std::unique_ptr<EventSink<>>&& events)
197 -> std::unique_ptr<StreamHandlerError<>> {
198 on_listen_called = true;
199 return nullptr;
200 },
201 [&on_cancel_called](const EncodableValue* arguments)
202 -> std::unique_ptr<StreamHandlerError<>> {
203 on_cancel_called = true;
204 return nullptr;
205 });
206 channel.SetStreamHandler(std::move(handler));
207 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
208 EXPECT_NE(messenger.last_message_handler(), nullptr);
209
210 // Send test listen message.
211 MethodCall<> call("listen", nullptr);
212 auto message = codec.EncodeMethodCall(call);
213 messenger.last_message_handler()(
214 message->data(), message->size(),
215 [](const uint8_t* reply, const size_t reply_size) {});
216 EXPECT_EQ(on_listen_called, true);
217
218 // Send second test message to test StreamHandler's OnCancel
219 // method is called before OnListen method is called.
220 on_listen_called = false;
222 messenger.last_message_handler()(
223 message->data(), message->size(),
224 [](const uint8_t* reply, const size_t reply_size) {});
225
226 // Check results.
227 EXPECT_EQ(on_cancel_called, true);
228 EXPECT_EQ(on_listen_called, true);
229}

◆ TEST() [28/363]

flutter::TEST ( EventChannelTest  ,
StreamHandlerErrorNullptr   
)

Definition at line 295 of file event_channel_unittests.cc.

295 {
296 std::unique_ptr<StreamHandlerError<>> error =
297 std::make_unique<StreamHandlerError<>>("Code", "Message", nullptr);
298
299 ASSERT_NE(error.get(), nullptr);
300 EXPECT_FALSE(error->error_details);
301}

◆ TEST() [29/363]

flutter::TEST ( EventChannelTest  ,
StreamHandlerErrorPassByValue   
)

Definition at line 277 of file event_channel_unittests.cc.

277 {
278 std::unique_ptr<StreamHandlerError<>> error = nullptr;
279
280 {
281 std::string code = "Code";
282 std::string msg = "Message";
283 std::unique_ptr<EncodableValue> details =
284 std::make_unique<EncodableValue>("Details");
285 error =
286 std::make_unique<StreamHandlerError<>>(code, msg, std::move(details));
287 }
288
289 ASSERT_NE(error.get(), nullptr);
290 EXPECT_EQ(error->error_code, "Code");
291 EXPECT_EQ(error->error_message, "Message");
292 EXPECT_EQ(std::get<std::string>(*error->error_details), "Details");
293}

◆ TEST() [30/363]

flutter::TEST ( EventChannelTest  ,
Unregistration   
)

Definition at line 81 of file event_channel_unittests.cc.

81 {
82 TestBinaryMessenger messenger;
83 const std::string channel_name("some_channel");
84 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
85 EventChannel channel(&messenger, channel_name, &codec);
86
87 auto handler = std::make_unique<StreamHandlerFunctions<>>(
88 [](const EncodableValue* arguments, std::unique_ptr<EventSink<>>&& events)
89 -> std::unique_ptr<StreamHandlerError<>> { return nullptr; },
90 [](const EncodableValue* arguments)
91 -> std::unique_ptr<StreamHandlerError<>> { return nullptr; });
92 channel.SetStreamHandler(std::move(handler));
93 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
94 EXPECT_NE(messenger.last_message_handler(), nullptr);
95
96 channel.SetStreamHandler(nullptr);
97 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
98 EXPECT_EQ(messenger.last_message_handler(), nullptr);
99}

◆ TEST() [31/363]

flutter::TEST ( FlowTest  ,
SurfaceFrameDoesNotHaveEmptyCanvas   
)

Definition at line 26 of file surface_frame_unittests.cc.

26 {
27 SurfaceFrame::FramebufferInfo framebuffer_info;
28 auto callback = [](const SurfaceFrame&, DlCanvas*) { return true; };
29 SurfaceFrame frame(
30 /*surface=*/nullptr,
31 /*framebuffer_info=*/framebuffer_info,
32 /*submit_callback=*/callback,
33 /*frame_size=*/SkISize::Make(800, 600),
34 /*context_result=*/nullptr,
35 /*display_list_fallback=*/true);
36
37 EXPECT_FALSE(frame.Canvas()->GetLocalClipBounds().isEmpty());
38 EXPECT_FALSE(frame.Canvas()->QuickReject(SkRect::MakeLTRB(10, 10, 50, 50)));
39}
Developer-facing API for rendering anything within the engine.
Definition: dl_canvas.h:38

◆ TEST() [32/363]

flutter::TEST ( FlowTest  ,
SurfaceFrameDoesNotPrepareRtree   
)

Definition at line 41 of file surface_frame_unittests.cc.

41 {
42 SurfaceFrame::FramebufferInfo framebuffer_info;
43 auto callback = [](const SurfaceFrame&, DlCanvas*) { return true; };
44 auto surface_frame = std::make_unique<SurfaceFrame>(
45 /*surface=*/nullptr,
46 /*framebuffer_info=*/framebuffer_info,
47 /*submit_callback=*/callback,
48 /*frame_size=*/SkISize::Make(800, 600),
49 /*context_result=*/nullptr,
50 /*display_list_fallback=*/true);
51 surface_frame->Canvas()->DrawRect(SkRect::MakeWH(100, 100), DlPaint());
52 EXPECT_FALSE(surface_frame->BuildDisplayList()->has_rtree());
53}
flutter::DlPaint DlPaint

◆ TEST() [33/363]

flutter::TEST ( FlowTest  ,
SurfaceFrameDoesNotSubmitInDtor   
)

Definition at line 12 of file surface_frame_unittests.cc.

12 {
13 SurfaceFrame::FramebufferInfo framebuffer_info;
14 auto callback = [](const SurfaceFrame&, DlCanvas*) {
15 EXPECT_FALSE(true);
16 return true;
17 };
18 auto surface_frame = std::make_unique<SurfaceFrame>(
19 /*surface=*/nullptr,
20 /*framebuffer_info=*/framebuffer_info,
21 /*submit_callback=*/callback,
22 /*frame_size=*/SkISize::Make(800, 600));
23 surface_frame.reset();
24}

◆ TEST() [34/363]

flutter::TEST ( FlutterEngineTest  ,
CreateDestroy   
)

Definition at line 51 of file flutter_engine_unittests.cc.

51 {
52 const std::string icu_data_path = "fake/path/to/icu";
53 const std::string assets_path = "fake/path/to/assets";
55 std::make_unique<TestGlfwApi>());
56 auto test_api = static_cast<TestGlfwApi*>(scoped_api_stub.stub());
57 {
59 engine.Start(icu_data_path, assets_path, {});
60 EXPECT_EQ(test_api->run_called(), true);
61 EXPECT_EQ(test_api->shut_down_called(), false);
62 }
63 // Destroying should implicitly shut down if it hasn't been done manually.
64 EXPECT_EQ(test_api->shut_down_called(), true);
65}
FlutterEngine engine
Definition: main.cc:68

◆ TEST() [35/363]

flutter::TEST ( FlutterEngineTest  ,
CreateDestroyWithCustomEntrypoint   
)

Definition at line 118 of file flutter_engine_unittests.cc.

118 {
120 std::make_unique<TestFlutterWindowsApi>());
121 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
122 {
123 DartProject project(L"fake/project/path");
124 project.set_dart_entrypoint("customEntrypoint");
125 FlutterEngine engine(project);
126 engine.Run();
127 EXPECT_EQ(test_api->create_called(), true);
128 EXPECT_EQ(test_api->run_called(), true);
129 EXPECT_EQ(test_api->destroy_called(), false);
130 }
131 // Destroying should implicitly shut down if it hasn't been done manually.
132 EXPECT_EQ(test_api->destroy_called(), true);
133}

◆ TEST() [36/363]

flutter::TEST ( FlutterEngineTest  ,
DartEntrypointArgs   
)

Definition at line 183 of file flutter_engine_unittests.cc.

183 {
185 std::make_unique<TestFlutterWindowsApi>());
186 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
187
188 DartProject project(L"data");
189 std::vector<std::string> arguments = {"one", "two"};
190 project.set_dart_entrypoint_arguments(arguments);
191
192 FlutterEngine engine(project);
193 const std::vector<std::string>& arguments_ref =
194 test_api->dart_entrypoint_arguments();
195 ASSERT_EQ(2, arguments_ref.size());
196 EXPECT_TRUE(arguments[0] == arguments_ref[0]);
197 EXPECT_TRUE(arguments[1] == arguments_ref[1]);
198}

◆ TEST() [37/363]

flutter::TEST ( FlutterEngineTest  ,
ExplicitShutDown   
)

Definition at line 67 of file flutter_engine_unittests.cc.

67 {
68 const std::string icu_data_path = "fake/path/to/icu";
69 const std::string assets_path = "fake/path/to/assets";
71 std::make_unique<TestGlfwApi>());
72 auto test_api = static_cast<TestGlfwApi*>(scoped_api_stub.stub());
73
75 engine.Start(icu_data_path, assets_path, {});
76 EXPECT_EQ(test_api->run_called(), true);
77 EXPECT_EQ(test_api->shut_down_called(), false);
78 engine.ShutDown();
79 EXPECT_EQ(test_api->shut_down_called(), true);
80}

◆ TEST() [38/363]

flutter::TEST ( FlutterEngineTest  ,
GetMessenger   
)

Definition at line 173 of file flutter_engine_unittests.cc.

173 {
174 DartProject project(L"data");
176 std::make_unique<TestFlutterWindowsApi>());
177 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
178
179 FlutterEngine engine(DartProject(L"fake/project/path"));
180 EXPECT_NE(engine.messenger(), nullptr);
181}

◆ TEST() [39/363]

flutter::TEST ( FlutterEngineTest  ,
ProcessExternalWindowMessage   
)

Definition at line 218 of file flutter_engine_unittests.cc.

218 {
220 std::make_unique<TestFlutterWindowsApi>());
221 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
222
223 FlutterEngine engine(DartProject(L"fake/project/path"));
224
225 engine.ProcessExternalWindowMessage(reinterpret_cast<HWND>(1), 1234, 0, 0);
226
227 EXPECT_EQ(test_api->last_external_message(), 1234);
228}

◆ TEST() [40/363]

flutter::TEST ( FlutterEngineTest  ,
ProcessMessages   
)

Definition at line 149 of file flutter_engine_unittests.cc.

149 {
151 std::make_unique<TestFlutterWindowsApi>());
152 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
153
154 FlutterEngine engine(DartProject(L"fake/project/path"));
155 engine.Run();
156
157 std::chrono::nanoseconds next_event_time = engine.ProcessMessages();
158 EXPECT_EQ(next_event_time.count(), 99);
159}

◆ TEST() [41/363]

flutter::TEST ( FlutterEngineTest  ,
ReloadFonts   
)

Definition at line 161 of file flutter_engine_unittests.cc.

161 {
163 std::make_unique<TestFlutterWindowsApi>());
164 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
165
166 FlutterEngine engine(DartProject(L"fake/project/path"));
167 engine.Run();
168
169 engine.ReloadSystemFonts();
170 EXPECT_TRUE(test_api->reload_fonts_called());
171}

◆ TEST() [42/363]

flutter::TEST ( FlutterEngineTest  ,
RunloopTimeoutTranslation   
)

Definition at line 82 of file flutter_engine_unittests.cc.

82 {
83 const std::string icu_data_path = "fake/path/to/icu";
84 const std::string assets_path = "fake/path/to/assets";
86 std::make_unique<TestGlfwApi>());
87 auto test_api = static_cast<TestGlfwApi*>(scoped_api_stub.stub());
88
90 engine.Start(icu_data_path, assets_path, {});
91
92 engine.RunEventLoopWithTimeout(std::chrono::milliseconds(100));
93 EXPECT_EQ(test_api->last_run_loop_timeout(), 100U);
94
95 engine.RunEventLoopWithTimeout(std::chrono::milliseconds::max() -
96 std::chrono::milliseconds(1));
97 EXPECT_EQ(test_api->last_run_loop_timeout(), UINT32_MAX);
98
99 engine.RunEventLoopWithTimeout(std::chrono::milliseconds::max());
100 EXPECT_EQ(test_api->last_run_loop_timeout(), 0U);
101}

◆ TEST() [43/363]

flutter::TEST ( FlutterEngineTest  ,
SetNextFrameCallback   
)

Definition at line 200 of file flutter_engine_unittests.cc.

200 {
201 DartProject project(L"data");
203 std::make_unique<TestFlutterWindowsApi>());
204 auto test_api = static_cast<TestFlutterWindowsApi*>(scoped_api_stub.stub());
205
206 FlutterEngine engine(DartProject(L"fake/project/path"));
207
208 bool success = false;
209 engine.SetNextFrameCallback([&success]() { success = true; });
210
211 EXPECT_TRUE(test_api->has_next_frame_callback());
212
213 test_api->run_next_frame_callback();
214
215 EXPECT_TRUE(success);
216}

◆ TEST() [44/363]

flutter::TEST ( FlutterProjectBundle  ,
Switches   
)

Definition at line 50 of file engine_switches_unittests.cc.

50 {
51 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCHES", "2");
52 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_1", "abc");
53 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_2", "foo=\"bar, baz\"");
54
55 std::vector<std::string> switches = GetSwitchesFromEnvironment();
56 EXPECT_EQ(switches.size(), 2U);
57 EXPECT_EQ(switches[0], "--abc");
58 EXPECT_EQ(switches[1], "--foo=\"bar, baz\"");
59}
std::vector< std::string > GetSwitchesFromEnvironment()

◆ TEST() [45/363]

flutter::TEST ( FlutterProjectBundle  ,
SwitchesEmpty   
)

Definition at line 31 of file engine_switches_unittests.cc.

31 {
32 // Clear the main environment variable, since test order is not guaranteed.
33 ClearEnvironmentVariable("FLUTTER_ENGINE_SWITCHES");
34
35 EXPECT_EQ(GetSwitchesFromEnvironment().size(), 0U);
36}

◆ TEST() [46/363]

flutter::TEST ( FlutterProjectBundle  ,
SwitchesExtraValues   
)

Definition at line 61 of file engine_switches_unittests.cc.

61 {
62 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCHES", "1");
63 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_1", "abc");
64 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_2", "foo=\"bar, baz\"");
65
66 std::vector<std::string> switches = GetSwitchesFromEnvironment();
67 EXPECT_EQ(switches.size(), 1U);
68 EXPECT_EQ(switches[0], "--abc");
69}

◆ TEST() [47/363]

flutter::TEST ( FlutterProjectBundle  ,
SwitchesMissingValues   
)

Definition at line 71 of file engine_switches_unittests.cc.

71 {
72 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCHES", "4");
73 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_1", "abc");
74 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_2", "foo=\"bar, baz\"");
75 ClearEnvironmentVariable("FLUTTER_ENGINE_SWITCH_3");
76 SetEnvironmentVariable("FLUTTER_ENGINE_SWITCH_4", "oops");
77
78 std::vector<std::string> switches = GetSwitchesFromEnvironment();
79 EXPECT_EQ(switches.size(), 3U);
80 EXPECT_EQ(switches[0], "--abc");
81 EXPECT_EQ(switches[1], "--foo=\"bar, baz\"");
82 // The missing switch should be skipped, leaving SWITCH_4 as the third
83 // switch in the array.
84 EXPECT_EQ(switches[2], "--oops");
85}

◆ TEST() [48/363]

flutter::TEST ( FlutterViewControllerTest  ,
CreateDestroy   
)

Definition at line 40 of file flutter_window_controller_unittests.cc.

40 {
41 const std::string icu_data_path = "fake/path/to/icu";
43 std::make_unique<TestGlfwApi>());
44 auto test_api = static_cast<TestGlfwApi*>(scoped_api_stub.stub());
45 {
46 FlutterWindowController controller(icu_data_path);
47 EXPECT_EQ(test_api->init_called(), true);
48 EXPECT_EQ(test_api->terminate_called(), false);
49 }
50 EXPECT_EQ(test_api->init_called(), true);
51 EXPECT_EQ(test_api->terminate_called(), true);
52}

◆ TEST() [49/363]

flutter::TEST ( FlutterViewControllerTest  ,
ForceRedraw   
)

Definition at line 100 of file flutter_view_controller_unittests.cc.

100 {
101 DartProject project(L"data");
103 std::make_unique<TestWindowsApi>());
104 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
105 FlutterViewController controller(100, 100, project);
106
107 controller.ForceRedraw();
108 EXPECT_TRUE(test_api->view_controller_force_redrawed());
109}

◆ TEST() [50/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetEngine   
)

Definition at line 82 of file flutter_view_controller_unittests.cc.

82 {
83 DartProject project(L"data");
85 std::make_unique<TestWindowsApi>());
86 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
87 FlutterViewController controller(100, 100, project);
88 EXPECT_NE(controller.engine(), nullptr);
89}

◆ TEST() [51/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetView   
)

Definition at line 91 of file flutter_view_controller_unittests.cc.

91 {
92 DartProject project(L"data");
94 std::make_unique<TestWindowsApi>());
95 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
96 FlutterViewController controller(100, 100, project);
97 EXPECT_NE(controller.view(), nullptr);
98}

◆ TEST() [52/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetViewId   
)

Definition at line 73 of file flutter_view_controller_unittests.cc.

73 {
74 DartProject project(L"data");
76 std::make_unique<TestWindowsApi>());
77 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
78 FlutterViewController controller(100, 100, project);
79 EXPECT_EQ(controller.view_id(), 1);
80}

◆ TEST() [53/363]

flutter::TEST ( FlutterViewTest  ,
GraphicsAdapterAccessPassesThrough   
)

Definition at line 35 of file flutter_view_unittests.cc.

35 {
37 std::make_unique<TestWindowsApi>());
38 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
39 FlutterView view(reinterpret_cast<FlutterDesktopViewRef>(2));
40
41 IDXGIAdapter* adapter = view.GetGraphicsAdapter();
42 EXPECT_EQ(adapter, reinterpret_cast<IDXGIAdapter*>(8));
43}
struct FlutterDesktopView * FlutterDesktopViewRef

◆ TEST() [54/363]

flutter::TEST ( FlutterViewTest  ,
HwndAccessPassesThrough   
)

Definition at line 27 of file flutter_view_unittests.cc.

27 {
29 std::make_unique<TestWindowsApi>());
30 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
31 FlutterView view(reinterpret_cast<FlutterDesktopViewRef>(2));
32 EXPECT_EQ(view.GetNativeWindow(), reinterpret_cast<HWND>(7));
33}

◆ TEST() [55/363]

flutter::TEST ( FlutterWindowTest  ,
SetSizeLimits   
)

Definition at line 34 of file flutter_window_unittests.cc.

34 {
35 const std::string icu_data_path = "fake/path/to/icu";
37 std::make_unique<TestGlfwApi>());
38 auto test_api = static_cast<TestGlfwApi*>(scoped_api_stub.stub());
39 // This is not actually used so any non-zero value works.
40 auto raw_window = reinterpret_cast<FlutterDesktopWindowRef>(1);
41
42 auto window = std::make_unique<FlutterWindow>(raw_window);
43
44 FlutterDesktopSize minimum_size = {};
45 minimum_size.width = 100;
46 minimum_size.height = 100;
47
48 FlutterDesktopSize maximum_size = {};
49 maximum_size.width = -1;
50 maximum_size.height = -1;
51
52 window->SetSizeLimits(minimum_size, maximum_size);
53
54 EXPECT_EQ(test_api->set_size_limits_called(), true);
55}

◆ TEST() [56/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameBuildEnd   
)

Definition at line 193 of file frame_timings_recorder_unittests.cc.

193 {
194 auto recorder = std::make_unique<FrameTimingsRecorder>();
195
196 const auto now = fml::TimePoint::Now();
197 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
198 recorder->RecordBuildStart(fml::TimePoint::Now());
199 recorder->RecordBuildEnd(fml::TimePoint::Now());
200
201 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kBuildEnd);
202 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
203 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
204 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
205 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
206 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
207}

◆ TEST() [57/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameBuildStart   
)

Definition at line 179 of file frame_timings_recorder_unittests.cc.

179 {
180 auto recorder = std::make_unique<FrameTimingsRecorder>();
181
182 const auto now = fml::TimePoint::Now();
183 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
184 recorder->RecordBuildStart(fml::TimePoint::Now());
185
186 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kBuildStart);
187 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
188 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
189 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
190 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
191}

◆ TEST() [58/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameFrameNumber   
)

Definition at line 159 of file frame_timings_recorder_unittests.cc.

159 {
160 auto recorder = std::make_unique<FrameTimingsRecorder>();
161
162 auto cloned =
163 recorder->CloneUntil(FrameTimingsRecorder::State::kUninitialized);
164 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
165}

◆ TEST() [59/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterEnd   
)

Definition at line 227 of file frame_timings_recorder_unittests.cc.

227 {
228 auto recorder = std::make_unique<FrameTimingsRecorder>();
229
230 const auto now = fml::TimePoint::Now();
231 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
232 recorder->RecordBuildStart(fml::TimePoint::Now());
233 recorder->RecordBuildEnd(fml::TimePoint::Now());
234 recorder->RecordRasterStart(fml::TimePoint::Now());
235 recorder->RecordRasterEnd();
236
237 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterEnd);
238 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
239 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
240 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
241 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
242 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
243 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
244 ASSERT_EQ(recorder->GetRasterEndTime(), cloned->GetRasterEndTime());
245 ASSERT_EQ(recorder->GetRasterEndWallTime(), cloned->GetRasterEndWallTime());
246 ASSERT_EQ(recorder->GetLayerCacheCount(), cloned->GetLayerCacheCount());
247 ASSERT_EQ(recorder->GetLayerCacheBytes(), cloned->GetLayerCacheBytes());
248 ASSERT_EQ(recorder->GetPictureCacheCount(), cloned->GetPictureCacheCount());
249 ASSERT_EQ(recorder->GetPictureCacheBytes(), cloned->GetPictureCacheBytes());
250}

◆ TEST() [60/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterEndWithCache   
)

Definition at line 252 of file frame_timings_recorder_unittests.cc.

252 {
253 auto recorder = std::make_unique<FrameTimingsRecorder>();
254 MockRasterCache cache(1, 10);
255 cache.BeginFrame();
256
257 const auto now = fml::TimePoint::Now();
258 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
259 recorder->RecordBuildStart(fml::TimePoint::Now());
260 recorder->RecordBuildEnd(fml::TimePoint::Now());
261 recorder->RecordRasterStart(fml::TimePoint::Now());
262
263 cache.AddMockLayer(100, 100);
264 size_t layer_bytes = cache.EstimateLayerCacheByteSize();
265 EXPECT_GT(layer_bytes, 0u);
266 cache.AddMockPicture(100, 100);
267 size_t picture_bytes = cache.EstimatePictureCacheByteSize();
268 EXPECT_GT(picture_bytes, 0u);
269 cache.EvictUnusedCacheEntries();
270 cache.EndFrame();
271 recorder->RecordRasterEnd(&cache);
272
273 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterEnd);
274 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
275 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
276 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
277 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
278 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
279 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
280 ASSERT_EQ(recorder->GetRasterEndTime(), cloned->GetRasterEndTime());
281 ASSERT_EQ(recorder->GetRasterEndWallTime(), cloned->GetRasterEndWallTime());
282 ASSERT_EQ(recorder->GetLayerCacheCount(), cloned->GetLayerCacheCount());
283 ASSERT_EQ(recorder->GetLayerCacheBytes(), cloned->GetLayerCacheBytes());
284 ASSERT_EQ(recorder->GetPictureCacheCount(), cloned->GetPictureCacheCount());
285 ASSERT_EQ(recorder->GetPictureCacheBytes(), cloned->GetPictureCacheBytes());
286}
A RasterCache implementation that simulates the act of rendering a Layer or DisplayList without the o...
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
Definition: switches.h:191

◆ TEST() [61/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterStart   
)

Definition at line 209 of file frame_timings_recorder_unittests.cc.

209 {
210 auto recorder = std::make_unique<FrameTimingsRecorder>();
211
212 const auto now = fml::TimePoint::Now();
213 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
214 recorder->RecordBuildStart(fml::TimePoint::Now());
215 recorder->RecordBuildEnd(fml::TimePoint::Now());
216 recorder->RecordRasterStart(fml::TimePoint::Now());
217
218 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterStart);
219 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
220 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
221 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
222 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
223 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
224 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
225}

◆ TEST() [62/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameVsyncStartAndTarget   
)

Definition at line 167 of file frame_timings_recorder_unittests.cc.

167 {
168 auto recorder = std::make_unique<FrameTimingsRecorder>();
169
170 const auto now = fml::TimePoint::Now();
171 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
172
173 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kVsync);
174 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
175 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
176 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
177}

◆ TEST() [63/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
FrameNumberTraceArgIsValid   
)

Definition at line 288 of file frame_timings_recorder_unittests.cc.

288 {
289 auto recorder = std::make_unique<FrameTimingsRecorder>();
290
291 char buff[50];
292 sprintf(buff, "%d", static_cast<int>(recorder->GetFrameNumber()));
293 std::string actual_arg = buff;
294 std::string expected_arg = recorder->GetFrameNumberTraceArg();
295
296 ASSERT_EQ(actual_arg, expected_arg);
297}

◆ TEST() [64/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordBuildTimes   
)

Definition at line 30 of file frame_timings_recorder_unittests.cc.

30 {
31 auto recorder = std::make_unique<FrameTimingsRecorder>();
32
33 const auto st = fml::TimePoint::Now();
34 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
35 recorder->RecordVsync(st, en);
36
37 const auto build_start = fml::TimePoint::Now();
38 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
39 recorder->RecordBuildStart(build_start);
40 recorder->RecordBuildEnd(build_end);
41
42 ASSERT_EQ(build_start, recorder->GetBuildStartTime());
43 ASSERT_EQ(build_end, recorder->GetBuildEndTime());
44}
static constexpr TimeDelta FromMillisecondsF(double millis)
Definition: time_delta.h:57

◆ TEST() [65/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordersHaveUniqueFrameNumbers   
)

Definition at line 152 of file frame_timings_recorder_unittests.cc.

152 {
153 auto recorder1 = std::make_unique<FrameTimingsRecorder>();
154 auto recorder2 = std::make_unique<FrameTimingsRecorder>();
155
156 ASSERT_TRUE(recorder2->GetFrameNumber() > recorder1->GetFrameNumber());
157}

◆ TEST() [66/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordRasterTimes   
)

Definition at line 46 of file frame_timings_recorder_unittests.cc.

46 {
47 auto recorder = std::make_unique<FrameTimingsRecorder>();
48
49 const auto st = fml::TimePoint::Now();
50 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
51 recorder->RecordVsync(st, en);
52
53 const auto build_start = fml::TimePoint::Now();
54 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
55 recorder->RecordBuildStart(build_start);
56 recorder->RecordBuildEnd(build_end);
57
58 using namespace std::chrono_literals;
59
60 const auto raster_start = fml::TimePoint::Now();
61 recorder->RecordRasterStart(raster_start);
62 const auto before_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
63 std::this_thread::sleep_for(1ms);
64 const auto timing = recorder->RecordRasterEnd();
65 std::this_thread::sleep_for(1ms);
66 const auto after_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
67
68 ASSERT_EQ(raster_start, recorder->GetRasterStartTime());
69 ASSERT_GT(recorder->GetRasterEndWallTime(), before_raster_end_wall_time);
70 ASSERT_LT(recorder->GetRasterEndWallTime(), after_raster_end_wall_time);
71 ASSERT_EQ(recorder->GetFrameNumber(), timing.GetFrameNumber());
72 ASSERT_EQ(recorder->GetLayerCacheCount(), 0u);
73 ASSERT_EQ(recorder->GetLayerCacheBytes(), 0u);
74 ASSERT_EQ(recorder->GetPictureCacheCount(), 0u);
75 ASSERT_EQ(recorder->GetPictureCacheBytes(), 0u);
76}
static TimePoint CurrentWallTime()
Definition: time_point.cc:57

◆ TEST() [67/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordRasterTimesWithCache   
)

Definition at line 78 of file frame_timings_recorder_unittests.cc.

78 {
79 auto recorder = std::make_unique<FrameTimingsRecorder>();
80
81 const auto st = fml::TimePoint::Now();
82 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
83 recorder->RecordVsync(st, en);
84
85 const auto build_start = fml::TimePoint::Now();
86 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
87 recorder->RecordBuildStart(build_start);
88 recorder->RecordBuildEnd(build_end);
89
90 using namespace std::chrono_literals;
91
93 cache.BeginFrame();
94
95 const auto raster_start = fml::TimePoint::Now();
96 recorder->RecordRasterStart(raster_start);
97
98 cache.AddMockLayer(100, 100);
99 size_t layer_bytes = cache.EstimateLayerCacheByteSize();
100 EXPECT_GT(layer_bytes, 0u);
101 cache.AddMockPicture(100, 100);
102 size_t picture_bytes = cache.EstimatePictureCacheByteSize();
103 EXPECT_GT(picture_bytes, 0u);
104 cache.EvictUnusedCacheEntries();
105
106 cache.EndFrame();
107
108 const auto before_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
109 std::this_thread::sleep_for(1ms);
110 const auto timing = recorder->RecordRasterEnd(&cache);
111 std::this_thread::sleep_for(1ms);
112 const auto after_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
113
114 ASSERT_EQ(raster_start, recorder->GetRasterStartTime());
115 ASSERT_GT(recorder->GetRasterEndWallTime(), before_raster_end_wall_time);
116 ASSERT_LT(recorder->GetRasterEndWallTime(), after_raster_end_wall_time);
117 ASSERT_EQ(recorder->GetFrameNumber(), timing.GetFrameNumber());
118 ASSERT_EQ(recorder->GetLayerCacheCount(), 1u);
119 ASSERT_EQ(recorder->GetLayerCacheBytes(), layer_bytes);
120 ASSERT_EQ(recorder->GetPictureCacheCount(), 1u);
121 ASSERT_EQ(recorder->GetPictureCacheBytes(), picture_bytes);
122}

◆ TEST() [68/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordVsync   
)

Definition at line 20 of file frame_timings_recorder_unittests.cc.

20 {
21 auto recorder = std::make_unique<FrameTimingsRecorder>();
22 const auto st = fml::TimePoint::Now();
23 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
24 recorder->RecordVsync(st, en);
25
26 ASSERT_EQ(st, recorder->GetVsyncStartTime());
27 ASSERT_EQ(en, recorder->GetVsyncTargetTime());
28}

◆ TEST() [69/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ThrowWhenRecordBuildBeforeVsync   
)

Definition at line 128 of file frame_timings_recorder_unittests.cc.

128 {
129 auto recorder = std::make_unique<FrameTimingsRecorder>();
130
131 const auto build_start = fml::TimePoint::Now();
132 fml::Status status = recorder->RecordBuildStartImpl(build_start);
133 EXPECT_FALSE(status.ok());
134 EXPECT_EQ(status.message(), "Check failed: state_ == State::kVsync.");
135}
bool ok() const
Definition: status.h:71
std::string_view message() const
Definition: status.h:75

◆ TEST() [70/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ThrowWhenRecordRasterBeforeBuildEnd   
)

Definition at line 137 of file frame_timings_recorder_unittests.cc.

137 {
138 auto recorder = std::make_unique<FrameTimingsRecorder>();
139
140 const auto st = fml::TimePoint::Now();
141 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
142 recorder->RecordVsync(st, en);
143
144 const auto raster_start = fml::TimePoint::Now();
145 fml::Status status = recorder->RecordRasterStartImpl(raster_start);
146 EXPECT_FALSE(status.ok());
147 EXPECT_EQ(status.message(), "Check failed: state_ == State::kBuildEnd.");
148}

◆ TEST() [71/363]

flutter::TEST ( IncomingMessageDispatcher  ,
BlockInputFalse   
)

Definition at line 39 of file incoming_message_dispatcher_unittests.cc.

39 {
40 FlutterDesktopMessengerRef messenger = nullptr;
41 auto dispatcher = std::make_unique<IncomingMessageDispatcher>(messenger);
42 bool did_call[3] = {false, false, false};
43 dispatcher->SetMessageCallback(
44 "hello",
45 [](FlutterDesktopMessengerRef messenger,
47 void* user_data) { reinterpret_cast<bool*>(user_data)[0] = true; },
48 &did_call);
50 .struct_size = sizeof(FlutterDesktopMessage),
51 .channel = "hello",
52 .message = nullptr,
53 .message_size = 0,
54 .response_handle = nullptr,
55 };
56 dispatcher->HandleMessage(
57 message, [&did_call] { did_call[1] = true; },
58 [&did_call] { did_call[2] = true; });
59 EXPECT_TRUE(did_call[0]);
60 EXPECT_FALSE(did_call[1]);
61 EXPECT_FALSE(did_call[2]);
62}

◆ TEST() [72/363]

flutter::TEST ( IncomingMessageDispatcher  ,
BlockInputTrue   
)

Definition at line 64 of file incoming_message_dispatcher_unittests.cc.

64 {
65 FlutterDesktopMessengerRef messenger = nullptr;
66 auto dispatcher = std::make_unique<IncomingMessageDispatcher>(messenger);
67 static int counter = 0;
68 int did_call[3] = {-1, -1, -1};
69 dispatcher->EnableInputBlockingForChannel("hello");
70 dispatcher->SetMessageCallback(
71 "hello",
72 [](FlutterDesktopMessengerRef messenger,
74 void* user_data) { reinterpret_cast<int*>(user_data)[counter++] = 1; },
75 &did_call);
77 .struct_size = sizeof(FlutterDesktopMessage),
78 .channel = "hello",
79 .message = nullptr,
80 .message_size = 0,
81 .response_handle = nullptr,
82 };
83 dispatcher->HandleMessage(
84 message, [&did_call] { did_call[counter++] = 0; },
85 [&did_call] { did_call[counter++] = 2; });
86 EXPECT_EQ(did_call[0], 0);
87 EXPECT_EQ(did_call[1], 1);
88 EXPECT_EQ(did_call[2], 2);
89}

◆ TEST() [73/363]

flutter::TEST ( IncomingMessageDispatcher  ,
SetHandle   
)

Definition at line 10 of file incoming_message_dispatcher_unittests.cc.

10 {
12 reinterpret_cast<FlutterDesktopMessengerRef>(0xfeedface);
13 const uint8_t* message_data = reinterpret_cast<const uint8_t*>(0xcafebabe);
14 auto dispatcher = std::make_unique<IncomingMessageDispatcher>(messenger);
15 bool did_call = false;
16 dispatcher->SetMessageCallback(
17 "hello",
18 [](FlutterDesktopMessengerRef messenger,
20 EXPECT_EQ(messenger,
21 reinterpret_cast<FlutterDesktopMessengerRef>(0xfeedface));
22 EXPECT_EQ(message->message,
23 reinterpret_cast<const uint8_t*>(0xcafebabe));
24 EXPECT_EQ(message->message_size, 123u);
25 *reinterpret_cast<bool*>(user_data) = true;
26 },
27 &did_call);
29 .struct_size = sizeof(FlutterDesktopMessage),
30 .channel = "hello",
31 .message = message_data,
32 .message_size = 123,
33 .response_handle = nullptr,
34 };
35 dispatcher->HandleMessage(message);
36 EXPECT_TRUE(did_call);
37}

◆ TEST() [74/363]

flutter::TEST ( JsonMessageCodec  ,
EncodeDecode   
)

Definition at line 29 of file json_message_codec_unittests.cc.

29 {
30 // NOLINTNEXTLINE(clang-analyzer-core.NullDereference)
31 rapidjson::Document array(rapidjson::kArrayType);
32 auto& allocator = array.GetAllocator();
33
34 array.PushBack("string", allocator);
35
36 rapidjson::Value map(rapidjson::kObjectType);
37 map.AddMember("a", -7, allocator);
38 map.AddMember("b", std::numeric_limits<int>::max(), allocator);
39 map.AddMember("c", 3.14159, allocator);
40 map.AddMember("d", true, allocator);
41 map.AddMember("e", rapidjson::Value(), allocator);
42 array.PushBack(map, allocator);
43
44 CheckEncodeDecode(array);
45}
static void CheckEncodeDecode(const EncodableValue &value, const std::vector< uint8_t > &expected_encoding, const StandardCodecSerializer *serializer=nullptr, const std::function< bool(const EncodableValue &a, const EncodableValue &b)> &custom_comparator=nullptr)
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition: SkVx.h:680

◆ TEST() [75/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesErrorEnvelopesWithDetails   
)

Definition at line 125 of file json_method_codec_unittests.cc.

125 {
126 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
127 // NOLINTNEXTLINE(clang-analyzer-core.NullDereference)
128 rapidjson::Document details(rapidjson::kArrayType);
129 auto& allocator = details.GetAllocator();
130 details.PushBack("a", allocator);
131 details.PushBack(42, allocator);
132 auto encoded =
133 codec.EncodeErrorEnvelope("errorCode", "something failed", &details);
134 ASSERT_NE(encoded.get(), nullptr);
135 std::vector<uint8_t> bytes = {
136 '[', '"', 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e', '"', ',', '"',
137 's', 'o', 'm', 'e', 't', 'h', 'i', 'n', 'g', ' ', 'f', 'a', 'i', 'l',
138 'e', 'd', '"', ',', '[', '"', 'a', '"', ',', '4', '2', ']', ']',
139 };
140 EXPECT_EQ(*encoded, bytes);
141
142 bool decoded_successfully = false;
143 MethodResultFunctions<rapidjson::Document> result_handler(
144 nullptr,
145 [&decoded_successfully](const std::string& code,
146 const std::string& message,
147 const rapidjson::Document* details) {
148 decoded_successfully = true;
149 EXPECT_EQ(code, "errorCode");
150 EXPECT_EQ(message, "something failed");
151 EXPECT_TRUE(details->IsArray());
152 EXPECT_EQ(std::string((*details)[0].GetString()), "a");
153 EXPECT_EQ((*details)[1].GetInt(), 42);
154 },
155 nullptr);
156 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
157 &result_handler);
158 EXPECT_TRUE(decoded_successfully);
159}
bool DecodeAndProcessResponseEnvelope(const uint8_t *response, size_t response_size, MethodResult< T > *result) const
Definition: method_codec.h:75
std::unique_ptr< std::vector< uint8_t > > EncodeErrorEnvelope(const std::string &error_code, const std::string &error_message="", const T *error_details=nullptr) const
Definition: method_codec.h:62

◆ TEST() [76/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesErrorEnvelopesWithNulls   
)

Definition at line 98 of file json_method_codec_unittests.cc.

98 {
99 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
100 auto encoded = codec.EncodeErrorEnvelope("errorCode");
101 ASSERT_TRUE(encoded);
102 std::vector<uint8_t> bytes = {
103 '[', '"', 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e',
104 '"', ',', '"', '"', ',', 'n', 'u', 'l', 'l', ']',
105 };
106 EXPECT_EQ(*encoded, bytes);
107
108 bool decoded_successfully = false;
109 MethodResultFunctions<rapidjson::Document> result_handler(
110 nullptr,
111 [&decoded_successfully](const std::string& code,
112 const std::string& message,
113 const rapidjson::Document* details) {
114 decoded_successfully = true;
115 EXPECT_EQ(code, "errorCode");
116 EXPECT_EQ(message, "");
117 EXPECT_EQ(details, nullptr);
118 },
119 nullptr);
120 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
121 &result_handler);
122 EXPECT_TRUE(decoded_successfully);
123}

◆ TEST() [77/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesMethodCallsWithArgument   
)

Definition at line 42 of file json_method_codec_unittests.cc.

42 {
43 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
44
45 auto arguments = std::make_unique<rapidjson::Document>(rapidjson::kArrayType);
46 auto& allocator = arguments->GetAllocator();
47 arguments->PushBack(42, allocator);
48 arguments->PushBack("world", allocator);
49 MethodCall<rapidjson::Document> call("hello", std::move(arguments));
50 auto encoded = codec.EncodeMethodCall(call);
51 ASSERT_TRUE(encoded);
52 std::unique_ptr<MethodCall<rapidjson::Document>> decoded =
53 codec.DecodeMethodCall(*encoded);
54 ASSERT_TRUE(decoded);
55 EXPECT_TRUE(MethodCallsAreEqual(call, *decoded));
56}
std::unique_ptr< MethodCall< T > > DecodeMethodCall(const uint8_t *message, size_t message_size) const
Definition: method_codec.h:32

◆ TEST() [78/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesMethodCallsWithNullArguments   
)

Definition at line 31 of file json_method_codec_unittests.cc.

31 {
32 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
33 MethodCall<rapidjson::Document> call("hello", nullptr);
34 auto encoded = codec.EncodeMethodCall(call);
35 ASSERT_TRUE(encoded);
36 std::unique_ptr<MethodCall<rapidjson::Document>> decoded =
37 codec.DecodeMethodCall(*encoded);
38 ASSERT_TRUE(decoded);
39 EXPECT_TRUE(MethodCallsAreEqual(call, *decoded));
40}

◆ TEST() [79/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesSuccessEnvelopesWithNullResult   
)

Definition at line 58 of file json_method_codec_unittests.cc.

58 {
59 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
60 auto encoded = codec.EncodeSuccessEnvelope();
61 ASSERT_TRUE(encoded);
62 std::vector<uint8_t> bytes = {'[', 'n', 'u', 'l', 'l', ']'};
63 EXPECT_EQ(*encoded, bytes);
64
65 bool decoded_successfully = false;
66 MethodResultFunctions<rapidjson::Document> result_handler(
67 [&decoded_successfully](const rapidjson::Document* result) {
68 decoded_successfully = true;
69 EXPECT_EQ(result, nullptr);
70 },
71 nullptr, nullptr);
72 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
73 &result_handler);
74 EXPECT_TRUE(decoded_successfully);
75}
std::unique_ptr< std::vector< uint8_t > > EncodeSuccessEnvelope(const T *result=nullptr) const
Definition: method_codec.h:55

◆ TEST() [80/363]

flutter::TEST ( JsonMethodCodec  ,
HandlesSuccessEnvelopesWithResult   
)

Definition at line 77 of file json_method_codec_unittests.cc.

77 {
78 const JsonMethodCodec& codec = JsonMethodCodec::GetInstance();
79 rapidjson::Document result;
80 result.SetInt(42);
81 auto encoded = codec.EncodeSuccessEnvelope(&result);
82 ASSERT_TRUE(encoded);
83 std::vector<uint8_t> bytes = {'[', '4', '2', ']'};
84 EXPECT_EQ(*encoded, bytes);
85
86 bool decoded_successfully = false;
87 MethodResultFunctions<rapidjson::Document> result_handler(
88 [&decoded_successfully](const rapidjson::Document* result) {
89 decoded_successfully = true;
90 EXPECT_EQ(result->GetInt(), 42);
91 },
92 nullptr, nullptr);
93 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
94 &result_handler);
95 EXPECT_TRUE(decoded_successfully);
96}

◆ TEST() [81/363]

flutter::TEST ( MethodCallTest  ,
Basic   
)

Definition at line 14 of file method_call_unittests.cc.

14 {
15 const std::string method_name("method_name");
16 const int argument = 42;
17 MethodCall<int> method_call(method_name, std::make_unique<int>(argument));
18 EXPECT_EQ(method_call.method_name(), method_name);
19 ASSERT_NE(method_call.arguments(), nullptr);
20 EXPECT_EQ(*method_call.arguments(), 42);
21}
G_BEGIN_DECLS G_MODULE_EXPORT FlMethodCall * method_call

◆ TEST() [82/363]

flutter::TEST ( MethodChannelTest  ,
Error   
)

Definition at line 37 of file method_result_functions_unittests.cc.

37 {
38 bool called = false;
39 std::string error_code = "a";
40 std::string error_message = "b";
41 int error_details = 1;
43 nullptr,
44 [&called, error_code, error_message, error_details](
45 const std::string& code, const std::string& message,
46 const int* details) {
47 called = true;
48 EXPECT_EQ(code, error_code);
49 EXPECT_EQ(message, error_message);
50 EXPECT_EQ(*details, error_details);
51 },
52 nullptr);
53 result.Error(error_code, error_message, error_details);
54 EXPECT_TRUE(called);
55}

◆ TEST() [83/363]

flutter::TEST ( MethodChannelTest  ,
InvokeNotImplemented   
)

Definition at line 145 of file method_channel_unittests.cc.

145 {
146 TestBinaryMessenger messenger;
147 const std::string channel_name("some_channel");
148 MethodChannel channel(&messenger, channel_name,
149 &StandardMethodCodec::GetInstance());
150
151 bool received_not_implemented = false;
152 auto result_handler = std::make_unique<MethodResultFunctions<>>(
153 nullptr, nullptr,
154 [&received_not_implemented]() { received_not_implemented = true; });
155
156 channel.InvokeMethod("foo", nullptr, std::move(result_handler));
157 EXPECT_EQ(messenger.send_called(), true);
158 ASSERT_NE(messenger.last_reply_handler(), nullptr);
159
160 // Call the underlying reply handler to ensure it's reported as unimplemented.
161 messenger.last_reply_handler()(nullptr, 0);
162 EXPECT_TRUE(received_not_implemented);
163}

◆ TEST() [84/363]

flutter::TEST ( MethodChannelTest  ,
InvokeWithoutResponse   
)

Definition at line 107 of file method_channel_unittests.cc.

107 {
108 TestBinaryMessenger messenger;
109 const std::string channel_name("some_channel");
110 MethodChannel channel(&messenger, channel_name,
111 &StandardMethodCodec::GetInstance());
112
113 channel.InvokeMethod("foo", nullptr);
114 EXPECT_TRUE(messenger.send_called());
115 EXPECT_EQ(messenger.last_reply_handler(), nullptr);
116}

◆ TEST() [85/363]

flutter::TEST ( MethodChannelTest  ,
InvokeWithResponse   
)

Definition at line 118 of file method_channel_unittests.cc.

118 {
119 TestBinaryMessenger messenger;
120 const std::string channel_name("some_channel");
121 MethodChannel channel(&messenger, channel_name,
122 &StandardMethodCodec::GetInstance());
123
124 bool received_reply = false;
125 const std::string reply = "bar";
126 auto result_handler = std::make_unique<MethodResultFunctions<>>(
127 [&received_reply, reply](const EncodableValue* success_value) {
128 received_reply = true;
129 EXPECT_EQ(std::get<std::string>(*success_value), reply);
130 },
131 nullptr, nullptr);
132
133 channel.InvokeMethod("foo", nullptr, std::move(result_handler));
134 EXPECT_TRUE(messenger.send_called());
135 ASSERT_NE(messenger.last_reply_handler(), nullptr);
136
137 // Call the underlying reply handler to ensure it's processed correctly.
138 EncodableValue reply_value(reply);
139 std::unique_ptr<std::vector<uint8_t>> encoded_reply =
140 StandardMethodCodec::GetInstance().EncodeSuccessEnvelope(&reply_value);
141 messenger.last_reply_handler()(encoded_reply->data(), encoded_reply->size());
142 EXPECT_TRUE(received_reply);
143}

◆ TEST() [86/363]

flutter::TEST ( MethodChannelTest  ,
NoHandlers   
)

Definition at line 15 of file method_result_functions_unittests.cc.

15 {
16 MethodResultFunctions<int> result(nullptr, nullptr, nullptr);
17 result.Success();
18 result.Error("error");
19 result.NotImplemented();
20}

◆ TEST() [87/363]

flutter::TEST ( MethodChannelTest  ,
NotImplemented   
)

Definition at line 58 of file method_result_functions_unittests.cc.

58 {
59 bool called = false;
60 MethodResultFunctions<int> result(nullptr, nullptr,
61 [&called]() { called = true; });
62 result.NotImplemented();
63 EXPECT_TRUE(called);
64}

◆ TEST() [88/363]

flutter::TEST ( MethodChannelTest  ,
Registration   
)

Definition at line 62 of file method_channel_unittests.cc.

62 {
63 TestBinaryMessenger messenger;
64 const std::string channel_name("some_channel");
65 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
66 MethodChannel channel(&messenger, channel_name, &codec);
67
68 bool callback_called = false;
69 const std::string method_name("hello");
70 channel.SetMethodCallHandler(
71 [&callback_called, method_name](const auto& call, auto result) {
72 callback_called = true;
73 // Ensure that the wrapper received a correctly decoded call and a
74 // result.
75 EXPECT_EQ(call.method_name(), method_name);
76 EXPECT_NE(result, nullptr);
77 result->Success();
78 });
79 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
80 EXPECT_NE(messenger.last_message_handler(), nullptr);
81 // Send a test message to trigger the handler test assertions.
82 MethodCall<> call(method_name, nullptr);
83 auto message = codec.EncodeMethodCall(call);
84
85 messenger.last_message_handler()(
86 message->data(), message->size(),
87 [](const uint8_t* reply, size_t reply_size) {});
88 EXPECT_TRUE(callback_called);
89}

◆ TEST() [89/363]

flutter::TEST ( MethodChannelTest  ,
Resize   
)

Definition at line 167 of file method_channel_unittests.cc.

167 {
168 TestBinaryMessenger messenger;
169 const std::string channel_name("flutter/test");
170 MethodChannel channel(&messenger, channel_name,
171 &StandardMethodCodec::GetInstance());
172
173 channel.Resize(3);
174
175 // Because the Dart implementation for the control channel implements its own
176 // custom deserialization logic, this test compares the generated bytes array
177 // to the expected one (for instance, the deserialization logic expects the
178 // size parameter of the resize method call to be an uint32).
179 //
180 // The expected content was created from the following Dart code:
181 // MethodCall call = MethodCall('resize', ['flutter/test',3]);
182 // StandardMethodCodec().encodeMethodCall(call).buffer.asUint8List();
183 const int expected_message_size = 29;
184
185 EXPECT_EQ(messenger.send_called(), true);
186 EXPECT_EQ(static_cast<int>(messenger.last_message().size()),
187 expected_message_size);
188
189 int expected[expected_message_size] = {
190 7, 6, 114, 101, 115, 105, 122, 101, 12, 2, 7, 12, 102, 108, 117,
191 116, 116, 101, 114, 47, 116, 101, 115, 116, 3, 3, 0, 0, 0};
192 for (int i = 0; i < expected_message_size; i++) {
193 EXPECT_EQ(messenger.last_message()[i], expected[i]);
194 }
195}

◆ TEST() [90/363]

flutter::TEST ( MethodChannelTest  ,
SetWarnsOnOverflow   
)

Definition at line 199 of file method_channel_unittests.cc.

199 {
200 TestBinaryMessenger messenger;
201
202 const std::string channel_name("flutter/test");
203 MethodChannel channel(&messenger, channel_name,
204 &StandardMethodCodec::GetInstance());
205
206 channel.SetWarnsOnOverflow(false);
207
208 // The expected content was created from the following Dart code:
209 // MethodCall call = MethodCall('overflow',['flutter/test', true]);
210 // StandardMethodCodec().encodeMethodCall(call).buffer.asUint8List();
211 const int expected_message_size = 27;
212
213 EXPECT_EQ(messenger.send_called(), true);
214 EXPECT_EQ(static_cast<int>(messenger.last_message().size()),
215 expected_message_size);
216
217 int expected[expected_message_size] = {
218 7, 8, 111, 118, 101, 114, 102, 108, 111, 119, 12, 2, 7, 12,
219 102, 108, 117, 116, 116, 101, 114, 47, 116, 101, 115, 116, 1};
220 for (int i = 0; i < expected_message_size; i++) {
221 EXPECT_EQ(messenger.last_message()[i], expected[i]);
222 }
223}

◆ TEST() [91/363]

flutter::TEST ( MethodChannelTest  ,
Success   
)

Definition at line 23 of file method_result_functions_unittests.cc.

23 {
24 bool called = false;
25 int value = 1;
27 [&called, value](const int* i) {
28 called = true;
29 EXPECT_EQ(*i, value);
30 },
31 nullptr, nullptr);
32 result.Success(value);
33 EXPECT_TRUE(called);
34}

◆ TEST() [92/363]

flutter::TEST ( MethodChannelTest  ,
Unregistration   
)

Definition at line 92 of file method_channel_unittests.cc.

92 {
93 TestBinaryMessenger messenger;
94 const std::string channel_name("some_channel");
95 MethodChannel channel(&messenger, channel_name,
96 &StandardMethodCodec::GetInstance());
97
98 channel.SetMethodCallHandler([](const auto& call, auto result) {});
99 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
100 EXPECT_NE(messenger.last_message_handler(), nullptr);
101
102 channel.SetMethodCallHandler(nullptr);
103 EXPECT_EQ(messenger.last_message_handler_channel(), channel_name);
104 EXPECT_EQ(messenger.last_message_handler(), nullptr);
105}

◆ TEST() [93/363]

flutter::TEST ( PathUtilsTest  ,
ExecutableDirector   
)

Definition at line 12 of file path_utils_unittests.cc.

12 {
14#if defined(__linux__) || defined(_WIN32)
15 EXPECT_EQ(exe_directory.empty(), false);
16 EXPECT_EQ(exe_directory.is_absolute(), true);
17#else
18 // On platforms where it's not implemented, it should indicate that
19 // by returning an empty path.
20 EXPECT_EQ(exe_directory.empty(), true);
21#endif
22}
std::filesystem::path GetExecutableDirectory()
Definition: path_utils.cc:16

◆ TEST() [94/363]

flutter::TEST ( PluginRegistrarGlfwTest  ,
GetView   
)

Definition at line 37 of file plugin_registrar_glfw_unittests.cc.

37 {
39 std::make_unique<testing::StubFlutterGlfwApi>());
40 PluginRegistrarGlfw registrar(
41 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
42 EXPECT_NE(registrar.window(), nullptr);
43}

◆ TEST() [95/363]

flutter::TEST ( PluginRegistrarGlfwTest  ,
PluginDestroyedBeforeRegistrar   
)

Definition at line 46 of file plugin_registrar_glfw_unittests.cc.

46 {
47 auto dummy_registrar_handle =
48 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
49 bool registrar_valid_at_destruction = false;
50 {
51 PluginRegistrarGlfw registrar(dummy_registrar_handle);
52
53 auto plugin = std::make_unique<TestPlugin>(&registrar,
54 &registrar_valid_at_destruction);
55 registrar.AddPlugin(std::move(plugin));
56 }
57 EXPECT_TRUE(registrar_valid_at_destruction);
58}

◆ TEST() [96/363]

flutter::TEST ( PluginRegistrarTest  ,
ManagerDifferentInstances   
)

Definition at line 175 of file plugin_registrar_unittests.cc.

175 {
176 PluginRegistrarManager* manager = PluginRegistrarManager::GetInstance();
177 manager->Reset();
178
179 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
180
181 auto dummy_registrar_handle_a =
182 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
183 auto dummy_registrar_handle_b =
184 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(2);
185
186 EXPECT_NE(manager->GetRegistrar<PluginRegistrar>(dummy_registrar_handle_a),
187 manager->GetRegistrar<PluginRegistrar>(dummy_registrar_handle_b));
188}
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
Definition: switches.h:218

◆ TEST() [97/363]

flutter::TEST ( PluginRegistrarTest  ,
ManagerRemovesOnDestruction   
)

Definition at line 192 of file plugin_registrar_unittests.cc.

192 {
193 PluginRegistrarManager* manager = PluginRegistrarManager::GetInstance();
194 manager->Reset();
195
196 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
197 auto test_api = static_cast<TestApi*>(scoped_api_stub.stub());
198
199 auto dummy_registrar_handle =
200 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
201 auto* wrapper =
202 manager->GetRegistrar<TestPluginRegistrar>(dummy_registrar_handle);
203
204 // Simulate destruction of the reference, and ensure that the wrapper
205 // is destroyed.
206 EXPECT_NE(test_api->last_destruction_callback_set(), nullptr);
207 bool destroyed = false;
208 wrapper->SetDestructionCallback([&destroyed]() { destroyed = true; });
209 test_api->last_destruction_callback_set()(dummy_registrar_handle);
210 EXPECT_EQ(destroyed, true);
211
212 // Requesting the wrapper should now create a new object.
213 EXPECT_NE(manager->GetRegistrar<TestPluginRegistrar>(dummy_registrar_handle),
214 nullptr);
215}

◆ TEST() [98/363]

flutter::TEST ( PluginRegistrarTest  ,
ManagerSameInstance   
)

Definition at line 160 of file plugin_registrar_unittests.cc.

160 {
161 PluginRegistrarManager* manager = PluginRegistrarManager::GetInstance();
162 manager->Reset();
163
164 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
165
166 auto dummy_registrar_handle =
167 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
168
169 EXPECT_EQ(manager->GetRegistrar<PluginRegistrar>(dummy_registrar_handle),
170 manager->GetRegistrar<PluginRegistrar>(dummy_registrar_handle));
171}

◆ TEST() [99/363]

flutter::TEST ( PluginRegistrarTest  ,
MessengerSend   
)

Definition at line 120 of file plugin_registrar_unittests.cc.

120 {
121 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
122 auto test_api = static_cast<TestApi*>(scoped_api_stub.stub());
123
124 auto dummy_registrar_handle =
125 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
126 PluginRegistrar registrar(dummy_registrar_handle);
127 BinaryMessenger* messenger = registrar.messenger();
128
129 std::vector<uint8_t> message = {1, 2, 3, 4};
130 messenger->Send("some_channel", &message[0], message.size());
131 EXPECT_EQ(test_api->last_data_sent(), &message[0]);
132}
virtual void Send(const std::string &channel, const uint8_t *message, size_t message_size, BinaryReply reply=nullptr) const =0

◆ TEST() [100/363]

flutter::TEST ( PluginRegistrarTest  ,
MessengerSetMessageHandler   
)

Definition at line 136 of file plugin_registrar_unittests.cc.

136 {
137 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
138 auto test_api = static_cast<TestApi*>(scoped_api_stub.stub());
139
140 auto dummy_registrar_handle =
141 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
142 PluginRegistrar registrar(dummy_registrar_handle);
143 BinaryMessenger* messenger = registrar.messenger();
144 const std::string channel_name("foo");
145
146 // Register.
147 BinaryMessageHandler binary_handler = [](const uint8_t* message,
148 const size_t message_size,
149 const BinaryReply& reply) {};
150 messenger->SetMessageHandler(channel_name, std::move(binary_handler));
151 EXPECT_NE(test_api->last_message_callback_set(), nullptr);
152
153 // Unregister.
154 messenger->SetMessageHandler(channel_name, nullptr);
155 EXPECT_EQ(test_api->last_message_callback_set(), nullptr);
156}
virtual void SetMessageHandler(const std::string &channel, BinaryMessageHandler handler)=0
std::function< void(const uint8_t *message, size_t message_size, BinaryReply reply)> BinaryMessageHandler
std::function< void(const uint8_t *reply, size_t reply_size)> BinaryReply

◆ TEST() [101/363]

flutter::TEST ( PluginRegistrarTest  ,
PluginDestroyedBeforeRegistrar   
)

Definition at line 104 of file plugin_registrar_unittests.cc.

104 {
105 auto dummy_registrar_handle =
106 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
107 bool registrar_valid_at_destruction = false;
108 {
109 PluginRegistrar registrar(dummy_registrar_handle);
110
111 auto plugin = std::make_unique<TestPlugin>(&registrar,
112 &registrar_valid_at_destruction);
113 registrar.AddPlugin(std::move(plugin));
114 }
115 EXPECT_TRUE(registrar_valid_at_destruction);
116}

◆ TEST() [102/363]

flutter::TEST ( PluginRegistrarTest  ,
TextureRegistrarNotNull   
)

Definition at line 218 of file plugin_registrar_unittests.cc.

218 {
219 auto dummy_registrar_handle =
220 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
221 PluginRegistrar registrar(dummy_registrar_handle);
222
223 TextureRegistrar* texture_registrar = registrar.texture_registrar();
224
225 ASSERT_NE(texture_registrar, nullptr);
226}
G_BEGIN_DECLS FlTextureRegistrar * texture_registrar

◆ TEST() [103/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
CallsRegisteredDelegates   
)

Definition at line 161 of file plugin_registrar_windows_unittests.cc.

161 {
162 auto windows_api = std::make_unique<TestWindowsApi>();
163 EXPECT_CALL(*windows_api, PluginRegistrarGetView).WillOnce(Return(nullptr));
164 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
165 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
166 PluginRegistrarWindows registrar(
167 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
168
169 HWND dummy_hwnd;
170 bool called_a = false;
171 WindowProcDelegate delegate_a = [&called_a, &dummy_hwnd](
172 HWND hwnd, UINT message, WPARAM wparam,
173 LPARAM lparam) {
174 called_a = true;
175 EXPECT_EQ(hwnd, dummy_hwnd);
176 EXPECT_EQ(message, 2);
177 EXPECT_EQ(wparam, 3);
178 EXPECT_EQ(lparam, 4);
179 return std::optional<LRESULT>();
180 };
181 bool called_b = false;
182 WindowProcDelegate delegate_b = [&called_b](HWND hwnd, UINT message,
183 WPARAM wparam, LPARAM lparam) {
184 called_b = true;
185 return std::optional<LRESULT>();
186 };
187 int id_a = registrar.RegisterTopLevelWindowProcDelegate(delegate_a);
188 int id_b = registrar.RegisterTopLevelWindowProcDelegate(delegate_b);
189
190 LRESULT result = 0;
191 bool handled = test_api->last_registered_delegate()(
192 dummy_hwnd, 2, 3, 4, test_api->last_registered_user_data(), &result);
193 EXPECT_TRUE(called_a);
194 EXPECT_TRUE(called_b);
195 EXPECT_FALSE(handled);
196}
std::function< std::optional< LRESULT >(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)> WindowProcDelegate
LONG_PTR LRESULT
Definition: windows_types.h:61
unsigned int UINT
Definition: windows_types.h:32
UINT_PTR WPARAM
Definition: windows_types.h:59

◆ TEST() [104/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
GetView   
)

Definition at line 76 of file plugin_registrar_windows_unittests.cc.

76 {
77 auto windows_api = std::make_unique<TestWindowsApi>();
78 EXPECT_CALL(*windows_api, PluginRegistrarGetView)
79 .WillOnce(Return(reinterpret_cast<FlutterDesktopViewRef>(1)));
80
81 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
82 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
83 PluginRegistrarWindows registrar(
84 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
85
86 EXPECT_NE(registrar.GetView(), nullptr);
87}

◆ TEST() [105/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
GetViewById   
)

Definition at line 89 of file plugin_registrar_windows_unittests.cc.

89 {
90 auto windows_api = std::make_unique<TestWindowsApi>();
91 EXPECT_CALL(*windows_api, PluginRegistrarGetView)
92 .WillRepeatedly(Return(nullptr));
93 EXPECT_CALL(*windows_api, PluginRegistrarGetViewById(123))
94 .WillOnce(Return(reinterpret_cast<FlutterDesktopViewRef>(1)));
95 EXPECT_CALL(*windows_api, PluginRegistrarGetViewById(456))
96 .WillOnce(Return(nullptr));
97
98 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
99 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
100 PluginRegistrarWindows registrar(
101 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
102
103 EXPECT_EQ(registrar.GetView(), nullptr);
104 EXPECT_NE(registrar.GetViewById(123).get(), nullptr);
105 EXPECT_EQ(registrar.GetViewById(456).get(), nullptr);
106}

◆ TEST() [106/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
PluginDestroyedBeforeRegistrar   
)

Definition at line 109 of file plugin_registrar_windows_unittests.cc.

109 {
110 auto windows_api = std::make_unique<TestWindowsApi>();
111 EXPECT_CALL(*windows_api, PluginRegistrarGetView)
112 .WillRepeatedly(Return(reinterpret_cast<FlutterDesktopViewRef>(1)));
113 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
114 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
115 PluginRegistrarWindows registrar(
116 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
117
118 auto dummy_registrar_handle =
119 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
120 bool registrar_valid_at_destruction = false;
121 {
122 PluginRegistrarWindows registrar(dummy_registrar_handle);
123
124 auto plugin = std::make_unique<TestPlugin>(&registrar,
125 &registrar_valid_at_destruction);
126 registrar.AddPlugin(std::move(plugin));
127 }
128 EXPECT_TRUE(registrar_valid_at_destruction);
129}

◆ TEST() [107/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
RegisterUnregister   
)

Definition at line 131 of file plugin_registrar_windows_unittests.cc.

131 {
132 auto windows_api = std::make_unique<TestWindowsApi>();
133 EXPECT_CALL(*windows_api, PluginRegistrarGetView).WillOnce(Return(nullptr));
134 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
135 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
136 PluginRegistrarWindows registrar(
137 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
138
139 WindowProcDelegate delegate = [](HWND hwnd, UINT message, WPARAM wparam,
140 LPARAM lparam) {
141 return std::optional<LRESULT>();
142 };
143 int id_a = registrar.RegisterTopLevelWindowProcDelegate(delegate);
144 EXPECT_EQ(test_api->registered_delegate_count(), 1);
145 int id_b = registrar.RegisterTopLevelWindowProcDelegate(delegate);
146 // All the C++-level delegates are driven by a since C callback, so the
147 // registration count should stay the same.
148 EXPECT_EQ(test_api->registered_delegate_count(), 1);
149
150 // Unregistering one of the two delegates shouldn't cause the underlying C
151 // callback to be unregistered.
152 registrar.UnregisterTopLevelWindowProcDelegate(id_a);
153 EXPECT_EQ(test_api->registered_delegate_count(), 1);
154 // Unregistering both should unregister it.
155 registrar.UnregisterTopLevelWindowProcDelegate(id_b);
156 EXPECT_EQ(test_api->registered_delegate_count(), 0);
157
158 EXPECT_NE(id_a, id_b);
159}

◆ TEST() [108/363]

flutter::TEST ( PluginRegistrarWindowsTest  ,
StopsOnceHandled   
)

Definition at line 198 of file plugin_registrar_windows_unittests.cc.

198 {
199 auto windows_api = std::make_unique<TestWindowsApi>();
200 EXPECT_CALL(*windows_api, PluginRegistrarGetView).WillOnce(Return(nullptr));
201 testing::ScopedStubFlutterWindowsApi scoped_api_stub(std::move(windows_api));
202 auto test_api = static_cast<TestWindowsApi*>(scoped_api_stub.stub());
203 PluginRegistrarWindows registrar(
204 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1));
205
206 bool called_a = false;
207 WindowProcDelegate delegate_a = [&called_a](HWND hwnd, UINT message,
208 WPARAM wparam, LPARAM lparam) {
209 called_a = true;
210 return std::optional<LRESULT>(7);
211 };
212 bool called_b = false;
213 WindowProcDelegate delegate_b = [&called_b](HWND hwnd, UINT message,
214 WPARAM wparam, LPARAM lparam) {
215 called_b = true;
216 return std::optional<LRESULT>(7);
217 };
218 int id_a = registrar.RegisterTopLevelWindowProcDelegate(delegate_a);
219 int id_b = registrar.RegisterTopLevelWindowProcDelegate(delegate_b);
220
221 HWND dummy_hwnd;
222 LRESULT result = 0;
223 bool handled = test_api->last_registered_delegate()(
224 dummy_hwnd, 2, 3, 4, test_api->last_registered_user_data(), &result);
225 // Only one of the delegates should have been called, since each claims to
226 // have fully handled the message.
227 EXPECT_TRUE(called_a || called_b);
228 EXPECT_NE(called_a, called_b);
229 // The return value should propagate through.
230 EXPECT_TRUE(handled);
231 EXPECT_EQ(result, 7);
232}

◆ TEST() [109/363]

flutter::TEST ( Point  ,
SetsCoordinates   
)

Definition at line 11 of file geometry_unittests.cc.

11 {
12 Point point(-30.0, 42.0);
13 EXPECT_DOUBLE_EQ(-30.0, point.x());
14 EXPECT_DOUBLE_EQ(42.0, point.y());
15}

◆ TEST() [110/363]

flutter::TEST ( RasterizerTest  ,
create   
)

Definition at line 129 of file rasterizer_unittests.cc.

129 {
130 NiceMock<MockDelegate> delegate;
132 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
133 auto rasterizer = std::make_unique<Rasterizer>(delegate);
134 EXPECT_TRUE(rasterizer != nullptr);
135}

◆ TEST() [111/363]

flutter::TEST ( RasterizerTest  ,
drawEmptyPipeline   
)

Definition at line 151 of file rasterizer_unittests.cc.

151 {
152 std::string test_name =
153 ::testing::UnitTest::GetInstance()->current_test_info()->name();
154 ThreadHost thread_host("io.flutter.test." + test_name + ".",
155 ThreadHost::Type::kPlatform |
156 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
157 ThreadHost::Type::kUi);
158 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
159 thread_host.raster_thread->GetTaskRunner(),
160 thread_host.ui_thread->GetTaskRunner(),
161 thread_host.io_thread->GetTaskRunner());
162 NiceMock<MockDelegate> delegate;
164 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
165 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
166 auto rasterizer = std::make_unique<Rasterizer>(delegate);
167 auto surface = std::make_unique<NiceMock<MockSurface>>();
168 EXPECT_CALL(*surface, MakeRenderContextCurrent())
169 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
170 rasterizer->Setup(std::move(surface));
172 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
173 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
174 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
175 rasterizer->Draw(pipeline);
176 latch.Signal();
177 });
178 latch.Wait();
179}

◆ TEST() [112/363]

flutter::TEST ( RasterizerTest  ,
drawLastLayerTreeWithThreadsMergedExternalViewEmbedderAndEndFrameCalled   
)

Definition at line 408 of file rasterizer_unittests.cc.

409 {
410 std::string test_name =
411 ::testing::UnitTest::GetInstance()->current_test_info()->name();
412 ThreadHost thread_host("io.flutter.test." + test_name + ".",
413 ThreadHost::Type::kPlatform |
414 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
415 ThreadHost::Type::kUi);
417 TaskRunners task_runners("test",
418 fml::MessageLoop::GetCurrent().GetTaskRunner(),
419 fml::MessageLoop::GetCurrent().GetTaskRunner(),
420 thread_host.ui_thread->GetTaskRunner(),
421 thread_host.io_thread->GetTaskRunner());
422
423 NiceMock<MockDelegate> delegate;
425 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
426 EXPECT_CALL(delegate, GetTaskRunners())
427 .WillRepeatedly(ReturnRef(task_runners));
428 EXPECT_CALL(delegate, OnFrameRasterized(_));
429
430 auto rasterizer = std::make_unique<Rasterizer>(delegate);
431 auto surface = std::make_unique<NiceMock<MockSurface>>();
432
433 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
434 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
435 rasterizer->SetExternalViewEmbedder(external_view_embedder);
436
437 SurfaceFrame::FramebufferInfo framebuffer_info;
438 framebuffer_info.supports_readback = true;
439
440 auto surface_frame1 = std::make_unique<SurfaceFrame>(
441 /*surface=*/
442 nullptr, framebuffer_info,
443 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
444 /*frame_size=*/SkISize::Make(800, 600));
445 auto surface_frame2 = std::make_unique<SurfaceFrame>(
446 /*surface=*/
447 nullptr, framebuffer_info,
448 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
449 /*frame_size=*/SkISize::Make(800, 600));
450 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled())
451 .WillRepeatedly(Return(true));
452 // Prepare two frames for Draw() and DrawLastLayerTrees().
453 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
454 .WillOnce(Return(ByMove(std::move(surface_frame1))))
455 .WillOnce(Return(ByMove(std::move(surface_frame2))));
456 EXPECT_CALL(*surface, MakeRenderContextCurrent())
457 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
458 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
459 .WillRepeatedly(Return(true));
460
461 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
462 /*raster_thread_merger=*/_))
463 .Times(2);
464 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
465 /*frame_size=*/SkISize(),
466 /*device_pixel_ratio=*/2.0))
467 .Times(2);
468 EXPECT_CALL(*external_view_embedder,
469 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
470 .Times(2);
471 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
472 /*raster_thread_merger=*/_))
473 .Times(2);
474
475 rasterizer->Setup(std::move(surface));
476
477 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
478 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
479 /*frame_size=*/SkISize());
480 auto layer_tree_item = std::make_unique<FrameItem>(
481 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
482 kDevicePixelRatio),
484 PipelineProduceResult result =
485 pipeline->Produce().Complete(std::move(layer_tree_item));
486 EXPECT_TRUE(result.success);
487
488 // The Draw() will respectively call BeginFrame(), SubmitFlutterView() and
489 // EndFrame() one time.
490 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
491 rasterizer->Draw(pipeline);
492
493 // The DrawLastLayerTrees() will respectively call BeginFrame(),
494 // SubmitFlutterView() and EndFrame() one more time, totally 2 times.
495 rasterizer->DrawLastLayerTrees(CreateFinishedBuildRecorder());
496}
flutter::DlCanvas DlCanvas
Definition: SkSize.h:16

◆ TEST() [113/363]

flutter::TEST ( RasterizerTest  ,
drawLayerTreeWithCorrectFrameTimingWhenPipelineIsMoreAvailable   
)

Definition at line 1042 of file rasterizer_unittests.cc.

1043 {
1044 std::string test_name =
1045 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1046 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1047 ThreadHost::Type::kPlatform |
1048 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1049 ThreadHost::Type::kUi);
1050 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1051 thread_host.raster_thread->GetTaskRunner(),
1052 thread_host.ui_thread->GetTaskRunner(),
1053 thread_host.io_thread->GetTaskRunner());
1054 NiceMock<MockDelegate> delegate;
1056 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1057 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1058
1060 std::unique_ptr<Rasterizer> rasterizer;
1061 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1062 rasterizer = std::make_unique<Rasterizer>(delegate);
1063 latch.Signal();
1064 });
1065 latch.Wait();
1066
1067 auto surface = std::make_unique<NiceMock<MockSurface>>();
1068 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled())
1069 .WillRepeatedly(Return(true));
1070 ON_CALL(*surface, AcquireFrame(SkISize()))
1071 .WillByDefault(::testing::Invoke([] {
1072 SurfaceFrame::FramebufferInfo framebuffer_info;
1073 framebuffer_info.supports_readback = true;
1074 return std::make_unique<SurfaceFrame>(
1075 /*surface=*/
1076 nullptr, framebuffer_info,
1077 /*submit_callback=*/
1078 [](const SurfaceFrame& frame, DlCanvas*) { return true; },
1079 /*frame_size=*/SkISize::Make(800, 600));
1080 }));
1081 ON_CALL(*surface, MakeRenderContextCurrent())
1082 .WillByDefault(::testing::Invoke(
1083 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1084
1085 fml::CountDownLatch count_down_latch(2);
1086 auto first_timestamp = fml::TimePoint::Now();
1087 auto second_timestamp = first_timestamp + fml::TimeDelta::FromMilliseconds(8);
1088 std::vector<fml::TimePoint> timestamps = {first_timestamp, second_timestamp};
1089 int frame_rasterized_count = 0;
1090 EXPECT_CALL(delegate, OnFrameRasterized(_))
1091 .Times(2)
1092 .WillRepeatedly([&](const FrameTiming& frame_timing) {
1093 EXPECT_EQ(timestamps[frame_rasterized_count],
1094 frame_timing.Get(FrameTiming::kVsyncStart));
1095 EXPECT_EQ(timestamps[frame_rasterized_count],
1096 frame_timing.Get(FrameTiming::kBuildStart));
1097 EXPECT_EQ(timestamps[frame_rasterized_count],
1098 frame_timing.Get(FrameTiming::kBuildFinish));
1099 frame_rasterized_count++;
1100 count_down_latch.CountDown();
1101 });
1102
1103 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1104 rasterizer->Setup(std::move(surface));
1105 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1106 for (int i = 0; i < 2; i++) {
1107 auto layer_tree = std::make_unique<LayerTree>(
1108 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
1109 auto layer_tree_item = std::make_unique<FrameItem>(
1110 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1111 kDevicePixelRatio),
1112 CreateFinishedBuildRecorder(timestamps[i]));
1113 PipelineProduceResult result =
1114 pipeline->Produce().Complete(std::move(layer_tree_item));
1115 EXPECT_TRUE(result.success);
1116 EXPECT_EQ(result.is_first_item, i == 0);
1117 }
1118 // Although we only call 'Rasterizer::Draw' once, it will be called twice
1119 // finally because there are two items in the pipeline.
1120 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1121 rasterizer->Draw(pipeline);
1122 });
1123 count_down_latch.Wait();
1124 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1125 rasterizer.reset();
1126 latch.Signal();
1127 });
1128 latch.Wait();
1129}
ObjectPtr Invoke(const Library &lib, const char *name)

◆ TEST() [114/363]

flutter::TEST ( RasterizerTest  ,
drawMultipleViewsWithExternalViewEmbedder   
)

Definition at line 659 of file rasterizer_unittests.cc.

659 {
660 std::string test_name =
661 ::testing::UnitTest::GetInstance()->current_test_info()->name();
662 ThreadHost thread_host("io.flutter.test." + test_name + ".",
663 ThreadHost::Type::kPlatform |
664 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
665 ThreadHost::Type::kUi);
666 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
667 thread_host.raster_thread->GetTaskRunner(),
668 thread_host.ui_thread->GetTaskRunner(),
669 thread_host.io_thread->GetTaskRunner());
670 NiceMock<MockDelegate> delegate;
672 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
673 EXPECT_CALL(delegate, GetTaskRunners())
674 .WillRepeatedly(ReturnRef(task_runners));
675 EXPECT_CALL(delegate, OnFrameRasterized(_));
676 auto rasterizer = std::make_unique<Rasterizer>(delegate);
677 auto surface = std::make_unique<NiceMock<MockSurface>>();
678 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
679 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
680 rasterizer->SetExternalViewEmbedder(external_view_embedder);
681 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
682 .WillRepeatedly(Return(false));
683 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
684 EXPECT_CALL(*surface, AcquireFrame(SkISize())).Times(2);
685 ON_CALL(*surface, AcquireFrame).WillByDefault([](const SkISize& size) {
686 SurfaceFrame::FramebufferInfo framebuffer_info;
687 framebuffer_info.supports_readback = true;
688 return std::make_unique<SurfaceFrame>(
689 /*surface=*/
690 nullptr, framebuffer_info,
691 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
692 /*frame_size=*/SkISize::Make(800, 600));
693 });
694 EXPECT_CALL(*surface, MakeRenderContextCurrent())
695 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
696
697 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
698 /*raster_thread_merger=*/_))
699 .Times(1);
700 EXPECT_CALL(*external_view_embedder,
701 PrepareFlutterView(/*frame_size=*/SkISize(),
702 /*device_pixel_ratio=*/1.5))
703 .Times(1);
704 EXPECT_CALL(*external_view_embedder,
705 SubmitFlutterView(/*flutter_view_id=*/0, _, _, _))
706 .Times(1);
707 EXPECT_CALL(*external_view_embedder,
708 PrepareFlutterView(/*frame_size=*/SkISize(),
709 /*device_pixel_ratio=*/2.0))
710 .Times(1);
711 EXPECT_CALL(*external_view_embedder,
712 SubmitFlutterView(/*flutter_view_id=*/1, _, _, _))
713 .Times(1);
714 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
715 /*raster_thread_merger=*/_))
716 .Times(1);
717
718 rasterizer->Setup(std::move(surface));
720 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
721 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
722 std::vector<std::unique_ptr<LayerTreeTask>> tasks;
723 tasks.push_back(std::make_unique<LayerTreeTask>(
724 0, std::make_unique<LayerTree>(nullptr, SkISize()), 1.5));
725 tasks.push_back(std::make_unique<LayerTreeTask>(
726 1, std::make_unique<LayerTree>(nullptr, SkISize()), 2.0));
727 auto layer_tree_item = std::make_unique<FrameItem>(
728 std::move(tasks), CreateFinishedBuildRecorder());
729 PipelineProduceResult result =
730 pipeline->Produce().Complete(std::move(layer_tree_item));
731 EXPECT_TRUE(result.success);
732 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
733 rasterizer->Draw(pipeline);
734 latch.Signal();
735 });
736 latch.Wait();
737}

◆ TEST() [115/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderAndThreadMergerNotMergedExternalViewEmbedderSubmitFrameNotCalled   
)

Definition at line 259 of file rasterizer_unittests.cc.

261 {
262 std::string test_name =
263 ::testing::UnitTest::GetInstance()->current_test_info()->name();
264 ThreadHost thread_host("io.flutter.test." + test_name + ".",
265 ThreadHost::Type::kPlatform |
266 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
267 ThreadHost::Type::kUi);
268 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
269 thread_host.raster_thread->GetTaskRunner(),
270 thread_host.ui_thread->GetTaskRunner(),
271 thread_host.io_thread->GetTaskRunner());
272 NiceMock<MockDelegate> delegate;
274 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
275 EXPECT_CALL(delegate, GetTaskRunners())
276 .WillRepeatedly(ReturnRef(task_runners));
277 EXPECT_CALL(delegate, OnFrameRasterized(_));
278 auto rasterizer = std::make_unique<Rasterizer>(delegate);
279 auto surface = std::make_unique<NiceMock<MockSurface>>();
280 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
281 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
282 rasterizer->SetExternalViewEmbedder(external_view_embedder);
283 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
284 .WillRepeatedly(Return(true));
285 SurfaceFrame::FramebufferInfo framebuffer_info;
286 framebuffer_info.supports_readback = true;
287 auto surface_frame = std::make_unique<SurfaceFrame>(
288 /*surface=*/
289 nullptr, framebuffer_info,
290 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
291 /*frame_size=*/SkISize::Make(800, 600));
292 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
293 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
294 .WillOnce(Return(ByMove(std::move(surface_frame))));
295 EXPECT_CALL(*surface, MakeRenderContextCurrent())
296 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
297
298 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
299 /*raster_thread_merger=*/_))
300 .Times(1);
301 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
302 /*frame_size=*/SkISize(),
303 /*device_pixel_ratio=*/2.0))
304 .Times(1);
305 EXPECT_CALL(*external_view_embedder,
306 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
307 .Times(0);
308 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
309 /*raster_thread_merger=*/_))
310 .Times(1);
311
312 rasterizer->Setup(std::move(surface));
314 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
315 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
316 auto layer_tree = std::make_unique<LayerTree>(
317 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
318 auto layer_tree_item = std::make_unique<FrameItem>(
319 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
320 kDevicePixelRatio),
322 PipelineProduceResult result =
323 pipeline->Produce().Complete(std::move(layer_tree_item));
324 EXPECT_TRUE(result.success);
325 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
326 rasterizer->Draw(pipeline);
327 latch.Signal();
328 });
329 latch.Wait();
330}

◆ TEST() [116/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderAndThreadsMergedExternalViewEmbedderSubmitFrameCalled   
)

Definition at line 332 of file rasterizer_unittests.cc.

334 {
335 std::string test_name =
336 ::testing::UnitTest::GetInstance()->current_test_info()->name();
337 ThreadHost thread_host("io.flutter.test." + test_name + ".",
338 ThreadHost::Type::kPlatform |
339 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
340 ThreadHost::Type::kUi);
342 TaskRunners task_runners("test",
343 fml::MessageLoop::GetCurrent().GetTaskRunner(),
344 fml::MessageLoop::GetCurrent().GetTaskRunner(),
345 thread_host.ui_thread->GetTaskRunner(),
346 thread_host.io_thread->GetTaskRunner());
347
348 NiceMock<MockDelegate> delegate;
350 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
351 EXPECT_CALL(delegate, GetTaskRunners())
352 .WillRepeatedly(ReturnRef(task_runners));
353 EXPECT_CALL(delegate, OnFrameRasterized(_));
354
355 auto rasterizer = std::make_unique<Rasterizer>(delegate);
356 auto surface = std::make_unique<NiceMock<MockSurface>>();
357
358 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
359 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
360 rasterizer->SetExternalViewEmbedder(external_view_embedder);
361
362 SurfaceFrame::FramebufferInfo framebuffer_info;
363 framebuffer_info.supports_readback = true;
364
365 auto surface_frame = std::make_unique<SurfaceFrame>(
366 /*surface=*/
367 nullptr, framebuffer_info,
368 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
369 /*frame_size=*/SkISize::Make(800, 600));
370 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
371 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
372 .WillOnce(Return(ByMove(std::move(surface_frame))));
373 EXPECT_CALL(*surface, MakeRenderContextCurrent())
374 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
375 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
376 .WillRepeatedly(Return(true));
377
378 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
379 /*raster_thread_merger=*/_))
380 .Times(1);
381 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
382 /*frame_size=*/SkISize(),
383 /*device_pixel_ratio=*/2.0))
384 .Times(1);
385 EXPECT_CALL(*external_view_embedder,
386 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
387 .Times(1);
388 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
389 /*raster_thread_merger=*/_))
390 .Times(1);
391
392 rasterizer->Setup(std::move(surface));
393
394 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
395 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
396 /*frame_size=*/SkISize());
397 auto layer_tree_item = std::make_unique<FrameItem>(
398 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
399 kDevicePixelRatio),
401 PipelineProduceResult result =
402 pipeline->Produce().Complete(std::move(layer_tree_item));
403 EXPECT_TRUE(result.success);
404 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
405 rasterizer->Draw(pipeline);
406}

◆ TEST() [117/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderExternalViewEmbedderSubmitFrameCalled   
)

Definition at line 181 of file rasterizer_unittests.cc.

182 {
183 std::string test_name =
184 ::testing::UnitTest::GetInstance()->current_test_info()->name();
185 ThreadHost thread_host("io.flutter.test." + test_name + ".",
186 ThreadHost::Type::kPlatform |
187 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
188 ThreadHost::Type::kUi);
189 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
190 thread_host.raster_thread->GetTaskRunner(),
191 thread_host.ui_thread->GetTaskRunner(),
192 thread_host.io_thread->GetTaskRunner());
193 NiceMock<MockDelegate> delegate;
195 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
196 EXPECT_CALL(delegate, GetTaskRunners())
197 .WillRepeatedly(ReturnRef(task_runners));
198 EXPECT_CALL(delegate, OnFrameRasterized(_));
199 auto rasterizer = std::make_unique<Rasterizer>(delegate);
200 auto surface = std::make_unique<NiceMock<MockSurface>>();
201
202 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
203 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
204 rasterizer->SetExternalViewEmbedder(external_view_embedder);
205
206 SurfaceFrame::FramebufferInfo framebuffer_info;
207 framebuffer_info.supports_readback = true;
208
209 auto surface_frame = std::make_unique<SurfaceFrame>(
210 /*surface=*/
211 nullptr, framebuffer_info,
212 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
213 /*frame_size=*/SkISize::Make(800, 600));
214 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
215 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
216 .WillOnce(Return(ByMove(std::move(surface_frame))));
217 EXPECT_CALL(*surface, MakeRenderContextCurrent())
218 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
219
220 EXPECT_CALL(*external_view_embedder,
221 BeginFrame(/*context=*/nullptr,
222 /*raster_thread_merger=*/
224 .Times(1);
225 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
226 /*frame_size=*/SkISize(),
227 /*device_pixel_ratio=*/2.0))
228 .Times(1);
229 EXPECT_CALL(*external_view_embedder,
230 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
231 .Times(1);
232 EXPECT_CALL(
233 *external_view_embedder,
234 EndFrame(/*should_resubmit_frame=*/false,
235 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
236 nullptr)))
237 .Times(1);
238
239 rasterizer->Setup(std::move(surface));
241 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
242 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
243 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
244 /*frame_size=*/SkISize());
245 auto layer_tree_item = std::make_unique<FrameItem>(
246 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
247 kDevicePixelRatio),
249 PipelineProduceResult result =
250 pipeline->Produce().Complete(std::move(layer_tree_item));
251 EXPECT_TRUE(result.success);
252 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
253 rasterizer->Draw(pipeline);
254 latch.Signal();
255 });
256 latch.Wait();
257}

◆ TEST() [118/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuDisabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 799 of file rasterizer_unittests.cc.

801 {
802 std::string test_name =
803 ::testing::UnitTest::GetInstance()->current_test_info()->name();
804 ThreadHost thread_host("io.flutter.test." + test_name + ".",
805 ThreadHost::Type::kPlatform |
806 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
807 ThreadHost::Type::kUi);
808 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
809 thread_host.raster_thread->GetTaskRunner(),
810 thread_host.ui_thread->GetTaskRunner(),
811 thread_host.io_thread->GetTaskRunner());
812 NiceMock<MockDelegate> delegate;
814 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
815 EXPECT_CALL(delegate, GetTaskRunners())
816 .WillRepeatedly(ReturnRef(task_runners));
817 EXPECT_CALL(delegate, OnFrameRasterized(_));
818 auto rasterizer = std::make_unique<Rasterizer>(delegate);
819 auto surface = std::make_unique<NiceMock<MockSurface>>();
820 auto is_gpu_disabled_sync_switch =
821 std::make_shared<const fml::SyncSwitch>(true);
822
823 SurfaceFrame::FramebufferInfo framebuffer_info;
824 framebuffer_info.supports_readback = true;
825
826 auto surface_frame = std::make_unique<SurfaceFrame>(
827 /*surface=*/
828 nullptr, /*framebuffer_info=*/framebuffer_info,
829 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
830 /*frame_size=*/SkISize::Make(800, 600));
831 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
832 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
833 .WillByDefault(Return(is_gpu_disabled_sync_switch));
834 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()).Times(0);
835 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
836 .WillOnce(Return(ByMove(std::move(surface_frame))));
837 EXPECT_CALL(*surface, MakeRenderContextCurrent())
838 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
839
840 rasterizer->Setup(std::move(surface));
842 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
843 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
844 auto layer_tree = std::make_unique<LayerTree>(
845 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
846 auto layer_tree_item = std::make_unique<FrameItem>(
847 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
848 kDevicePixelRatio),
850 PipelineProduceResult result =
851 pipeline->Produce().Complete(std::move(layer_tree_item));
852 EXPECT_TRUE(result.success);
853 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
854 DrawStatus status = rasterizer->Draw(pipeline);
855 EXPECT_EQ(status, DrawStatus::kDone);
856 latch.Signal();
857 });
858 latch.Wait();
859}

◆ TEST() [119/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuDisabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesntAcquireFrame   
)

Definition at line 922 of file rasterizer_unittests.cc.

924 {
925 std::string test_name =
926 ::testing::UnitTest::GetInstance()->current_test_info()->name();
927 ThreadHost thread_host("io.flutter.test." + test_name + ".",
928 ThreadHost::Type::kPlatform |
929 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
930 ThreadHost::Type::kUi);
931 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
932 thread_host.raster_thread->GetTaskRunner(),
933 thread_host.ui_thread->GetTaskRunner(),
934 thread_host.io_thread->GetTaskRunner());
935 NiceMock<MockDelegate> delegate;
937 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
938 EXPECT_CALL(delegate, GetTaskRunners())
939 .WillRepeatedly(ReturnRef(task_runners));
940 EXPECT_CALL(delegate, OnFrameRasterized(_)).Times(0);
941 auto rasterizer = std::make_unique<Rasterizer>(delegate);
942 auto surface = std::make_unique<NiceMock<MockSurface>>();
943 auto is_gpu_disabled_sync_switch =
944 std::make_shared<const fml::SyncSwitch>(true);
945
946 SurfaceFrame::FramebufferInfo framebuffer_info;
947 framebuffer_info.supports_readback = true;
948
949 auto surface_frame = std::make_unique<SurfaceFrame>(
950 /*surface=*/
951 nullptr, /*framebuffer_info=*/framebuffer_info,
952 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
953 /*frame_size=*/SkISize::Make(800, 600));
954 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false));
955 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch())
956 .WillOnce(Return(is_gpu_disabled_sync_switch));
957 EXPECT_CALL(*surface, AcquireFrame(SkISize())).Times(0);
958 EXPECT_CALL(*surface, MakeRenderContextCurrent())
959 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
960
961 rasterizer->Setup(std::move(surface));
963 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
964 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
965 auto layer_tree = std::make_unique<LayerTree>(
966 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
967 auto layer_tree_item = std::make_unique<FrameItem>(
968 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
969 kDevicePixelRatio),
971 PipelineProduceResult result =
972 pipeline->Produce().Complete(std::move(layer_tree_item));
973 EXPECT_TRUE(result.success);
974 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
975 DrawStatus status = rasterizer->Draw(pipeline);
976 EXPECT_EQ(status, DrawStatus::kGpuUnavailable);
977 latch.Signal();
978 });
979 latch.Wait();
980}

◆ TEST() [120/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuEnabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 739 of file rasterizer_unittests.cc.

740 {
741 std::string test_name =
742 ::testing::UnitTest::GetInstance()->current_test_info()->name();
743 ThreadHost thread_host("io.flutter.test." + test_name + ".",
744 ThreadHost::Type::kPlatform |
745 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
746 ThreadHost::Type::kUi);
747 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
748 thread_host.raster_thread->GetTaskRunner(),
749 thread_host.ui_thread->GetTaskRunner(),
750 thread_host.io_thread->GetTaskRunner());
751 NiceMock<MockDelegate> delegate;
753 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
754 EXPECT_CALL(delegate, GetTaskRunners())
755 .WillRepeatedly(ReturnRef(task_runners));
756 EXPECT_CALL(delegate, OnFrameRasterized(_));
757
758 auto rasterizer = std::make_unique<Rasterizer>(delegate);
759 auto surface = std::make_unique<NiceMock<MockSurface>>();
760 auto is_gpu_disabled_sync_switch =
761 std::make_shared<const fml::SyncSwitch>(false);
762
763 SurfaceFrame::FramebufferInfo framebuffer_info;
764 framebuffer_info.supports_readback = true;
765 auto surface_frame = std::make_unique<SurfaceFrame>(
766 /*surface=*/
767 nullptr, /*framebuffer_info=*/framebuffer_info,
768 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
769 /*frame_size=*/SkISize::Make(800, 600));
770 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
771 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
772 .WillByDefault(Return(is_gpu_disabled_sync_switch));
773 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()).Times(0);
774 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
775 .WillOnce(Return(ByMove(std::move(surface_frame))));
776 EXPECT_CALL(*surface, MakeRenderContextCurrent())
777 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
778
779 rasterizer->Setup(std::move(surface));
781 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
782 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
783 auto layer_tree = std::make_unique<LayerTree>(
784 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
785 auto layer_tree_item = std::make_unique<FrameItem>(
786 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
787 kDevicePixelRatio),
789 PipelineProduceResult result =
790 pipeline->Produce().Complete(std::move(layer_tree_item));
791 EXPECT_TRUE(result.success);
792 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
793 rasterizer->Draw(pipeline);
794 latch.Signal();
795 });
796 latch.Wait();
797}

◆ TEST() [121/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuEnabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 861 of file rasterizer_unittests.cc.

863 {
864 std::string test_name =
865 ::testing::UnitTest::GetInstance()->current_test_info()->name();
866 ThreadHost thread_host("io.flutter.test." + test_name + ".",
867 ThreadHost::Type::kPlatform |
868 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
869 ThreadHost::Type::kUi);
870 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
871 thread_host.raster_thread->GetTaskRunner(),
872 thread_host.ui_thread->GetTaskRunner(),
873 thread_host.io_thread->GetTaskRunner());
874 NiceMock<MockDelegate> delegate;
876 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
877 EXPECT_CALL(delegate, GetTaskRunners())
878 .WillRepeatedly(ReturnRef(task_runners));
879 EXPECT_CALL(delegate, OnFrameRasterized(_));
880 auto rasterizer = std::make_unique<Rasterizer>(delegate);
881 auto surface = std::make_unique<NiceMock<MockSurface>>();
882 auto is_gpu_disabled_sync_switch =
883 std::make_shared<const fml::SyncSwitch>(false);
884
885 SurfaceFrame::FramebufferInfo framebuffer_info;
886 framebuffer_info.supports_readback = true;
887
888 auto surface_frame = std::make_unique<SurfaceFrame>(
889 /*surface=*/
890 nullptr, /*framebuffer_info=*/framebuffer_info,
891 /*submit_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
892 /*frame_size=*/SkISize::Make(800, 600));
893 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false));
894 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch())
895 .WillOnce(Return(is_gpu_disabled_sync_switch));
896 EXPECT_CALL(*surface, AcquireFrame(SkISize()))
897 .WillOnce(Return(ByMove(std::move(surface_frame))));
898 EXPECT_CALL(*surface, MakeRenderContextCurrent())
899 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
900
901 rasterizer->Setup(std::move(surface));
903 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
904 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
905 auto layer_tree = std::make_unique<LayerTree>(
906 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
907 auto layer_tree_item = std::make_unique<FrameItem>(
908 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
909 kDevicePixelRatio),
911 PipelineProduceResult result =
912 pipeline->Produce().Complete(std::move(layer_tree_item));
913 EXPECT_TRUE(result.success);
914 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
915 DrawStatus status = rasterizer->Draw(pipeline);
916 EXPECT_EQ(status, DrawStatus::kDone);
917 latch.Signal();
918 });
919 latch.Wait();
920}

◆ TEST() [122/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet   
)

Definition at line 498 of file rasterizer_unittests.cc.

498 {
499 std::string test_name =
500 ::testing::UnitTest::GetInstance()->current_test_info()->name();
501 ThreadHost thread_host("io.flutter.test." + test_name + ".",
502 ThreadHost::Type::kPlatform |
503 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
504 ThreadHost::Type::kUi);
505 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
506 thread_host.raster_thread->GetTaskRunner(),
507 thread_host.ui_thread->GetTaskRunner(),
508 thread_host.io_thread->GetTaskRunner());
509 NiceMock<MockDelegate> delegate;
511 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
512 EXPECT_CALL(delegate, GetTaskRunners())
513 .WillRepeatedly(ReturnRef(task_runners));
514 auto rasterizer = std::make_unique<Rasterizer>(delegate);
515
516 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
517 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
518 rasterizer->SetExternalViewEmbedder(external_view_embedder);
519
520 EXPECT_CALL(
521 *external_view_embedder,
522 EndFrame(/*should_resubmit_frame=*/false,
523 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
524 nullptr)))
525 .Times(0);
526
528 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
529 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
530 auto layer_tree = std::make_unique<LayerTree>(
531 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
532 auto layer_tree_item = std::make_unique<FrameItem>(
533 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
534 kDevicePixelRatio),
537 pipeline->Produce().Complete(std::move(layer_tree_item));
538 EXPECT_TRUE(result.success);
539 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
540 rasterizer->Draw(pipeline);
541 latch.Signal();
542 });
543 latch.Wait();
544}

◆ TEST() [123/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenNotUsedThisFrame   
)

Definition at line 546 of file rasterizer_unittests.cc.

546 {
547 std::string test_name =
548 ::testing::UnitTest::GetInstance()->current_test_info()->name();
549 ThreadHost thread_host("io.flutter.test." + test_name + ".",
550 ThreadHost::Type::kPlatform |
551 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
552 ThreadHost::Type::kUi);
553 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
554 thread_host.raster_thread->GetTaskRunner(),
555 thread_host.ui_thread->GetTaskRunner(),
556 thread_host.io_thread->GetTaskRunner());
557 NiceMock<MockDelegate> delegate;
559 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
560 EXPECT_CALL(delegate, GetTaskRunners())
561 .WillRepeatedly(ReturnRef(task_runners));
562 auto is_gpu_disabled_sync_switch =
563 std::make_shared<const fml::SyncSwitch>(false);
564 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
565 .WillByDefault(Return(is_gpu_disabled_sync_switch));
566
567 auto rasterizer = std::make_unique<Rasterizer>(delegate);
568 auto surface = std::make_unique<NiceMock<MockSurface>>();
569 EXPECT_CALL(*surface, MakeRenderContextCurrent())
570 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
571
572 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
573 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
574 rasterizer->SetExternalViewEmbedder(external_view_embedder);
575 rasterizer->Setup(std::move(surface));
576
577 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
578 /*raster_thread_merger=*/_))
579 .Times(0);
580 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
581 /*frame_size=*/SkISize(),
582 /*device_pixel_ratio=*/2.0))
583 .Times(0);
584 EXPECT_CALL(
585 *external_view_embedder,
586 EndFrame(/*should_resubmit_frame=*/false,
587 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
588 nullptr)))
589 .Times(0);
590
592 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
593 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
594 auto layer_tree = std::make_unique<LayerTree>(
595 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
596 auto layer_tree_item = std::make_unique<FrameItem>(
597 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
598 kDevicePixelRatio),
601 pipeline->Produce().Complete(std::move(layer_tree_item));
602 EXPECT_TRUE(result.success);
603 // Always discard the layer tree.
604 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(true));
605 DrawStatus status = rasterizer->Draw(pipeline);
606 EXPECT_EQ(status, DrawStatus::kDone);
607 EXPECT_EQ(rasterizer->GetLastDrawStatus(kImplicitViewId),
608 DrawSurfaceStatus::kDiscarded);
609 latch.Signal();
610 });
611 latch.Wait();
612}

◆ TEST() [124/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenPipelineIsEmpty   
)

Definition at line 614 of file rasterizer_unittests.cc.

614 {
615 std::string test_name =
616 ::testing::UnitTest::GetInstance()->current_test_info()->name();
617 ThreadHost thread_host("io.flutter.test." + test_name + ".",
618 ThreadHost::Type::kPlatform |
619 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
620 ThreadHost::Type::kUi);
621 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
622 thread_host.raster_thread->GetTaskRunner(),
623 thread_host.ui_thread->GetTaskRunner(),
624 thread_host.io_thread->GetTaskRunner());
625 NiceMock<MockDelegate> delegate;
627 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
628 EXPECT_CALL(delegate, GetTaskRunners())
629 .WillRepeatedly(ReturnRef(task_runners));
630
631 auto rasterizer = std::make_unique<Rasterizer>(delegate);
632 auto surface = std::make_unique<NiceMock<MockSurface>>();
633 EXPECT_CALL(*surface, MakeRenderContextCurrent())
634 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
635
636 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
637 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
638 rasterizer->SetExternalViewEmbedder(external_view_embedder);
639 rasterizer->Setup(std::move(surface));
640
641 EXPECT_CALL(
642 *external_view_embedder,
643 EndFrame(/*should_resubmit_frame=*/false,
644 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
645 nullptr)))
646 .Times(0);
647
649 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
650 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
651 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
652 DrawStatus status = rasterizer->Draw(pipeline);
653 EXPECT_EQ(status, DrawStatus::kPipelineEmpty);
654 latch.Signal();
655 });
656 latch.Wait();
657}

◆ TEST() [125/363]

flutter::TEST ( RasterizerTest  ,
FrameTimingRecorderShouldStartRecordingRasterTimeBeforeSurfaceAcquireFrame   
)

Definition at line 982 of file rasterizer_unittests.cc.

984 {
985 std::string test_name =
986 ::testing::UnitTest::GetInstance()->current_test_info()->name();
987 ThreadHost thread_host("io.flutter.test." + test_name + ".",
988 ThreadHost::Type::kPlatform |
989 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
990 ThreadHost::Type::kUi);
991 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
992 thread_host.raster_thread->GetTaskRunner(),
993 thread_host.ui_thread->GetTaskRunner(),
994 thread_host.io_thread->GetTaskRunner());
995 NiceMock<MockDelegate> delegate;
997 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
998 EXPECT_CALL(delegate, GetTaskRunners())
999 .WillRepeatedly(ReturnRef(task_runners));
1000 EXPECT_CALL(delegate, OnFrameRasterized(_))
1001 .WillOnce([&](const FrameTiming& frame_timing) {
1003 fml::TimePoint raster_start =
1004 frame_timing.Get(FrameTiming::kRasterStart);
1005 EXPECT_TRUE(now - raster_start < fml::TimeDelta::FromSecondsF(1));
1006 });
1007
1008 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1009 auto surface = std::make_unique<NiceMock<MockSurface>>();
1010 auto is_gpu_disabled_sync_switch =
1011 std::make_shared<const fml::SyncSwitch>(false);
1012 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
1013 .WillByDefault(Return(is_gpu_disabled_sync_switch));
1014 ON_CALL(*surface, AcquireFrame(SkISize()))
1015 .WillByDefault(::testing::Invoke([] { return nullptr; }));
1016 EXPECT_CALL(*surface, AcquireFrame(SkISize()));
1017 EXPECT_CALL(*surface, MakeRenderContextCurrent())
1018 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
1019 rasterizer->Setup(std::move(surface));
1021 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1022 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1023 auto layer_tree = std::make_unique<LayerTree>(
1024 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
1025 auto layer_tree_item = std::make_unique<FrameItem>(
1026 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1027 kDevicePixelRatio),
1029 PipelineProduceResult result =
1030 pipeline->Produce().Complete(std::move(layer_tree_item));
1031 EXPECT_TRUE(result.success);
1032 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1033 DrawStatus status = rasterizer->Draw(pipeline);
1034 EXPECT_EQ(status, DrawStatus::kDone);
1035 EXPECT_EQ(rasterizer->GetLastDrawStatus(kImplicitViewId),
1036 DrawSurfaceStatus::kFailed);
1037 latch.Signal();
1038 });
1039 latch.Wait();
1040}
fml::TimePoint Get(Phase phase) const
Definition: settings.h:51
static constexpr TimeDelta FromSecondsF(double seconds)
Definition: time_delta.h:53

◆ TEST() [126/363]

flutter::TEST ( RasterizerTest  ,
presentationTimeNotSetWhenVsyncTargetInPast   
)

Definition at line 1307 of file rasterizer_unittests.cc.

1307 {
1308 GTEST_SKIP() << "eglPresentationTime is disabled due to "
1309 "https://github.com/flutter/flutter/issues/112503";
1310#if false
1311 std::string test_name =
1312 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1313 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1314 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
1315 ThreadHost::Type::kIo | ThreadHost::Type::kUi);
1316 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1317 thread_host.raster_thread->GetTaskRunner(),
1318 thread_host.ui_thread->GetTaskRunner(),
1319 thread_host.io_thread->GetTaskRunner());
1320
1321 NiceMock<MockDelegate> delegate;
1323 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1324 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1325
1327 std::unique_ptr<Rasterizer> rasterizer;
1328 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1329 rasterizer = std::make_unique<Rasterizer>(delegate);
1330 latch.Signal();
1331 });
1332 latch.Wait();
1333
1334 const auto millis_16 = fml::TimeDelta::FromMilliseconds(16);
1335 const auto first_timestamp = fml::TimePoint::Now() - millis_16;
1336
1337 fml::CountDownLatch submit_latch(1);
1338 auto surface = std::make_unique<MockSurface>();
1339 ON_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillByDefault(Return(true));
1340 ON_CALL(*surface, AcquireFrame(SkISize()))
1341 .WillByDefault(::testing::Invoke([&] {
1342 SurfaceFrame::FramebufferInfo framebuffer_info;
1343 framebuffer_info.supports_readback = true;
1344 return std::make_unique<SurfaceFrame>(
1345 /*surface=*/nullptr, framebuffer_info,
1346 /*submit_callback=*/
1347 [&](const SurfaceFrame& frame, DlCanvas*) {
1348 const std::optional<fml::TimePoint> pres_time =
1349 frame.submit_info().presentation_time;
1350 EXPECT_EQ(pres_time, std::nullopt);
1351 submit_latch.CountDown();
1352 return true;
1353 },
1354 /*frame_size=*/SkISize::Make(800, 600));
1355 }));
1356
1357 ON_CALL(*surface, MakeRenderContextCurrent())
1358 .WillByDefault(::testing::Invoke(
1359 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1360
1361 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1362 rasterizer->Setup(std::move(surface));
1363 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1364 auto layer_tree = std::make_unique<LayerTree>(
1365 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
1366 auto layer_tree_item = std::make_unique<FrameItem>(
1367 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1368 kDevicePixelRatio),
1369 CreateFinishedBuildRecorder(first_timestamp));
1370 PipelineProduceResult result =
1371 pipeline->Produce().Complete(std::move(layer_tree_item));
1372 EXPECT_TRUE(result.success);
1373 EXPECT_EQ(result.is_first_item, true);
1374 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1375 rasterizer->Draw(pipeline);
1376 });
1377
1378 submit_latch.Wait();
1379 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1380 rasterizer.reset();
1381 latch.Signal();
1382 });
1383 latch.Wait();
1384#endif // false
1385}

◆ TEST() [127/363]

flutter::TEST ( RasterizerTest  ,
presentationTimeSetWhenVsyncTargetInFuture   
)

Definition at line 1218 of file rasterizer_unittests.cc.

1218 {
1219 GTEST_SKIP() << "eglPresentationTime is disabled due to "
1220 "https://github.com/flutter/flutter/issues/112503";
1221#if false
1222 std::string test_name =
1223 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1224 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1225 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
1226 ThreadHost::Type::kIo | ThreadHost::Type::kUi);
1227 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1228 thread_host.raster_thread->GetTaskRunner(),
1229 thread_host.ui_thread->GetTaskRunner(),
1230 thread_host.io_thread->GetTaskRunner());
1231
1232 NiceMock<MockDelegate> delegate;
1234 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1235 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1236
1238 std::unique_ptr<Rasterizer> rasterizer;
1239 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1240 rasterizer = std::make_unique<Rasterizer>(delegate);
1241 latch.Signal();
1242 });
1243 latch.Wait();
1244
1245 const auto millis_16 = fml::TimeDelta::FromMilliseconds(16);
1246 const auto first_timestamp = fml::TimePoint::Now() + millis_16;
1247 auto second_timestamp = first_timestamp + millis_16;
1248 std::vector<fml::TimePoint> timestamps = {first_timestamp, second_timestamp};
1249
1250 int frames_submitted = 0;
1251 fml::CountDownLatch submit_latch(2);
1252 auto surface = std::make_unique<MockSurface>();
1253 ON_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillByDefault(Return(true));
1254 ON_CALL(*surface, AcquireFrame(SkISize()))
1255 .WillByDefault(::testing::Invoke([&] {
1256 SurfaceFrame::FramebufferInfo framebuffer_info;
1257 framebuffer_info.supports_readback = true;
1258 return std::make_unique<SurfaceFrame>(
1259 /*surface=*/nullptr, framebuffer_info,
1260 /*submit_callback=*/
1261 [&](const SurfaceFrame& frame, DlCanvas*) {
1262 const auto pres_time = *frame.submit_info().presentation_time;
1263 const auto diff = pres_time - first_timestamp;
1264 int num_frames_submitted = frames_submitted++;
1265 EXPECT_EQ(diff.ToMilliseconds(),
1266 num_frames_submitted * millis_16.ToMilliseconds());
1267 submit_latch.CountDown();
1268 return true;
1269 },
1270 /*frame_size=*/SkISize::Make(800, 600));
1271 }));
1272
1273 ON_CALL(*surface, MakeRenderContextCurrent())
1274 .WillByDefault(::testing::Invoke(
1275 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1276
1277 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1278 rasterizer->Setup(std::move(surface));
1279 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1280 for (int i = 0; i < 2; i++) {
1281 auto layer_tree = std::make_unique<LayerTree>(
1282 /*root_layer=*/nullptr, /*frame_size=*/SkISize());
1283 auto layer_tree_item = std::make_unique<FrameItem>(
1284 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1285 kDevicePixelRatio),
1286 CreateFinishedBuildRecorder(timestamps[i]));
1287 PipelineProduceResult result =
1288 pipeline->Produce().Complete(std::move(layer_tree_item));
1289 EXPECT_TRUE(result.success);
1290 EXPECT_EQ(result.is_first_item, i == 0);
1291 }
1292 // Although we only call 'Rasterizer::Draw' once, it will be called twice
1293 // finally because there are two items in the pipeline.
1294 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1295 rasterizer->Draw(pipeline);
1296 });
1297
1298 submit_latch.Wait();
1299 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1300 rasterizer.reset();
1301 latch.Signal();
1302 });
1303 latch.Wait();
1304#endif // false
1305}

◆ TEST() [128/363]

flutter::TEST ( RasterizerTest  ,
TeardownFreesResourceCache   
)

Definition at line 1131 of file rasterizer_unittests.cc.

1131 {
1132 std::string test_name =
1133 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1134 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1135 ThreadHost::Type::kPlatform |
1136 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1137 ThreadHost::Type::kUi);
1138 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1139 thread_host.raster_thread->GetTaskRunner(),
1140 thread_host.ui_thread->GetTaskRunner(),
1141 thread_host.io_thread->GetTaskRunner());
1142
1143 NiceMock<MockDelegate> delegate;
1145 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1146 EXPECT_CALL(delegate, GetTaskRunners())
1147 .WillRepeatedly(ReturnRef(task_runners));
1148
1149 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1150 auto surface = std::make_unique<NiceMock<MockSurface>>();
1151 auto context = GrDirectContext::MakeMock(nullptr);
1152 context->setResourceCacheLimit(0);
1153
1154 EXPECT_CALL(*surface, MakeRenderContextCurrent())
1155 .WillRepeatedly([]() -> std::unique_ptr<GLContextResult> {
1156 return std::make_unique<GLContextDefaultResult>(true);
1157 });
1158 EXPECT_CALL(*surface, GetContext()).WillRepeatedly(Return(context.get()));
1159
1160 rasterizer->Setup(std::move(surface));
1161 EXPECT_EQ(context->getResourceCacheLimit(), 0ul);
1162
1163 rasterizer->SetResourceCacheMaxBytes(10000000, false);
1164 EXPECT_EQ(context->getResourceCacheLimit(), 10000000ul);
1165 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1166
1167 int count = 0;
1168 size_t bytes = 0;
1169 context->getResourceCacheUsage(&count, &bytes);
1170 EXPECT_EQ(bytes, 0ul);
1171
1172 auto image_info =
1174 auto sk_surface = SkSurfaces::RenderTarget(context.get(),
1175 skgpu::Budgeted::kYes, image_info);
1176 EXPECT_TRUE(sk_surface);
1177
1178 SkPaint paint;
1179 sk_surface->getCanvas()->drawPaint(paint);
1180 context->flushAndSubmit(GrSyncCpu::kYes);
1181
1182 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1183
1184 sk_surface.reset();
1185
1186 context->getResourceCacheUsage(&count, &bytes);
1187 EXPECT_GT(bytes, 0ul);
1188 EXPECT_GT(context->getResourceCachePurgeableBytes(), 0ul);
1189
1190 rasterizer->Teardown();
1191 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1192}
static sk_sp< GrDirectContext > MakeMock(const GrMockOptions *, const GrContextOptions &)
SK_API GrDirectContext * GetContext(const SkImage *src)

◆ TEST() [129/363]

flutter::TEST ( RasterizerTest  ,
TeardownNoSurface   
)

Definition at line 1194 of file rasterizer_unittests.cc.

1194 {
1195 std::string test_name =
1196 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1197 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1198 ThreadHost::Type::kPlatform |
1199 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1200 ThreadHost::Type::kUi);
1201 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1202 thread_host.raster_thread->GetTaskRunner(),
1203 thread_host.ui_thread->GetTaskRunner(),
1204 thread_host.io_thread->GetTaskRunner());
1205
1206 NiceMock<MockDelegate> delegate;
1208 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1209 EXPECT_CALL(delegate, GetTaskRunners())
1210 .WillRepeatedly(ReturnRef(task_runners));
1211
1212 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1213
1214 EXPECT_TRUE(rasterizer);
1215 rasterizer->Teardown();
1216}

◆ TEST() [130/363]

flutter::TEST ( Rect  ,
ReturnsLTRB   
)

Definition at line 37 of file geometry_unittests.cc.

37 {
38 Point origin(-30.0, 42.0);
39 Size size(20.0, 22.0);
40 Rect rect(origin, size);
41 EXPECT_DOUBLE_EQ(-30.0, rect.left());
42 EXPECT_DOUBLE_EQ(42.0, rect.top());
43 EXPECT_DOUBLE_EQ(-10.0, rect.right());
44 EXPECT_DOUBLE_EQ(64.0, rect.bottom());
45}

◆ TEST() [131/363]

flutter::TEST ( Rect  ,
ReturnsWidthHeight   
)

Definition at line 47 of file geometry_unittests.cc.

47 {
48 Point origin(-30.0, 42.0);
49 Size size(20.0, 22.0);
50 Rect rect(origin, size);
51 EXPECT_DOUBLE_EQ(20.0, rect.width());
52 EXPECT_DOUBLE_EQ(22.0, rect.height());
53}

◆ TEST() [132/363]

flutter::TEST ( Rect  ,
SetsOriginAndSize   
)

Definition at line 29 of file geometry_unittests.cc.

29 {
30 Point origin(-30.0, 42.0);
31 Size size(20.0, 22.0);
32 Rect rect(origin, size);
33 EXPECT_EQ(origin, rect.origin());
34 EXPECT_EQ(size, rect.size());
35}

◆ TEST() [133/363]

flutter::TEST ( SamplingProfilerTest  ,
DeleteAfterStart   
)

Definition at line 43 of file sampling_profiler_unittest.cc.

43 {
44 auto thread =
45 std::make_unique<fml::Thread>(flutter::testing::GetCurrentTestName());
46 auto task_runner = fml::MockTaskRunner::Create();
47 std::atomic<int> invoke_count = 0;
48
49 // Ignore calls to PostTask since that would require mocking out calls to
50 // Dart.
51 EXPECT_CALL(*task_runner, PostDelayedTask(_, _))
52 .WillRepeatedly(
53 Invoke([&](const fml::closure& task, fml::TimeDelta delay) {
54 invoke_count.fetch_add(1);
55 thread->GetTaskRunner()->PostTask(task);
56 }));
57
58 {
59 auto profiler = SamplingProfiler(
60 "profiler",
61 /*profiler_task_runner=*/task_runner, [] { return ProfileSample(); },
62 /*num_samples_per_sec=*/1000);
63 profiler.Start();
64 }
65 int invoke_count_at_delete = invoke_count.load();
66 std::this_thread::sleep_for(std::chrono::milliseconds(2)); // nyquist
67 ASSERT_EQ(invoke_count_at_delete, invoke_count.load());
68}
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
Definition: testing.cc:15

◆ TEST() [134/363]

flutter::TEST ( Size  ,
ClampsDimensionsPositive   
)

Definition at line 23 of file geometry_unittests.cc.

23 {
24 Size size(-20.0, -42.0);
25 EXPECT_DOUBLE_EQ(0.0, size.width());
26 EXPECT_DOUBLE_EQ(0.0, size.height());
27}

◆ TEST() [135/363]

flutter::TEST ( Size  ,
SetsDimensions   
)

Definition at line 17 of file geometry_unittests.cc.

17 {
18 Size size(20.0, 42.0);
19 EXPECT_DOUBLE_EQ(20.0, size.width());
20 EXPECT_DOUBLE_EQ(42.0, size.height());
21}

◆ TEST() [136/363]

flutter::TEST ( StandardMessageCodec  ,
CanDecodeEmptyBytesAsNullWithoutCallingSerializer   
)

Definition at line 95 of file standard_message_codec_unittests.cc.

95 {
96 std::vector<uint8_t> bytes = {};
97 const MockStandardCodecSerializer serializer;
98 const StandardMessageCodec& codec =
99 StandardMessageCodec::GetInstance(&serializer);
100
101 auto decoded = codec.DecodeMessage(bytes);
102
103 EXPECT_EQ(EncodableValue(), *decoded);
104 EXPECT_CALL(serializer, ReadValueOfType(::testing::_, ::testing::_)).Times(0);
105}

◆ TEST() [137/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeByteArray   
)

Definition at line 193 of file standard_message_codec_unittests.cc.

193 {
194 std::vector<uint8_t> bytes = {0x08, 0x04, 0xba, 0x5e, 0xba, 0x11};
195 EncodableValue value(std::vector<uint8_t>{0xba, 0x5e, 0xba, 0x11});
196 CheckEncodeDecode(value, bytes);
197}

◆ TEST() [138/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeDouble   
)

Definition at line 128 of file standard_message_codec_unittests.cc.

128 {
129 std::vector<uint8_t> bytes = {0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
130 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40};
131 CheckEncodeDecode(EncodableValue(3.14159265358979311599796346854), bytes);
132}

◆ TEST() [139/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeEmptyList   
)

Definition at line 175 of file standard_message_codec_unittests.cc.

175 {
176 std::vector<uint8_t> bytes = {0x0c, 0x00};
177 CheckEncodeDecode(EncodableValue(EncodableList{}), bytes);
178}

◆ TEST() [140/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeEmptyString   
)

Definition at line 150 of file standard_message_codec_unittests.cc.

150 {
151 std::vector<uint8_t> bytes = {0x07, 0x00};
152 CheckEncodeDecode(EncodableValue(u8""), bytes);
153}

◆ TEST() [141/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeFalse   
)

Definition at line 112 of file standard_message_codec_unittests.cc.

112 {
113 std::vector<uint8_t> bytes = {0x02};
114 CheckEncodeDecode(EncodableValue(false), bytes);
115}

◆ TEST() [142/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeFloat32Array   
)

Definition at line 214 of file standard_message_codec_unittests.cc.

214 {
215 std::vector<uint8_t> bytes = {0x0e, 0x02, 0x00, 0x00, 0xd8, 0x0f,
216 0x49, 0x40, 0x00, 0x00, 0x7a, 0x44};
217 EncodableValue value(std::vector<float>{3.1415920257568359375f, 1000.0f});
218 CheckEncodeDecode(value, bytes);
219}

◆ TEST() [143/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeFloat64Array   
)

Definition at line 221 of file standard_message_codec_unittests.cc.

221 {
222 std::vector<uint8_t> bytes = {0x0b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
223 0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40,
224 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x8f, 0x40};
225 EncodableValue value(
226 std::vector<double>{3.14159265358979311599796346854, 1000.0});
227 CheckEncodeDecode(value, bytes);
228}

◆ TEST() [144/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeInt32   
)

Definition at line 117 of file standard_message_codec_unittests.cc.

117 {
118 std::vector<uint8_t> bytes = {0x03, 0x78, 0x56, 0x34, 0x12};
119 CheckEncodeDecode(EncodableValue(0x12345678), bytes);
120}

◆ TEST() [145/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeInt32Array   
)

Definition at line 199 of file standard_message_codec_unittests.cc.

199 {
200 std::vector<uint8_t> bytes = {0x09, 0x03, 0x00, 0x00, 0x78, 0x56, 0x34, 0x12,
201 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00};
202 EncodableValue value(std::vector<int32_t>{0x12345678, -1, 0});
203 CheckEncodeDecode(value, bytes);
204}

◆ TEST() [146/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeInt64   
)

Definition at line 122 of file standard_message_codec_unittests.cc.

122 {
123 std::vector<uint8_t> bytes = {0x04, 0xef, 0xcd, 0xab, 0x90,
124 0x78, 0x56, 0x34, 0x12};
125 CheckEncodeDecode(EncodableValue(INT64_C(0x1234567890abcdef)), bytes);
126}

◆ TEST() [147/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeInt64Array   
)

Definition at line 206 of file standard_message_codec_unittests.cc.

206 {
207 std::vector<uint8_t> bytes = {0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
208 0xef, 0xcd, 0xab, 0x90, 0x78, 0x56, 0x34, 0x12,
209 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
210 EncodableValue value(std::vector<int64_t>{0x1234567890abcdef, -1});
211 CheckEncodeDecode(value, bytes);
212}

◆ TEST() [148/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeList   
)

Definition at line 155 of file standard_message_codec_unittests.cc.

155 {
156 std::vector<uint8_t> bytes = {
157 0x0c, 0x05, 0x00, 0x07, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x06,
158 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x85, 0xeb, 0x51, 0xb8, 0x1e,
159 0x09, 0x40, 0x03, 0x2f, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x03, 0x2a,
160 0x00, 0x00, 0x00, 0x07, 0x06, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64,
161 };
162 EncodableValue value(EncodableList{
163 EncodableValue(),
164 EncodableValue("hello"),
165 EncodableValue(3.14),
166 EncodableValue(47),
167 EncodableValue(EncodableList{
168 EncodableValue(42),
169 EncodableValue("nested"),
170 }),
171 });
172 CheckEncodeDecode(value, bytes);
173}

◆ TEST() [149/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeMap   
)

Definition at line 180 of file standard_message_codec_unittests.cc.

180 {
181 std::vector<uint8_t> bytes_prefix = {0x0d, 0x04};
182 EncodableValue value(EncodableMap{
183 {EncodableValue("a"), EncodableValue(3.14)},
184 {EncodableValue("b"), EncodableValue(47)},
185 {EncodableValue(), EncodableValue()},
186 {EncodableValue(3.14), EncodableValue(EncodableList{
187 EncodableValue("nested"),
188 })},
189 });
190 CheckEncodeDecodeWithEncodePrefix(value, bytes_prefix, 48);
191}
static void CheckEncodeDecodeWithEncodePrefix(const EncodableValue &value, const std::vector< uint8_t > &expected_encoding_prefix, size_t expected_encoding_length)

◆ TEST() [150/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeNull   
)

Definition at line 90 of file standard_message_codec_unittests.cc.

90 {
91 std::vector<uint8_t> bytes = {0x00};
92 CheckEncodeDecode(EncodableValue(), bytes);
93}

◆ TEST() [151/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeSimpleCustomType   
)

Definition at line 230 of file standard_message_codec_unittests.cc.

230 {
231 std::vector<uint8_t> bytes = {0x80, 0x09, 0x00, 0x00, 0x00,
232 0x10, 0x00, 0x00, 0x00};
233 auto point_comparator = [](const EncodableValue& a, const EncodableValue& b) {
234 const Point& a_point =
235 std::any_cast<Point>(std::get<CustomEncodableValue>(a));
236 const Point& b_point =
237 std::any_cast<Point>(std::get<CustomEncodableValue>(b));
238 return a_point == b_point;
239 };
240 CheckEncodeDecode(CustomEncodableValue(Point(9, 16)), bytes,
241 &PointExtensionSerializer::GetInstance(), point_comparator);
242}
TPoint< Scalar > Point
Definition: point.h:322

◆ TEST() [152/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeString   
)

Definition at line 134 of file standard_message_codec_unittests.cc.

134 {
135 std::vector<uint8_t> bytes = {0x07, 0x0b, 0x68, 0x65, 0x6c, 0x6c, 0x6f,
136 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64};
137 CheckEncodeDecode(EncodableValue(u8"hello world"), bytes);
138}

◆ TEST() [153/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeStringWithNonAsciiCodePoint   
)

Definition at line 140 of file standard_message_codec_unittests.cc.

140 {
141 std::vector<uint8_t> bytes = {0x07, 0x05, 0x68, 0xe2, 0x98, 0xba, 0x77};
142 CheckEncodeDecode(EncodableValue(u8"h\u263Aw"), bytes);
143}

◆ TEST() [154/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeStringWithNonBMPCodePoint   
)

Definition at line 145 of file standard_message_codec_unittests.cc.

145 {
146 std::vector<uint8_t> bytes = {0x07, 0x06, 0x68, 0xf0, 0x9f, 0x98, 0x82, 0x77};
147 CheckEncodeDecode(EncodableValue(u8"h\U0001F602w"), bytes);
148}

◆ TEST() [155/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeTrue   
)

Definition at line 107 of file standard_message_codec_unittests.cc.

107 {
108 std::vector<uint8_t> bytes = {0x01};
109 CheckEncodeDecode(EncodableValue(true), bytes);
110}

◆ TEST() [156/363]

flutter::TEST ( StandardMessageCodec  ,
CanEncodeAndDecodeVariableLengthCustomType   
)

Definition at line 244 of file standard_message_codec_unittests.cc.

244 {
245 std::vector<uint8_t> bytes = {
246 0x81, // custom type
247 0x06, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // data
248 0x07, 0x04, // string type and length
249 0x74, 0x65, 0x73, 0x74 // string characters
250 };
251 auto some_data_comparator = [](const EncodableValue& a,
252 const EncodableValue& b) {
253 const SomeData& data_a =
254 std::any_cast<SomeData>(std::get<CustomEncodableValue>(a));
255 const SomeData& data_b =
256 std::any_cast<SomeData>(std::get<CustomEncodableValue>(b));
257 return data_a.data() == data_b.data() && data_a.label() == data_b.label();
258 };
259 CheckEncodeDecode(CustomEncodableValue(
260 SomeData("test", {0x00, 0x01, 0x02, 0x03, 0x04, 0x05})),
261 bytes, &SomeDataExtensionSerializer::GetInstance(),
262 some_data_comparator);
263}

◆ TEST() [157/363]

flutter::TEST ( StandardMessageCodec  ,
GetInstanceCachesInstance   
)

Definition at line 82 of file standard_message_codec_unittests.cc.

82 {
83 const StandardMessageCodec& codec_a =
84 StandardMessageCodec::GetInstance(nullptr);
85 const StandardMessageCodec& codec_b =
86 StandardMessageCodec::GetInstance(nullptr);
87 EXPECT_EQ(&codec_a, &codec_b);
88}

◆ TEST() [158/363]

flutter::TEST ( StandardMethodCodec  ,
GetInstanceCachesInstance   
)

Definition at line 35 of file standard_method_codec_unittests.cc.

35 {
36 const StandardMethodCodec& codec_a =
37 StandardMethodCodec::GetInstance(nullptr);
38 const StandardMethodCodec& codec_b =
39 StandardMethodCodec::GetInstance(nullptr);
40 EXPECT_EQ(&codec_a, &codec_b);
41}

◆ TEST() [159/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesCustomTypeArguments   
)

Definition at line 167 of file standard_method_codec_unittests.cc.

167 {
168 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance(
169 &PointExtensionSerializer::GetInstance());
170 Point point(7, 9);
172 "hello", std::make_unique<EncodableValue>(CustomEncodableValue(point)));
173 auto encoded = codec.EncodeMethodCall(call);
174 ASSERT_NE(encoded.get(), nullptr);
175 std::unique_ptr<MethodCall<>> decoded = codec.DecodeMethodCall(*encoded);
176 ASSERT_NE(decoded.get(), nullptr);
177
178 const Point& decoded_point = std::any_cast<Point>(
179 std::get<CustomEncodableValue>(*decoded->arguments()));
180 EXPECT_EQ(point, decoded_point);
181};

◆ TEST() [160/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesErrorEnvelopesWithDetails   
)

Definition at line 130 of file standard_method_codec_unittests.cc.

130 {
131 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
133 EncodableValue("a"),
134 EncodableValue(42),
135 });
136 auto encoded =
137 codec.EncodeErrorEnvelope("errorCode", "something failed", &details);
138 ASSERT_NE(encoded.get(), nullptr);
139 std::vector<uint8_t> bytes = {
140 0x01, 0x07, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f,
141 0x64, 0x65, 0x07, 0x10, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68,
142 0x69, 0x6e, 0x67, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64,
143 0x0c, 0x02, 0x07, 0x01, 0x61, 0x03, 0x2a, 0x00, 0x00, 0x00,
144 };
145 EXPECT_EQ(*encoded, bytes);
146
147 bool decoded_successfully = false;
148 MethodResultFunctions<> result_handler(
149 nullptr,
150 [&decoded_successfully](const std::string& code,
151 const std::string& message,
152 const EncodableValue* details) {
153 decoded_successfully = true;
154 EXPECT_EQ(code, "errorCode");
155 EXPECT_EQ(message, "something failed");
156 const auto* details_list = std::get_if<EncodableList>(details);
157 ASSERT_NE(details_list, nullptr);
158 EXPECT_EQ(std::get<std::string>((*details_list)[0]), "a");
159 EXPECT_EQ(std::get<int32_t>((*details_list)[1]), 42);
160 },
161 nullptr);
162 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
163 &result_handler);
164 EXPECT_TRUE(decoded_successfully);
165}

◆ TEST() [161/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesErrorEnvelopesWithNulls   
)

Definition at line 105 of file standard_method_codec_unittests.cc.

105 {
106 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
107 auto encoded = codec.EncodeErrorEnvelope("errorCode");
108 ASSERT_NE(encoded.get(), nullptr);
109 std::vector<uint8_t> bytes = {0x01, 0x07, 0x09, 0x65, 0x72, 0x72, 0x6f,
110 0x72, 0x43, 0x6f, 0x64, 0x65, 0x00, 0x00};
111 EXPECT_EQ(*encoded, bytes);
112
113 bool decoded_successfully = false;
114 MethodResultFunctions<> result_handler(
115 nullptr,
116 [&decoded_successfully](const std::string& code,
117 const std::string& message,
118 const EncodableValue* details) {
119 decoded_successfully = true;
120 EXPECT_EQ(code, "errorCode");
121 EXPECT_EQ(message, "");
122 EXPECT_EQ(details, nullptr);
123 },
124 nullptr);
125 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
126 &result_handler);
127 EXPECT_TRUE(decoded_successfully);
128}

◆ TEST() [162/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesMethodCallsWithArgument   
)

Definition at line 53 of file standard_method_codec_unittests.cc.

53 {
54 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
55 MethodCall<> call("hello", std::make_unique<EncodableValue>(EncodableList{
57 EncodableValue("world"),
58 }));
59 auto encoded = codec.EncodeMethodCall(call);
60 ASSERT_NE(encoded.get(), nullptr);
61 std::unique_ptr<MethodCall<>> decoded = codec.DecodeMethodCall(*encoded);
62 ASSERT_NE(decoded.get(), nullptr);
63 EXPECT_TRUE(MethodCallsAreEqual(call, *decoded));
64}

◆ TEST() [163/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesMethodCallsWithNullArguments   
)

Definition at line 43 of file standard_method_codec_unittests.cc.

43 {
44 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
45 MethodCall<> call("hello", nullptr);
46 auto encoded = codec.EncodeMethodCall(call);
47 ASSERT_NE(encoded.get(), nullptr);
48 std::unique_ptr<MethodCall<>> decoded = codec.DecodeMethodCall(*encoded);
49 ASSERT_NE(decoded.get(), nullptr);
50 EXPECT_TRUE(MethodCallsAreEqual(call, *decoded));
51}

◆ TEST() [164/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesSuccessEnvelopesWithNullResult   
)

Definition at line 66 of file standard_method_codec_unittests.cc.

66 {
67 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
68 auto encoded = codec.EncodeSuccessEnvelope();
69 ASSERT_NE(encoded.get(), nullptr);
70 std::vector<uint8_t> bytes = {0x00, 0x00};
71 EXPECT_EQ(*encoded, bytes);
72
73 bool decoded_successfully = false;
74 MethodResultFunctions<> result_handler(
75 [&decoded_successfully](const EncodableValue* result) {
76 decoded_successfully = true;
77 EXPECT_EQ(result, nullptr);
78 },
79 nullptr, nullptr);
80 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
81 &result_handler);
82 EXPECT_TRUE(decoded_successfully);
83}

◆ TEST() [165/363]

flutter::TEST ( StandardMethodCodec  ,
HandlesSuccessEnvelopesWithResult   
)

Definition at line 85 of file standard_method_codec_unittests.cc.

85 {
86 const StandardMethodCodec& codec = StandardMethodCodec::GetInstance();
88 auto encoded = codec.EncodeSuccessEnvelope(&result);
89 ASSERT_NE(encoded.get(), nullptr);
90 std::vector<uint8_t> bytes = {0x00, 0x03, 0x2a, 0x00, 0x00, 0x00};
91 EXPECT_EQ(*encoded, bytes);
92
93 bool decoded_successfully = false;
94 MethodResultFunctions<> result_handler(
95 [&decoded_successfully](const EncodableValue* result) {
96 decoded_successfully = true;
97 EXPECT_EQ(std::get<int32_t>(*result), 42);
98 },
99 nullptr, nullptr);
100 codec.DecodeAndProcessResponseEnvelope(encoded->data(), encoded->size(),
101 &result_handler);
102 EXPECT_TRUE(decoded_successfully);
103}

◆ TEST() [166/363]

flutter::TEST ( TextEditingDeltaTest  ,
TestTextEditingDeltaConstructor   
)

Definition at line 11 of file text_editing_delta_unittests.cc.

11 {
12 // Here we are simulating inserting an "o" at the end of "hell".
13 std::string old_text = "hell";
14 std::string replacement_text = "hello";
15 TextRange range(0, 4);
16
17 TextEditingDelta delta = TextEditingDelta(old_text, range, replacement_text);
18
19 EXPECT_EQ(delta.old_text(), old_text);
20 EXPECT_EQ(delta.delta_text(), "hello");
21 EXPECT_EQ(delta.delta_start(), 0);
22 EXPECT_EQ(delta.delta_end(), 4);
23}
A change in the state of an input field.

◆ TEST() [167/363]

flutter::TEST ( TextEditingDeltaTest  ,
TestTextEditingDeltaNonTextConstructor   
)

Definition at line 25 of file text_editing_delta_unittests.cc.

25 {
26 // Here we are simulating inserting an "o" at the end of "hell".
27 std::string old_text = "hello";
28
30
31 EXPECT_EQ(delta.old_text(), old_text);
32 EXPECT_EQ(delta.delta_text(), "");
33 EXPECT_EQ(delta.delta_start(), -1);
34 EXPECT_EQ(delta.delta_end(), -1);
35}

◆ TEST() [168/363]

flutter::TEST ( TextInputModel  ,
AddCodePoint   
)

Definition at line 417 of file text_input_model_unittests.cc.

417 {
418 auto model = std::make_unique<TextInputModel>();
419 model->AddCodePoint('A');
420 model->AddCodePoint('B');
421 model->AddCodePoint(0x1f604);
422 model->AddCodePoint('D');
423 model->AddCodePoint('E');
424 EXPECT_EQ(model->selection(), TextRange(6));
425 EXPECT_EQ(model->composing_range(), TextRange(0));
426 EXPECT_STREQ(model->GetText().c_str(), "AB😄DE");
427}

◆ TEST() [169/363]

flutter::TEST ( TextInputModel  ,
AddCodePointReverseSelection   
)

Definition at line 439 of file text_input_model_unittests.cc.

439 {
440 auto model = std::make_unique<TextInputModel>();
441 model->SetText("ABCDE");
442 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
443 model->AddCodePoint('x');
444 EXPECT_EQ(model->selection(), TextRange(2));
445 EXPECT_EQ(model->composing_range(), TextRange(0));
446 EXPECT_STREQ(model->GetText().c_str(), "AxE");
447}

◆ TEST() [170/363]

flutter::TEST ( TextInputModel  ,
AddCodePointReverseSelectionWideCharacter   
)

Definition at line 459 of file text_input_model_unittests.cc.

459 {
460 auto model = std::make_unique<TextInputModel>();
461 model->SetText("ABCDE");
462 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
463 model->AddCodePoint(0x1f604);
464 EXPECT_EQ(model->selection(), TextRange(3));
465 EXPECT_EQ(model->composing_range(), TextRange(0));
466 EXPECT_STREQ(model->GetText().c_str(), "A😄E");
467}

◆ TEST() [171/363]

flutter::TEST ( TextInputModel  ,
AddCodePointSelection   
)

Definition at line 429 of file text_input_model_unittests.cc.

429 {
430 auto model = std::make_unique<TextInputModel>();
431 model->SetText("ABCDE");
432 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
433 model->AddCodePoint('x');
434 EXPECT_EQ(model->selection(), TextRange(2));
435 EXPECT_EQ(model->composing_range(), TextRange(0));
436 EXPECT_STREQ(model->GetText().c_str(), "AxE");
437}

◆ TEST() [172/363]

flutter::TEST ( TextInputModel  ,
AddCodePointSelectionWideCharacter   
)

Definition at line 449 of file text_input_model_unittests.cc.

449 {
450 auto model = std::make_unique<TextInputModel>();
451 model->SetText("ABCDE");
452 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
453 model->AddCodePoint(0x1f604);
454 EXPECT_EQ(model->selection(), TextRange(3));
455 EXPECT_EQ(model->composing_range(), TextRange(0));
456 EXPECT_STREQ(model->GetText().c_str(), "A😄E");
457}

◆ TEST() [173/363]

flutter::TEST ( TextInputModel  ,
AddText   
)

Definition at line 469 of file text_input_model_unittests.cc.

469 {
470 auto model = std::make_unique<TextInputModel>();
471 model->AddText(u"ABCDE");
472 model->AddText("😄");
473 model->AddText("FGHIJ");
474 EXPECT_EQ(model->selection(), TextRange(12));
475 EXPECT_EQ(model->composing_range(), TextRange(0));
476 EXPECT_STREQ(model->GetText().c_str(), "ABCDE😄FGHIJ");
477}

◆ TEST() [174/363]

flutter::TEST ( TextInputModel  ,
AddTextReverseSelection   
)

Definition at line 489 of file text_input_model_unittests.cc.

489 {
490 auto model = std::make_unique<TextInputModel>();
491 model->SetText("ABCDE");
492 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
493 model->AddText("xy");
494 EXPECT_EQ(model->selection(), TextRange(3));
495 EXPECT_EQ(model->composing_range(), TextRange(0));
496 EXPECT_STREQ(model->GetText().c_str(), "AxyE");
497}

◆ TEST() [175/363]

flutter::TEST ( TextInputModel  ,
AddTextReverseSelectionWideCharacter   
)

Definition at line 509 of file text_input_model_unittests.cc.

509 {
510 auto model = std::make_unique<TextInputModel>();
511 model->SetText("ABCDE");
512 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
513 model->AddText(u"😄🙃");
514 EXPECT_EQ(model->selection(), TextRange(5));
515 EXPECT_EQ(model->composing_range(), TextRange(0));
516 EXPECT_STREQ(model->GetText().c_str(), "A😄🙃E");
517}

◆ TEST() [176/363]

flutter::TEST ( TextInputModel  ,
AddTextSelection   
)

Definition at line 479 of file text_input_model_unittests.cc.

479 {
480 auto model = std::make_unique<TextInputModel>();
481 model->SetText("ABCDE");
482 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
483 model->AddText("xy");
484 EXPECT_EQ(model->selection(), TextRange(3));
485 EXPECT_EQ(model->composing_range(), TextRange(0));
486 EXPECT_STREQ(model->GetText().c_str(), "AxyE");
487}

◆ TEST() [177/363]

flutter::TEST ( TextInputModel  ,
AddTextSelectionWideCharacter   
)

Definition at line 499 of file text_input_model_unittests.cc.

499 {
500 auto model = std::make_unique<TextInputModel>();
501 model->SetText("ABCDE");
502 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
503 model->AddText(u"😄🙃");
504 EXPECT_EQ(model->selection(), TextRange(5));
505 EXPECT_EQ(model->composing_range(), TextRange(0));
506 EXPECT_STREQ(model->GetText().c_str(), "A😄🙃E");
507}

◆ TEST() [178/363]

flutter::TEST ( TextInputModel  ,
BackspaceEnd   
)

Definition at line 878 of file text_input_model_unittests.cc.

878 {
879 auto model = std::make_unique<TextInputModel>();
880 model->SetText("ABCDE");
881 EXPECT_TRUE(model->SetSelection(TextRange(5)));
882 ASSERT_TRUE(model->Backspace());
883 EXPECT_EQ(model->selection(), TextRange(4));
884 EXPECT_EQ(model->composing_range(), TextRange(0));
885 EXPECT_STREQ(model->GetText().c_str(), "ABCD");
886}

◆ TEST() [179/363]

flutter::TEST ( TextInputModel  ,
BackspaceEndComposing   
)

Definition at line 962 of file text_input_model_unittests.cc.

962 {
963 auto model = std::make_unique<TextInputModel>();
964 model->SetText("ABCDE");
965 model->BeginComposing();
966 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
967 ASSERT_TRUE(model->Backspace());
968 EXPECT_EQ(model->selection(), TextRange(3));
969 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
970 EXPECT_STREQ(model->GetText().c_str(), "ABCE");
971}

◆ TEST() [180/363]

flutter::TEST ( TextInputModel  ,
BackspaceEndReverseComposing   
)

Definition at line 973 of file text_input_model_unittests.cc.

973 {
974 auto model = std::make_unique<TextInputModel>();
975 model->SetText("ABCDE");
976 model->BeginComposing();
977 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
978 ASSERT_TRUE(model->Backspace());
979 EXPECT_EQ(model->selection(), TextRange(3));
980 EXPECT_EQ(model->composing_range(), TextRange(3, 1));
981 EXPECT_STREQ(model->GetText().c_str(), "ABCE");
982}

◆ TEST() [181/363]

flutter::TEST ( TextInputModel  ,
BackspaceMiddle   
)

Definition at line 868 of file text_input_model_unittests.cc.

868 {
869 auto model = std::make_unique<TextInputModel>();
870 model->SetText("ABCDE");
871 EXPECT_TRUE(model->SetSelection(TextRange(2)));
872 ASSERT_TRUE(model->Backspace());
873 EXPECT_EQ(model->selection(), TextRange(1));
874 EXPECT_EQ(model->composing_range(), TextRange(0));
875 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
876}

◆ TEST() [182/363]

flutter::TEST ( TextInputModel  ,
BackspaceMiddleComposing   
)

Definition at line 940 of file text_input_model_unittests.cc.

940 {
941 auto model = std::make_unique<TextInputModel>();
942 model->SetText("ABCDE");
943 model->BeginComposing();
944 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
945 ASSERT_TRUE(model->Backspace());
946 EXPECT_EQ(model->selection(), TextRange(1));
947 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
948 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
949}

◆ TEST() [183/363]

flutter::TEST ( TextInputModel  ,
BackspaceMiddleReverseComposing   
)

Definition at line 951 of file text_input_model_unittests.cc.

951 {
952 auto model = std::make_unique<TextInputModel>();
953 model->SetText("ABCDE");
954 model->BeginComposing();
955 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
956 ASSERT_TRUE(model->Backspace());
957 EXPECT_EQ(model->selection(), TextRange(1));
958 EXPECT_EQ(model->composing_range(), TextRange(3, 1));
959 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
960}

◆ TEST() [184/363]

flutter::TEST ( TextInputModel  ,
BackspaceReverseSelection   
)

Definition at line 908 of file text_input_model_unittests.cc.

908 {
909 auto model = std::make_unique<TextInputModel>();
910 model->SetText("ABCDE");
911 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
912 ASSERT_TRUE(model->Delete());
913 EXPECT_EQ(model->selection(), TextRange(1));
914 EXPECT_EQ(model->composing_range(), TextRange(0));
915 EXPECT_STREQ(model->GetText().c_str(), "AE");
916}

◆ TEST() [185/363]

flutter::TEST ( TextInputModel  ,
BackspaceSelection   
)

Definition at line 898 of file text_input_model_unittests.cc.

898 {
899 auto model = std::make_unique<TextInputModel>();
900 model->SetText("ABCDE");
901 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
902 ASSERT_TRUE(model->Delete());
903 EXPECT_EQ(model->selection(), TextRange(1));
904 EXPECT_EQ(model->composing_range(), TextRange(0));
905 EXPECT_STREQ(model->GetText().c_str(), "AE");
906}

◆ TEST() [186/363]

flutter::TEST ( TextInputModel  ,
BackspaceStart   
)

Definition at line 858 of file text_input_model_unittests.cc.

858 {
859 auto model = std::make_unique<TextInputModel>();
860 model->SetText("ABCDE");
861 EXPECT_TRUE(model->SetSelection(TextRange(0)));
862 ASSERT_FALSE(model->Backspace());
863 EXPECT_EQ(model->selection(), TextRange(0));
864 EXPECT_EQ(model->composing_range(), TextRange(0));
865 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
866}

◆ TEST() [187/363]

flutter::TEST ( TextInputModel  ,
BackspaceStartComposing   
)

Definition at line 918 of file text_input_model_unittests.cc.

918 {
919 auto model = std::make_unique<TextInputModel>();
920 model->SetText("ABCDE");
921 model->BeginComposing();
922 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
923 ASSERT_FALSE(model->Backspace());
924 EXPECT_EQ(model->selection(), TextRange(1));
925 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
926 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
927}

◆ TEST() [188/363]

flutter::TEST ( TextInputModel  ,
BackspaceStartReverseComposing   
)

Definition at line 929 of file text_input_model_unittests.cc.

929 {
930 auto model = std::make_unique<TextInputModel>();
931 model->SetText("ABCDE");
932 model->BeginComposing();
933 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
934 ASSERT_FALSE(model->Backspace());
935 EXPECT_EQ(model->selection(), TextRange(1));
936 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
937 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
938}

◆ TEST() [189/363]

flutter::TEST ( TextInputModel  ,
BackspaceWideCharacters   
)

Definition at line 888 of file text_input_model_unittests.cc.

888 {
889 auto model = std::make_unique<TextInputModel>();
890 model->SetText("😄🙃🤪🧐");
891 EXPECT_TRUE(model->SetSelection(TextRange(4)));
892 ASSERT_TRUE(model->Backspace());
893 EXPECT_EQ(model->selection(), TextRange(2));
894 EXPECT_EQ(model->composing_range(), TextRange(0));
895 EXPECT_STREQ(model->GetText().c_str(), "😄🤪🧐");
896}

◆ TEST() [190/363]

flutter::TEST ( TextInputModel  ,
CommitComposingNoTextWithNoSelection   
)

Definition at line 230 of file text_input_model_unittests.cc.

230 {
231 auto model = std::make_unique<TextInputModel>();
232 model->SetText("ABCDE");
233 model->SetSelection(TextRange(0));
234
235 // Verify no changes on BeginComposing.
236 model->BeginComposing();
237 EXPECT_EQ(model->selection(), TextRange(0));
238 EXPECT_EQ(model->composing_range(), TextRange(0));
239 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
240
241 // Verify no changes on CommitComposing.
242 model->CommitComposing();
243 EXPECT_EQ(model->selection(), TextRange(0));
244 EXPECT_EQ(model->composing_range(), TextRange(0));
245 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
246
247 // Verify no changes on CommitComposing.
248 model->EndComposing();
249 EXPECT_EQ(model->selection(), TextRange(0));
250 EXPECT_EQ(model->composing_range(), TextRange(0));
251 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
252}
SkRange< size_t > TextRange
Definition: TextStyle.h:337

◆ TEST() [191/363]

flutter::TEST ( TextInputModel  ,
CommitComposingNoTextWithSelection   
)

Definition at line 255 of file text_input_model_unittests.cc.

255 {
256 auto model = std::make_unique<TextInputModel>();
257 model->SetText("ABCDE");
258 model->SetSelection(TextRange(1, 3));
259
260 // Verify no changes on BeginComposing.
261 model->BeginComposing();
262 EXPECT_EQ(model->selection(), TextRange(1, 3));
263 EXPECT_EQ(model->composing_range(), TextRange(1));
264 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
265
266 // Verify no changes on CommitComposing.
267 model->CommitComposing();
268 EXPECT_EQ(model->selection(), TextRange(1, 3));
269 EXPECT_EQ(model->composing_range(), TextRange(1));
270 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
271
272 // Verify no changes on CommitComposing.
273 model->EndComposing();
274 EXPECT_EQ(model->selection(), TextRange(1, 3));
275 EXPECT_EQ(model->composing_range(), TextRange(0));
276 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
277}

◆ TEST() [192/363]

flutter::TEST ( TextInputModel  ,
CommitComposingTextWithNoSelection   
)

Definition at line 280 of file text_input_model_unittests.cc.

280 {
281 auto model = std::make_unique<TextInputModel>();
282 model->SetText("ABCDE");
283 model->SetSelection(TextRange(1));
284
285 // Verify no changes on BeginComposing.
286 model->BeginComposing();
287 EXPECT_EQ(model->selection(), TextRange(1));
288 EXPECT_EQ(model->composing_range(), TextRange(1));
289 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
290
291 // Verify selection base, extent and composing extent increment as text is
292 // entered. Verify composing base does not change.
293 model->UpdateComposingText("つ");
294 EXPECT_EQ(model->selection(), TextRange(2));
295 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
296 EXPECT_STREQ(model->GetText().c_str(), "AつBCDE");
297 model->UpdateComposingText("つる");
298 EXPECT_EQ(model->selection(), TextRange(3));
299 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
300 EXPECT_STREQ(model->GetText().c_str(), "AつるBCDE");
301
302 // Verify that cursor position is set to correct offset from composing base.
303 model->UpdateComposingText("鶴");
304 EXPECT_TRUE(model->SetSelection(TextRange(1)));
305 EXPECT_EQ(model->selection(), TextRange(1));
306 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
307 EXPECT_STREQ(model->GetText().c_str(), "A鶴BCDE");
308
309 // Verify composing base is set to composing extent on commit.
310 model->CommitComposing();
311 EXPECT_EQ(model->selection(), TextRange(2));
312 EXPECT_EQ(model->composing_range(), TextRange(2));
313 EXPECT_STREQ(model->GetText().c_str(), "A鶴BCDE");
314
315 // Verify that further text entry increments the selection base, extent and
316 // the composing extent. Verify that composing base does not change.
317 model->UpdateComposingText("が");
318 EXPECT_EQ(model->selection(), TextRange(3));
319 EXPECT_EQ(model->composing_range(), TextRange(2, 3));
320 EXPECT_STREQ(model->GetText().c_str(), "A鶴がBCDE");
321
322 // Verify composing base is set to composing extent on commit.
323 model->CommitComposing();
324 EXPECT_EQ(model->selection(), TextRange(3));
325 EXPECT_EQ(model->composing_range(), TextRange(3));
326 EXPECT_STREQ(model->GetText().c_str(), "A鶴がBCDE");
327
328 // Verify no changes on EndComposing.
329 model->EndComposing();
330 EXPECT_EQ(model->selection(), TextRange(3));
331 EXPECT_EQ(model->composing_range(), TextRange(0));
332 EXPECT_STREQ(model->GetText().c_str(), "A鶴がBCDE");
333}

◆ TEST() [193/363]

flutter::TEST ( TextInputModel  ,
CommitComposingTextWithSelection   
)

Definition at line 336 of file text_input_model_unittests.cc.

336 {
337 auto model = std::make_unique<TextInputModel>();
338 model->SetText("ABCDE");
339 model->SetSelection(TextRange(1, 3));
340
341 // Verify no changes on BeginComposing.
342 model->BeginComposing();
343 EXPECT_EQ(model->selection(), TextRange(1, 3));
344 EXPECT_EQ(model->composing_range(), TextRange(1));
345 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
346
347 // Verify selection is replaced and selection base, extent and composing
348 // extent increment to the position immediately after the composing text.
349 // Verify composing base does not change.
350 model->UpdateComposingText("つ");
351 EXPECT_EQ(model->selection(), TextRange(2));
352 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
353 EXPECT_STREQ(model->GetText().c_str(), "AつDE");
354
355 // Verify that further text entry increments the selection base, extent and
356 // the composing extent. Verify that composing base does not change.
357 model->UpdateComposingText("つる");
358 EXPECT_EQ(model->selection(), TextRange(3));
359 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
360 EXPECT_STREQ(model->GetText().c_str(), "AつるDE");
361
362 // Verify that cursor position is set to correct offset from composing base.
363 model->UpdateComposingText("鶴");
364 EXPECT_TRUE(model->SetSelection(TextRange(1)));
365 EXPECT_EQ(model->selection(), TextRange(1));
366 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
367 EXPECT_STREQ(model->GetText().c_str(), "A鶴DE");
368
369 // Verify composing base is set to composing extent on commit.
370 model->CommitComposing();
371 EXPECT_EQ(model->selection(), TextRange(2));
372 EXPECT_EQ(model->composing_range(), TextRange(2));
373 EXPECT_STREQ(model->GetText().c_str(), "A鶴DE");
374
375 // Verify that further text entry increments the selection base, extent and
376 // the composing extent. Verify that composing base does not change.
377 model->UpdateComposingText("が");
378 EXPECT_EQ(model->selection(), TextRange(3));
379 EXPECT_EQ(model->composing_range(), TextRange(2, 3));
380 EXPECT_STREQ(model->GetText().c_str(), "A鶴がDE");
381
382 // Verify composing base is set to composing extent on commit.
383 model->CommitComposing();
384 EXPECT_EQ(model->selection(), TextRange(3));
385 EXPECT_EQ(model->composing_range(), TextRange(3));
386 EXPECT_STREQ(model->GetText().c_str(), "A鶴がDE");
387
388 // Verify no changes on EndComposing.
389 model->EndComposing();
390 EXPECT_EQ(model->selection(), TextRange(3));
391 EXPECT_EQ(model->composing_range(), TextRange(0));
392 EXPECT_STREQ(model->GetText().c_str(), "A鶴がDE");
393}

◆ TEST() [194/363]

flutter::TEST ( TextInputModel  ,
DeleteEnd   
)

Definition at line 539 of file text_input_model_unittests.cc.

539 {
540 auto model = std::make_unique<TextInputModel>();
541 model->SetText("ABCDE");
542 EXPECT_TRUE(model->SetSelection(TextRange(5)));
543 ASSERT_FALSE(model->Delete());
544 EXPECT_EQ(model->selection(), TextRange(5));
545 EXPECT_EQ(model->composing_range(), TextRange(0));
546 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
547}

◆ TEST() [195/363]

flutter::TEST ( TextInputModel  ,
DeleteEndComposing   
)

Definition at line 627 of file text_input_model_unittests.cc.

627 {
628 auto model = std::make_unique<TextInputModel>();
629 model->SetText("ABCDE");
630 model->BeginComposing();
631 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
632 ASSERT_FALSE(model->Delete());
633 EXPECT_EQ(model->selection(), TextRange(4));
634 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
635 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
636}

◆ TEST() [196/363]

flutter::TEST ( TextInputModel  ,
DeleteEndReverseComposing   
)

Definition at line 638 of file text_input_model_unittests.cc.

638 {
639 auto model = std::make_unique<TextInputModel>();
640 model->SetText("ABCDE");
641 model->BeginComposing();
642 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
643 ASSERT_FALSE(model->Delete());
644 EXPECT_EQ(model->selection(), TextRange(4));
645 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
646 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
647}

◆ TEST() [197/363]

flutter::TEST ( TextInputModel  ,
DeleteMiddle   
)

Definition at line 529 of file text_input_model_unittests.cc.

529 {
530 auto model = std::make_unique<TextInputModel>();
531 model->SetText("ABCDE");
532 EXPECT_TRUE(model->SetSelection(TextRange(2)));
533 ASSERT_TRUE(model->Delete());
534 EXPECT_EQ(model->selection(), TextRange(2));
535 EXPECT_EQ(model->composing_range(), TextRange(0));
536 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
537}

◆ TEST() [198/363]

flutter::TEST ( TextInputModel  ,
DeleteMiddleComposing   
)

Definition at line 605 of file text_input_model_unittests.cc.

605 {
606 auto model = std::make_unique<TextInputModel>();
607 model->SetText("ABCDE");
608 model->BeginComposing();
609 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
610 ASSERT_TRUE(model->Delete());
611 EXPECT_EQ(model->selection(), TextRange(2));
612 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
613 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
614}

◆ TEST() [199/363]

flutter::TEST ( TextInputModel  ,
DeleteMiddleReverseComposing   
)

Definition at line 616 of file text_input_model_unittests.cc.

616 {
617 auto model = std::make_unique<TextInputModel>();
618 model->SetText("ABCDE");
619 model->BeginComposing();
620 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
621 ASSERT_TRUE(model->Delete());
622 EXPECT_EQ(model->selection(), TextRange(2));
623 EXPECT_EQ(model->composing_range(), TextRange(3, 1));
624 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
625}

◆ TEST() [200/363]

flutter::TEST ( TextInputModel  ,
DeleteReverseSelection   
)

Definition at line 569 of file text_input_model_unittests.cc.

569 {
570 auto model = std::make_unique<TextInputModel>();
571 model->SetText("ABCDE");
572 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
573 ASSERT_TRUE(model->Delete());
574 EXPECT_EQ(model->selection(), TextRange(1));
575 EXPECT_EQ(model->composing_range(), TextRange(0));
576 EXPECT_STREQ(model->GetText().c_str(), "AE");
577}

◆ TEST() [201/363]

flutter::TEST ( TextInputModel  ,
DeleteSelection   
)

Definition at line 559 of file text_input_model_unittests.cc.

559 {
560 auto model = std::make_unique<TextInputModel>();
561 model->SetText("ABCDE");
562 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
563 ASSERT_TRUE(model->Delete());
564 EXPECT_EQ(model->selection(), TextRange(1));
565 EXPECT_EQ(model->composing_range(), TextRange(0));
566 EXPECT_STREQ(model->GetText().c_str(), "AE");
567}

◆ TEST() [202/363]

flutter::TEST ( TextInputModel  ,
DeleteStart   
)

Definition at line 519 of file text_input_model_unittests.cc.

519 {
520 auto model = std::make_unique<TextInputModel>();
521 model->SetText("ABCDE");
522 EXPECT_TRUE(model->SetSelection(TextRange(0)));
523 ASSERT_TRUE(model->Delete());
524 EXPECT_EQ(model->selection(), TextRange(0));
525 EXPECT_EQ(model->composing_range(), TextRange(0));
526 EXPECT_STREQ(model->GetText().c_str(), "BCDE");
527}

◆ TEST() [203/363]

flutter::TEST ( TextInputModel  ,
DeleteStartComposing   
)

Definition at line 579 of file text_input_model_unittests.cc.

579 {
580 auto model = std::make_unique<TextInputModel>();
581 model->SetText("ABCDE");
582 model->BeginComposing();
583 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
584 EXPECT_EQ(model->selection(), TextRange(1));
585 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
586 ASSERT_TRUE(model->Delete());
587 EXPECT_EQ(model->selection(), TextRange(1));
588 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
589 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
590}

◆ TEST() [204/363]

flutter::TEST ( TextInputModel  ,
DeleteStartReverseComposing   
)

Definition at line 592 of file text_input_model_unittests.cc.

592 {
593 auto model = std::make_unique<TextInputModel>();
594 model->SetText("ABCDE");
595 model->BeginComposing();
596 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
597 EXPECT_EQ(model->selection(), TextRange(1));
598 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
599 ASSERT_TRUE(model->Delete());
600 EXPECT_EQ(model->selection(), TextRange(1));
601 EXPECT_EQ(model->composing_range(), TextRange(3, 1));
602 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
603}

◆ TEST() [205/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursor   
)

Definition at line 775 of file text_input_model_unittests.cc.

775 {
776 auto model = std::make_unique<TextInputModel>();
777 model->SetText("ABCDE");
778 EXPECT_TRUE(model->SetSelection(TextRange(2)));
779 EXPECT_TRUE(model->DeleteSurrounding(1, 1));
780 EXPECT_EQ(model->selection(), TextRange(2));
781 EXPECT_EQ(model->composing_range(), TextRange(0));
782 EXPECT_STREQ(model->GetText().c_str(), "ABCE");
783}

◆ TEST() [206/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursorAll   
)

Definition at line 796 of file text_input_model_unittests.cc.

796 {
797 auto model = std::make_unique<TextInputModel>();
798 model->SetText("ABCDE");
799 EXPECT_TRUE(model->SetSelection(TextRange(2)));
800 EXPECT_TRUE(model->DeleteSurrounding(1, 2));
801 EXPECT_EQ(model->selection(), TextRange(2));
802 EXPECT_EQ(model->composing_range(), TextRange(0));
803 EXPECT_STREQ(model->GetText().c_str(), "ABC");
804}

◆ TEST() [207/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursorAllComposing   
)

Definition at line 806 of file text_input_model_unittests.cc.

806 {
807 auto model = std::make_unique<TextInputModel>();
808 model->SetText("ABCDE");
809 model->BeginComposing();
810 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
811 EXPECT_TRUE(model->DeleteSurrounding(1, 2));
812 EXPECT_EQ(model->selection(), TextRange(1));
813 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
814 EXPECT_STREQ(model->GetText().c_str(), "ABE");
815}

◆ TEST() [208/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursorComposing   
)

Definition at line 785 of file text_input_model_unittests.cc.

785 {
786 auto model = std::make_unique<TextInputModel>();
787 model->SetText("ABCDE");
788 model->BeginComposing();
789 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
790 EXPECT_TRUE(model->DeleteSurrounding(1, 1));
791 EXPECT_EQ(model->selection(), TextRange(1));
792 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
793 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
794}

◆ TEST() [209/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursorGreedy   
)

Definition at line 817 of file text_input_model_unittests.cc.

817 {
818 auto model = std::make_unique<TextInputModel>();
819 model->SetText("ABCDE");
820 EXPECT_TRUE(model->SetSelection(TextRange(2)));
821 EXPECT_TRUE(model->DeleteSurrounding(1, 3));
822 EXPECT_EQ(model->selection(), TextRange(2));
823 EXPECT_EQ(model->composing_range(), TextRange(0));
824 EXPECT_STREQ(model->GetText().c_str(), "ABC");
825}

◆ TEST() [210/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAfterCursorGreedyComposing   
)

Definition at line 827 of file text_input_model_unittests.cc.

827 {
828 auto model = std::make_unique<TextInputModel>();
829 model->SetText("ABCDE");
830 model->BeginComposing();
831 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
832 EXPECT_TRUE(model->DeleteSurrounding(1, 3));
833 EXPECT_EQ(model->selection(), TextRange(1));
834 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
835 EXPECT_STREQ(model->GetText().c_str(), "ABE");
836}

◆ TEST() [211/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursor   
)

Definition at line 649 of file text_input_model_unittests.cc.

649 {
650 auto model = std::make_unique<TextInputModel>();
651 model->SetText("ABCDE");
652 EXPECT_TRUE(model->SetSelection(TextRange(2)));
653 EXPECT_TRUE(model->DeleteSurrounding(0, 1));
654 EXPECT_EQ(model->selection(), TextRange(2));
655 EXPECT_EQ(model->composing_range(), TextRange(0));
656 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
657}

◆ TEST() [212/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursorAll   
)

Definition at line 670 of file text_input_model_unittests.cc.

670 {
671 auto model = std::make_unique<TextInputModel>();
672 model->SetText("ABCDE");
673 EXPECT_TRUE(model->SetSelection(TextRange(2)));
674 EXPECT_TRUE(model->DeleteSurrounding(0, 3));
675 EXPECT_EQ(model->selection(), TextRange(2));
676 EXPECT_EQ(model->composing_range(), TextRange(0));
677 EXPECT_STREQ(model->GetText().c_str(), "AB");
678}

◆ TEST() [213/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursorAllComposing   
)

Definition at line 680 of file text_input_model_unittests.cc.

680 {
681 auto model = std::make_unique<TextInputModel>();
682 model->SetText("ABCDE");
683 model->BeginComposing();
684 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
685 EXPECT_TRUE(model->DeleteSurrounding(0, 2));
686 EXPECT_EQ(model->selection(), TextRange(2));
687 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
688 EXPECT_STREQ(model->GetText().c_str(), "ABE");
689}

◆ TEST() [214/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursorComposing   
)

Definition at line 659 of file text_input_model_unittests.cc.

659 {
660 auto model = std::make_unique<TextInputModel>();
661 model->SetText("ABCDE");
662 model->BeginComposing();
663 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
664 EXPECT_TRUE(model->DeleteSurrounding(0, 1));
665 EXPECT_EQ(model->selection(), TextRange(2));
666 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
667 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
668}

◆ TEST() [215/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursorGreedy   
)

Definition at line 691 of file text_input_model_unittests.cc.

691 {
692 auto model = std::make_unique<TextInputModel>();
693 model->SetText("ABCDE");
694 EXPECT_TRUE(model->SetSelection(TextRange(2)));
695 EXPECT_TRUE(model->DeleteSurrounding(0, 4));
696 EXPECT_EQ(model->selection(), TextRange(2));
697 EXPECT_EQ(model->composing_range(), TextRange(0));
698 EXPECT_STREQ(model->GetText().c_str(), "AB");
699}

◆ TEST() [216/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingAtCursorGreedyComposing   
)

Definition at line 701 of file text_input_model_unittests.cc.

701 {
702 auto model = std::make_unique<TextInputModel>();
703 model->SetText("ABCDE");
704 model->BeginComposing();
705 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
706 EXPECT_TRUE(model->DeleteSurrounding(0, 4));
707 EXPECT_EQ(model->selection(), TextRange(2));
708 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
709 EXPECT_STREQ(model->GetText().c_str(), "ABE");
710}

◆ TEST() [217/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursor   
)

Definition at line 712 of file text_input_model_unittests.cc.

712 {
713 auto model = std::make_unique<TextInputModel>();
714 model->SetText("ABCDE");
715 EXPECT_TRUE(model->SetSelection(TextRange(2)));
716 EXPECT_TRUE(model->DeleteSurrounding(-1, 1));
717 EXPECT_EQ(model->selection(), TextRange(1));
718 EXPECT_EQ(model->composing_range(), TextRange(0));
719 EXPECT_STREQ(model->GetText().c_str(), "ACDE");
720}

◆ TEST() [218/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursorAll   
)

Definition at line 733 of file text_input_model_unittests.cc.

733 {
734 auto model = std::make_unique<TextInputModel>();
735 model->SetText("ABCDE");
736 EXPECT_TRUE(model->SetSelection(TextRange(2)));
737 EXPECT_TRUE(model->DeleteSurrounding(-2, 2));
738 EXPECT_EQ(model->selection(), TextRange(0));
739 EXPECT_EQ(model->composing_range(), TextRange(0));
740 EXPECT_STREQ(model->GetText().c_str(), "CDE");
741}

◆ TEST() [219/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursorAllComposing   
)

Definition at line 743 of file text_input_model_unittests.cc.

743 {
744 auto model = std::make_unique<TextInputModel>();
745 model->SetText("ABCDE");
746 model->BeginComposing();
747 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 2));
748 EXPECT_TRUE(model->DeleteSurrounding(-2, 2));
749 EXPECT_EQ(model->selection(), TextRange(1));
750 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
751 EXPECT_STREQ(model->GetText().c_str(), "ADE");
752}

◆ TEST() [220/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursorComposing   
)

Definition at line 722 of file text_input_model_unittests.cc.

722 {
723 auto model = std::make_unique<TextInputModel>();
724 model->SetText("ABCDE");
725 model->BeginComposing();
726 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 2));
727 EXPECT_TRUE(model->DeleteSurrounding(-1, 1));
728 EXPECT_EQ(model->selection(), TextRange(2));
729 EXPECT_EQ(model->composing_range(), TextRange(1, 3));
730 EXPECT_STREQ(model->GetText().c_str(), "ABDE");
731}

◆ TEST() [221/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursorGreedy   
)

Definition at line 754 of file text_input_model_unittests.cc.

754 {
755 auto model = std::make_unique<TextInputModel>();
756 model->SetText("ABCDE");
757 EXPECT_TRUE(model->SetSelection(TextRange(2)));
758 EXPECT_TRUE(model->DeleteSurrounding(-3, 3));
759 EXPECT_EQ(model->selection(), TextRange(0));
760 EXPECT_EQ(model->composing_range(), TextRange(0));
761 EXPECT_STREQ(model->GetText().c_str(), "CDE");
762}

◆ TEST() [222/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingBeforeCursorGreedyComposing   
)

Definition at line 764 of file text_input_model_unittests.cc.

764 {
765 auto model = std::make_unique<TextInputModel>();
766 model->SetText("ABCDE");
767 model->BeginComposing();
768 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 2));
769 EXPECT_TRUE(model->DeleteSurrounding(-3, 3));
770 EXPECT_EQ(model->selection(), TextRange(1));
771 EXPECT_EQ(model->composing_range(), TextRange(1, 2));
772 EXPECT_STREQ(model->GetText().c_str(), "ADE");
773}

◆ TEST() [223/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingReverseSelection   
)

Definition at line 848 of file text_input_model_unittests.cc.

848 {
849 auto model = std::make_unique<TextInputModel>();
850 model->SetText("ABCDE");
851 EXPECT_TRUE(model->SetSelection(TextRange(4, 3)));
852 EXPECT_TRUE(model->DeleteSurrounding(0, 1));
853 EXPECT_EQ(model->selection(), TextRange(3));
854 EXPECT_EQ(model->composing_range(), TextRange(0));
855 EXPECT_STREQ(model->GetText().c_str(), "ABCE");
856}

◆ TEST() [224/363]

flutter::TEST ( TextInputModel  ,
DeleteSurroundingSelection   
)

Definition at line 838 of file text_input_model_unittests.cc.

838 {
839 auto model = std::make_unique<TextInputModel>();
840 model->SetText("ABCDE");
841 EXPECT_TRUE(model->SetSelection(TextRange(2, 3)));
842 EXPECT_TRUE(model->DeleteSurrounding(0, 1));
843 EXPECT_EQ(model->selection(), TextRange(3));
844 EXPECT_EQ(model->composing_range(), TextRange(0));
845 EXPECT_STREQ(model->GetText().c_str(), "ABCE");
846}

◆ TEST() [225/363]

flutter::TEST ( TextInputModel  ,
DeleteWideCharacters   
)

Definition at line 549 of file text_input_model_unittests.cc.

549 {
550 auto model = std::make_unique<TextInputModel>();
551 model->SetText("😄🙃🤪🧐");
552 EXPECT_TRUE(model->SetSelection(TextRange(4)));
553 ASSERT_TRUE(model->Delete());
554 EXPECT_EQ(model->selection(), TextRange(4));
555 EXPECT_EQ(model->composing_range(), TextRange(0));
556 EXPECT_STREQ(model->GetText().c_str(), "😄🙃🧐");
557}

◆ TEST() [226/363]

flutter::TEST ( TextInputModel  ,
GetCursorOffset   
)

Definition at line 1702 of file text_input_model_unittests.cc.

1702 {
1703 auto model = std::make_unique<TextInputModel>();
1704 // These characters take 1, 2, 3 and 4 bytes in UTF-8.
1705 model->SetText("$¢€𐍈");
1706 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1707 EXPECT_EQ(model->GetCursorOffset(), 0);
1708 EXPECT_TRUE(model->MoveCursorForward());
1709 EXPECT_EQ(model->GetCursorOffset(), 1);
1710 EXPECT_TRUE(model->MoveCursorForward());
1711 EXPECT_EQ(model->GetCursorOffset(), 3);
1712 EXPECT_TRUE(model->MoveCursorForward());
1713 EXPECT_EQ(model->GetCursorOffset(), 6);
1714 EXPECT_TRUE(model->MoveCursorForward());
1715 EXPECT_EQ(model->GetCursorOffset(), 10);
1716}

◆ TEST() [227/363]

flutter::TEST ( TextInputModel  ,
GetCursorOffsetReverseSelection   
)

Definition at line 1725 of file text_input_model_unittests.cc.

1725 {
1726 auto model = std::make_unique<TextInputModel>();
1727 model->SetText("ABCDE");
1728 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1729 EXPECT_EQ(model->GetCursorOffset(), 1);
1730}

◆ TEST() [228/363]

flutter::TEST ( TextInputModel  ,
GetCursorOffsetSelection   
)

Definition at line 1718 of file text_input_model_unittests.cc.

1718 {
1719 auto model = std::make_unique<TextInputModel>();
1720 model->SetText("ABCDE");
1721 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1722 EXPECT_EQ(model->GetCursorOffset(), 4);
1723}

◆ TEST() [229/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackEnd   
)

Definition at line 1130 of file text_input_model_unittests.cc.

1130 {
1131 auto model = std::make_unique<TextInputModel>();
1132 model->SetText("ABCDE");
1133 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1134 EXPECT_TRUE(model->MoveCursorBack());
1135 EXPECT_EQ(model->selection(), TextRange(4));
1136 EXPECT_EQ(model->composing_range(), TextRange(0));
1137 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1138}

◆ TEST() [230/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackEndComposing   
)

Definition at line 1216 of file text_input_model_unittests.cc.

1216 {
1217 auto model = std::make_unique<TextInputModel>();
1218 model->SetText("ABCDE");
1219 model->BeginComposing();
1220 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1221 EXPECT_TRUE(model->MoveCursorBack());
1222 EXPECT_EQ(model->selection(), TextRange(3));
1223 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1224 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1225}

◆ TEST() [231/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackEndReverseComposing   
)

Definition at line 1227 of file text_input_model_unittests.cc.

1227 {
1228 auto model = std::make_unique<TextInputModel>();
1229 model->SetText("ABCDE");
1230 model->BeginComposing();
1231 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1232 EXPECT_TRUE(model->MoveCursorBack());
1233 EXPECT_EQ(model->selection(), TextRange(3));
1234 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1235 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1236}

◆ TEST() [232/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackMiddle   
)

Definition at line 1120 of file text_input_model_unittests.cc.

1120 {
1121 auto model = std::make_unique<TextInputModel>();
1122 model->SetText("ABCDE");
1123 EXPECT_TRUE(model->SetSelection(TextRange(2)));
1124 EXPECT_TRUE(model->MoveCursorBack());
1125 EXPECT_EQ(model->selection(), TextRange(1));
1126 EXPECT_EQ(model->composing_range(), TextRange(0));
1127 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1128}

◆ TEST() [233/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackMiddleComposing   
)

Definition at line 1194 of file text_input_model_unittests.cc.

1194 {
1195 auto model = std::make_unique<TextInputModel>();
1196 model->SetText("ABCDE");
1197 model->BeginComposing();
1198 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1199 EXPECT_TRUE(model->MoveCursorBack());
1200 EXPECT_EQ(model->selection(), TextRange(1));
1201 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1202 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1203}

◆ TEST() [234/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackMiddleReverseComposing   
)

Definition at line 1205 of file text_input_model_unittests.cc.

1205 {
1206 auto model = std::make_unique<TextInputModel>();
1207 model->SetText("ABCDE");
1208 model->BeginComposing();
1209 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1210 EXPECT_TRUE(model->MoveCursorBack());
1211 EXPECT_EQ(model->selection(), TextRange(1));
1212 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1213 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1214}

◆ TEST() [235/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackReverseSelection   
)

Definition at line 1160 of file text_input_model_unittests.cc.

1160 {
1161 auto model = std::make_unique<TextInputModel>();
1162 model->SetText("ABCDE");
1163 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1164 EXPECT_TRUE(model->MoveCursorBack());
1165 EXPECT_EQ(model->selection(), TextRange(1));
1166 EXPECT_EQ(model->composing_range(), TextRange(0));
1167 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1168}

◆ TEST() [236/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackSelection   
)

Definition at line 1150 of file text_input_model_unittests.cc.

1150 {
1151 auto model = std::make_unique<TextInputModel>();
1152 model->SetText("ABCDE");
1153 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1154 EXPECT_TRUE(model->MoveCursorBack());
1155 EXPECT_EQ(model->selection(), TextRange(1));
1156 EXPECT_EQ(model->composing_range(), TextRange(0));
1157 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1158}

◆ TEST() [237/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackStart   
)

Definition at line 1110 of file text_input_model_unittests.cc.

1110 {
1111 auto model = std::make_unique<TextInputModel>();
1112 model->SetText("ABCDE");
1113 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1114 EXPECT_FALSE(model->MoveCursorBack());
1115 EXPECT_EQ(model->selection(), TextRange(0));
1116 EXPECT_EQ(model->composing_range(), TextRange(0));
1117 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1118}

◆ TEST() [238/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackStartComposing   
)

Definition at line 1170 of file text_input_model_unittests.cc.

1170 {
1171 auto model = std::make_unique<TextInputModel>();
1172 model->SetText("ABCDE");
1173 model->BeginComposing();
1174 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1175 EXPECT_TRUE(model->SetSelection(TextRange(1)));
1176 EXPECT_FALSE(model->MoveCursorBack());
1177 EXPECT_EQ(model->selection(), TextRange(1));
1178 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1179 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1180}

◆ TEST() [239/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackStartReverseComposing   
)

Definition at line 1182 of file text_input_model_unittests.cc.

1182 {
1183 auto model = std::make_unique<TextInputModel>();
1184 model->SetText("ABCDE");
1185 model->BeginComposing();
1186 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
1187 EXPECT_TRUE(model->SetSelection(TextRange(1)));
1188 EXPECT_FALSE(model->MoveCursorBack());
1189 EXPECT_EQ(model->selection(), TextRange(1));
1190 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1191 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1192}

◆ TEST() [240/363]

flutter::TEST ( TextInputModel  ,
MoveCursorBackWideCharacters   
)

Definition at line 1140 of file text_input_model_unittests.cc.

1140 {
1141 auto model = std::make_unique<TextInputModel>();
1142 model->SetText("😄🙃🤪🧐");
1143 EXPECT_TRUE(model->SetSelection(TextRange(4)));
1144 ASSERT_TRUE(model->MoveCursorBack());
1145 EXPECT_EQ(model->selection(), TextRange(2));
1146 EXPECT_EQ(model->composing_range(), TextRange(0));
1147 EXPECT_STREQ(model->GetText().c_str(), "😄🙃🤪🧐");
1148}

◆ TEST() [241/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardEnd   
)

Definition at line 1004 of file text_input_model_unittests.cc.

1004 {
1005 auto model = std::make_unique<TextInputModel>();
1006 model->SetText("ABCDE");
1007 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1008 EXPECT_FALSE(model->MoveCursorForward());
1009 EXPECT_EQ(model->selection(), TextRange(5));
1010 EXPECT_EQ(model->composing_range(), TextRange(0));
1011 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1012}

◆ TEST() [242/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardEndComposing   
)

Definition at line 1088 of file text_input_model_unittests.cc.

1088 {
1089 auto model = std::make_unique<TextInputModel>();
1090 model->SetText("ABCDE");
1091 model->BeginComposing();
1092 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1093 EXPECT_FALSE(model->MoveCursorForward());
1094 EXPECT_EQ(model->selection(), TextRange(4));
1095 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1096 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1097}

◆ TEST() [243/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardEndReverseComposing   
)

Definition at line 1099 of file text_input_model_unittests.cc.

1099 {
1100 auto model = std::make_unique<TextInputModel>();
1101 model->SetText("ABCDE");
1102 model->BeginComposing();
1103 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1104 EXPECT_FALSE(model->MoveCursorForward());
1105 EXPECT_EQ(model->selection(), TextRange(4));
1106 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1107 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1108}

◆ TEST() [244/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardMiddle   
)

Definition at line 994 of file text_input_model_unittests.cc.

994 {
995 auto model = std::make_unique<TextInputModel>();
996 model->SetText("ABCDE");
997 EXPECT_TRUE(model->SetSelection(TextRange(2)));
998 EXPECT_TRUE(model->MoveCursorForward());
999 EXPECT_EQ(model->selection(), TextRange(3));
1000 EXPECT_EQ(model->composing_range(), TextRange(0));
1001 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1002}

◆ TEST() [245/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardMiddleComposing   
)

Definition at line 1066 of file text_input_model_unittests.cc.

1066 {
1067 auto model = std::make_unique<TextInputModel>();
1068 model->SetText("ABCDE");
1069 model->BeginComposing();
1070 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1071 EXPECT_TRUE(model->MoveCursorForward());
1072 EXPECT_EQ(model->selection(), TextRange(3));
1073 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1074 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1075}

◆ TEST() [246/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardMiddleReverseComposing   
)

Definition at line 1077 of file text_input_model_unittests.cc.

1077 {
1078 auto model = std::make_unique<TextInputModel>();
1079 model->SetText("ABCDE");
1080 model->BeginComposing();
1081 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1082 EXPECT_TRUE(model->MoveCursorForward());
1083 EXPECT_EQ(model->selection(), TextRange(3));
1084 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1085 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1086}

◆ TEST() [247/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardReverseSelection   
)

Definition at line 1034 of file text_input_model_unittests.cc.

1034 {
1035 auto model = std::make_unique<TextInputModel>();
1036 model->SetText("ABCDE");
1037 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1038 EXPECT_TRUE(model->MoveCursorForward());
1039 EXPECT_EQ(model->selection(), TextRange(4));
1040 EXPECT_EQ(model->composing_range(), TextRange(0));
1041 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1042}

◆ TEST() [248/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardSelection   
)

Definition at line 1024 of file text_input_model_unittests.cc.

1024 {
1025 auto model = std::make_unique<TextInputModel>();
1026 model->SetText("ABCDE");
1027 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1028 EXPECT_TRUE(model->MoveCursorForward());
1029 EXPECT_EQ(model->selection(), TextRange(4));
1030 EXPECT_EQ(model->composing_range(), TextRange(0));
1031 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1032}

◆ TEST() [249/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardStart   
)

Definition at line 984 of file text_input_model_unittests.cc.

984 {
985 auto model = std::make_unique<TextInputModel>();
986 model->SetText("ABCDE");
987 EXPECT_TRUE(model->SetSelection(TextRange(0)));
988 EXPECT_TRUE(model->MoveCursorForward());
989 EXPECT_EQ(model->selection(), TextRange(1));
990 EXPECT_EQ(model->composing_range(), TextRange(0));
991 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
992}

◆ TEST() [250/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardStartComposing   
)

Definition at line 1044 of file text_input_model_unittests.cc.

1044 {
1045 auto model = std::make_unique<TextInputModel>();
1046 model->SetText("ABCDE");
1047 model->BeginComposing();
1048 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1049 EXPECT_TRUE(model->MoveCursorForward());
1050 EXPECT_EQ(model->selection(), TextRange(2));
1051 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1052 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1053}

◆ TEST() [251/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardStartReverseComposing   
)

Definition at line 1055 of file text_input_model_unittests.cc.

1055 {
1056 auto model = std::make_unique<TextInputModel>();
1057 model->SetText("ABCDE");
1058 model->BeginComposing();
1059 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
1060 EXPECT_TRUE(model->MoveCursorForward());
1061 EXPECT_EQ(model->selection(), TextRange(2));
1062 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1063 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1064}

◆ TEST() [252/363]

flutter::TEST ( TextInputModel  ,
MoveCursorForwardWideCharacters   
)

Definition at line 1014 of file text_input_model_unittests.cc.

1014 {
1015 auto model = std::make_unique<TextInputModel>();
1016 model->SetText("😄🙃🤪🧐");
1017 EXPECT_TRUE(model->SetSelection(TextRange(4)));
1018 ASSERT_TRUE(model->MoveCursorForward());
1019 EXPECT_EQ(model->selection(), TextRange(6));
1020 EXPECT_EQ(model->composing_range(), TextRange(0));
1021 EXPECT_STREQ(model->GetText().c_str(), "😄🙃🤪🧐");
1022}

◆ TEST() [253/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningEnd   
)

Definition at line 1278 of file text_input_model_unittests.cc.

1278 {
1279 auto model = std::make_unique<TextInputModel>();
1280 model->SetText("ABCDE");
1281 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1282 EXPECT_TRUE(model->MoveCursorToBeginning());
1283 EXPECT_EQ(model->selection(), TextRange(0));
1284 EXPECT_EQ(model->composing_range(), TextRange(0));
1285 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1286}

◆ TEST() [254/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningEndComposing   
)

Definition at line 1426 of file text_input_model_unittests.cc.

1426 {
1427 auto model = std::make_unique<TextInputModel>();
1428 model->SetText("ABCDE");
1429 model->BeginComposing();
1430 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1431 EXPECT_TRUE(model->MoveCursorToBeginning());
1432 EXPECT_EQ(model->selection(), TextRange(1));
1433 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1434 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1435}

◆ TEST() [255/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningEndReverseComposing   
)

Definition at line 1448 of file text_input_model_unittests.cc.

1448 {
1449 auto model = std::make_unique<TextInputModel>();
1450 model->SetText("ABCDE");
1451 model->BeginComposing();
1452 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1453 EXPECT_TRUE(model->MoveCursorToBeginning());
1454 EXPECT_EQ(model->selection(), TextRange(1));
1455 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1456 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1457}

◆ TEST() [256/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningMiddle   
)

Definition at line 1258 of file text_input_model_unittests.cc.

1258 {
1259 auto model = std::make_unique<TextInputModel>();
1260 model->SetText("ABCDE");
1261 EXPECT_TRUE(model->SetSelection(TextRange(2)));
1262 EXPECT_TRUE(model->MoveCursorToBeginning());
1263 EXPECT_EQ(model->selection(), TextRange(0));
1264 EXPECT_EQ(model->composing_range(), TextRange(0));
1265 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1266}

◆ TEST() [257/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningMiddleComposing   
)

Definition at line 1382 of file text_input_model_unittests.cc.

1382 {
1383 auto model = std::make_unique<TextInputModel>();
1384 model->SetText("ABCDE");
1385 model->BeginComposing();
1386 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1387 EXPECT_TRUE(model->MoveCursorToBeginning());
1388 EXPECT_EQ(model->selection(), TextRange(1));
1389 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1390 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1391}

◆ TEST() [258/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningMiddleReverseComposing   
)

Definition at line 1404 of file text_input_model_unittests.cc.

1404 {
1405 auto model = std::make_unique<TextInputModel>();
1406 model->SetText("ABCDE");
1407 model->BeginComposing();
1408 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1409 EXPECT_TRUE(model->MoveCursorToBeginning());
1410 EXPECT_EQ(model->selection(), TextRange(1));
1411 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1412 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1413}

◆ TEST() [259/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningReverseSelection   
)

Definition at line 1318 of file text_input_model_unittests.cc.

1318 {
1319 auto model = std::make_unique<TextInputModel>();
1320 model->SetText("ABCDE");
1321 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1322 EXPECT_TRUE(model->MoveCursorToBeginning());
1323 EXPECT_EQ(model->selection(), TextRange(0));
1324 EXPECT_EQ(model->composing_range(), TextRange(0));
1325 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1326}

◆ TEST() [260/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningSelection   
)

Definition at line 1298 of file text_input_model_unittests.cc.

1298 {
1299 auto model = std::make_unique<TextInputModel>();
1300 model->SetText("ABCDE");
1301 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1302 EXPECT_TRUE(model->MoveCursorToBeginning());
1303 EXPECT_EQ(model->selection(), TextRange(0));
1304 EXPECT_EQ(model->composing_range(), TextRange(0));
1305 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1306}

◆ TEST() [261/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningStart   
)

Definition at line 1238 of file text_input_model_unittests.cc.

1238 {
1239 auto model = std::make_unique<TextInputModel>();
1240 model->SetText("ABCDE");
1241 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1242 EXPECT_FALSE(model->MoveCursorToBeginning());
1243 EXPECT_EQ(model->selection(), TextRange(0));
1244 EXPECT_EQ(model->composing_range(), TextRange(0));
1245 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1246}

◆ TEST() [262/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningStartComposing   
)

Definition at line 1338 of file text_input_model_unittests.cc.

1338 {
1339 auto model = std::make_unique<TextInputModel>();
1340 model->SetText("ABCDE");
1341 model->BeginComposing();
1342 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1343 EXPECT_FALSE(model->MoveCursorToBeginning());
1344 EXPECT_EQ(model->selection(), TextRange(1));
1345 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1346 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1347}

◆ TEST() [263/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToBeginningStartReverseComposing   
)

Definition at line 1360 of file text_input_model_unittests.cc.

1360 {
1361 auto model = std::make_unique<TextInputModel>();
1362 model->SetText("ABCDE");
1363 model->BeginComposing();
1364 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
1365 EXPECT_FALSE(model->MoveCursorToBeginning());
1366 EXPECT_EQ(model->selection(), TextRange(1));
1367 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1368 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1369}

◆ TEST() [264/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndEnd   
)

Definition at line 1510 of file text_input_model_unittests.cc.

1510 {
1511 auto model = std::make_unique<TextInputModel>();
1512 model->SetText("ABCDE");
1513 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1514 EXPECT_FALSE(model->MoveCursorToEnd());
1515 EXPECT_EQ(model->selection(), TextRange(5));
1516 EXPECT_EQ(model->composing_range(), TextRange(0));
1517 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1518}

◆ TEST() [265/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndEndComposing   
)

Definition at line 1658 of file text_input_model_unittests.cc.

1658 {
1659 auto model = std::make_unique<TextInputModel>();
1660 model->SetText("ABCDE");
1661 model->BeginComposing();
1662 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1663 EXPECT_FALSE(model->MoveCursorToEnd());
1664 EXPECT_EQ(model->selection(), TextRange(4));
1665 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1666 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1667}

◆ TEST() [266/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndEndReverseComposing   
)

Definition at line 1680 of file text_input_model_unittests.cc.

1680 {
1681 auto model = std::make_unique<TextInputModel>();
1682 model->SetText("ABCDE");
1683 model->BeginComposing();
1684 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1685 EXPECT_FALSE(model->MoveCursorToEnd());
1686 EXPECT_EQ(model->selection(), TextRange(4));
1687 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1688 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1689}

◆ TEST() [267/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndMiddle   
)

Definition at line 1490 of file text_input_model_unittests.cc.

1490 {
1491 auto model = std::make_unique<TextInputModel>();
1492 model->SetText("ABCDE");
1493 EXPECT_TRUE(model->SetSelection(TextRange(2)));
1494 EXPECT_TRUE(model->MoveCursorToEnd());
1495 EXPECT_EQ(model->selection(), TextRange(5));
1496 EXPECT_EQ(model->composing_range(), TextRange(0));
1497 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1498}

◆ TEST() [268/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndMiddleComposing   
)

Definition at line 1614 of file text_input_model_unittests.cc.

1614 {
1615 auto model = std::make_unique<TextInputModel>();
1616 model->SetText("ABCDE");
1617 model->BeginComposing();
1618 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1619 EXPECT_TRUE(model->MoveCursorToEnd());
1620 EXPECT_EQ(model->selection(), TextRange(4));
1621 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1622 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1623}

◆ TEST() [269/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndMiddleReverseComposing   
)

Definition at line 1636 of file text_input_model_unittests.cc.

1636 {
1637 auto model = std::make_unique<TextInputModel>();
1638 model->SetText("ABCDE");
1639 model->BeginComposing();
1640 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1641 EXPECT_TRUE(model->MoveCursorToEnd());
1642 EXPECT_EQ(model->selection(), TextRange(4));
1643 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1644 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1645}

◆ TEST() [270/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndReverseSelection   
)

Definition at line 1550 of file text_input_model_unittests.cc.

1550 {
1551 auto model = std::make_unique<TextInputModel>();
1552 model->SetText("ABCDE");
1553 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1554 EXPECT_TRUE(model->MoveCursorToEnd());
1555 EXPECT_EQ(model->selection(), TextRange(5));
1556 EXPECT_EQ(model->composing_range(), TextRange(0));
1557 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1558}

◆ TEST() [271/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndSelection   
)

Definition at line 1530 of file text_input_model_unittests.cc.

1530 {
1531 auto model = std::make_unique<TextInputModel>();
1532 model->SetText("ABCDE");
1533 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1534 EXPECT_TRUE(model->MoveCursorToEnd());
1535 EXPECT_EQ(model->selection(), TextRange(5));
1536 EXPECT_EQ(model->composing_range(), TextRange(0));
1537 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1538}

◆ TEST() [272/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndStart   
)

Definition at line 1470 of file text_input_model_unittests.cc.

1470 {
1471 auto model = std::make_unique<TextInputModel>();
1472 model->SetText("ABCDE");
1473 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1474 EXPECT_TRUE(model->MoveCursorToEnd());
1475 EXPECT_EQ(model->selection(), TextRange(5));
1476 EXPECT_EQ(model->composing_range(), TextRange(0));
1477 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1478}

◆ TEST() [273/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndStartComposing   
)

Definition at line 1570 of file text_input_model_unittests.cc.

1570 {
1571 auto model = std::make_unique<TextInputModel>();
1572 model->SetText("ABCDE");
1573 model->BeginComposing();
1574 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1575 EXPECT_TRUE(model->MoveCursorToEnd());
1576 EXPECT_EQ(model->selection(), TextRange(4));
1577 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1578 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1579}

◆ TEST() [274/363]

flutter::TEST ( TextInputModel  ,
MoveCursorToEndStartReverseComposing   
)

Definition at line 1592 of file text_input_model_unittests.cc.

1592 {
1593 auto model = std::make_unique<TextInputModel>();
1594 model->SetText("ABCDE");
1595 model->BeginComposing();
1596 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1597 EXPECT_TRUE(model->MoveCursorToEnd());
1598 EXPECT_EQ(model->selection(), TextRange(4));
1599 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1600 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1601}

◆ TEST() [275/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningEnd   
)

Definition at line 1288 of file text_input_model_unittests.cc.

1288 {
1289 auto model = std::make_unique<TextInputModel>();
1290 model->SetText("ABCDE");
1291 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1292 EXPECT_TRUE(model->SelectToBeginning());
1293 EXPECT_EQ(model->selection(), TextRange(5, 0));
1294 EXPECT_EQ(model->composing_range(), TextRange(0));
1295 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1296}

◆ TEST() [276/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningEndComposing   
)

Definition at line 1437 of file text_input_model_unittests.cc.

1437 {
1438 auto model = std::make_unique<TextInputModel>();
1439 model->SetText("ABCDE");
1440 model->BeginComposing();
1441 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1442 EXPECT_TRUE(model->MoveCursorToBeginning());
1443 EXPECT_EQ(model->selection(), TextRange(1));
1444 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1445 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1446}

◆ TEST() [277/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningEndReverseComposing   
)

Definition at line 1459 of file text_input_model_unittests.cc.

1459 {
1460 auto model = std::make_unique<TextInputModel>();
1461 model->SetText("ABCDE");
1462 model->BeginComposing();
1463 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1464 EXPECT_TRUE(model->SelectToBeginning());
1465 EXPECT_EQ(model->selection(), TextRange(4, 1));
1466 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1467 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1468}

◆ TEST() [278/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningMiddle   
)

Definition at line 1268 of file text_input_model_unittests.cc.

1268 {
1269 auto model = std::make_unique<TextInputModel>();
1270 model->SetText("ABCDE");
1271 EXPECT_TRUE(model->SetSelection(TextRange(2)));
1272 EXPECT_TRUE(model->SelectToBeginning());
1273 EXPECT_EQ(model->selection(), TextRange(2, 0));
1274 EXPECT_EQ(model->composing_range(), TextRange(0));
1275 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1276}

◆ TEST() [279/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningMiddleComposing   
)

Definition at line 1393 of file text_input_model_unittests.cc.

1393 {
1394 auto model = std::make_unique<TextInputModel>();
1395 model->SetText("ABCDE");
1396 model->BeginComposing();
1397 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1398 EXPECT_TRUE(model->SelectToBeginning());
1399 EXPECT_EQ(model->selection(), TextRange(2, 1));
1400 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1401 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1402}

◆ TEST() [280/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningMiddleReverseComposing   
)

Definition at line 1415 of file text_input_model_unittests.cc.

1415 {
1416 auto model = std::make_unique<TextInputModel>();
1417 model->SetText("ABCDE");
1418 model->BeginComposing();
1419 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1420 EXPECT_TRUE(model->SelectToBeginning());
1421 EXPECT_EQ(model->selection(), TextRange(2, 1));
1422 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1423 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1424}

◆ TEST() [281/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningReverseSelection   
)

Definition at line 1328 of file text_input_model_unittests.cc.

1328 {
1329 auto model = std::make_unique<TextInputModel>();
1330 model->SetText("ABCDE");
1331 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1332 EXPECT_TRUE(model->SelectToBeginning());
1333 EXPECT_EQ(model->selection(), TextRange(4, 0));
1334 EXPECT_EQ(model->composing_range(), TextRange(0));
1335 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1336}

◆ TEST() [282/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningSelection   
)

Definition at line 1308 of file text_input_model_unittests.cc.

1308 {
1309 auto model = std::make_unique<TextInputModel>();
1310 model->SetText("ABCDE");
1311 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1312 EXPECT_TRUE(model->SelectToBeginning());
1313 EXPECT_EQ(model->selection(), TextRange(1, 0));
1314 EXPECT_EQ(model->composing_range(), TextRange(0));
1315 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1316}

◆ TEST() [283/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningStart   
)

Definition at line 1248 of file text_input_model_unittests.cc.

1248 {
1249 auto model = std::make_unique<TextInputModel>();
1250 model->SetText("ABCDE");
1251 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1252 EXPECT_FALSE(model->SelectToBeginning());
1253 EXPECT_EQ(model->selection(), TextRange(0));
1254 EXPECT_EQ(model->composing_range(), TextRange(0));
1255 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1256}

◆ TEST() [284/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningStartComposing   
)

Definition at line 1349 of file text_input_model_unittests.cc.

1349 {
1350 auto model = std::make_unique<TextInputModel>();
1351 model->SetText("ABCDE");
1352 model->BeginComposing();
1353 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1354 EXPECT_FALSE(model->SelectToBeginning());
1355 EXPECT_EQ(model->selection(), TextRange(1));
1356 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1357 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1358}

◆ TEST() [285/363]

flutter::TEST ( TextInputModel  ,
SelectToBeginningStartReverseComposing   
)

Definition at line 1371 of file text_input_model_unittests.cc.

1371 {
1372 auto model = std::make_unique<TextInputModel>();
1373 model->SetText("ABCDE");
1374 model->BeginComposing();
1375 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 0));
1376 EXPECT_FALSE(model->SelectToBeginning());
1377 EXPECT_EQ(model->selection(), TextRange(1));
1378 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1379 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1380}

◆ TEST() [286/363]

flutter::TEST ( TextInputModel  ,
SelectToEndEnd   
)

Definition at line 1520 of file text_input_model_unittests.cc.

1520 {
1521 auto model = std::make_unique<TextInputModel>();
1522 model->SetText("ABCDE");
1523 EXPECT_TRUE(model->SetSelection(TextRange(5)));
1524 EXPECT_FALSE(model->SelectToEnd());
1525 EXPECT_EQ(model->selection(), TextRange(5));
1526 EXPECT_EQ(model->composing_range(), TextRange(0));
1527 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1528}

◆ TEST() [287/363]

flutter::TEST ( TextInputModel  ,
SelectToEndEndComposing   
)

Definition at line 1669 of file text_input_model_unittests.cc.

1669 {
1670 auto model = std::make_unique<TextInputModel>();
1671 model->SetText("ABCDE");
1672 model->BeginComposing();
1673 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
1674 EXPECT_FALSE(model->SelectToEnd());
1675 EXPECT_EQ(model->selection(), TextRange(4));
1676 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1677 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1678}

◆ TEST() [288/363]

flutter::TEST ( TextInputModel  ,
SelectToEndEndReverseComposing   
)

Definition at line 1691 of file text_input_model_unittests.cc.

1691 {
1692 auto model = std::make_unique<TextInputModel>();
1693 model->SetText("ABCDE");
1694 model->BeginComposing();
1695 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
1696 EXPECT_FALSE(model->SelectToEnd());
1697 EXPECT_EQ(model->selection(), TextRange(4));
1698 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1699 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1700}

◆ TEST() [289/363]

flutter::TEST ( TextInputModel  ,
SelectToEndMiddle   
)

Definition at line 1500 of file text_input_model_unittests.cc.

1500 {
1501 auto model = std::make_unique<TextInputModel>();
1502 model->SetText("ABCDE");
1503 EXPECT_TRUE(model->SetSelection(TextRange(2)));
1504 EXPECT_TRUE(model->SelectToEnd());
1505 EXPECT_EQ(model->selection(), TextRange(2, 5));
1506 EXPECT_EQ(model->composing_range(), TextRange(0));
1507 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1508}

◆ TEST() [290/363]

flutter::TEST ( TextInputModel  ,
SelectToEndMiddleComposing   
)

Definition at line 1625 of file text_input_model_unittests.cc.

1625 {
1626 auto model = std::make_unique<TextInputModel>();
1627 model->SetText("ABCDE");
1628 model->BeginComposing();
1629 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 1));
1630 EXPECT_TRUE(model->SelectToEnd());
1631 EXPECT_EQ(model->selection(), TextRange(2, 4));
1632 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1633 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1634}

◆ TEST() [291/363]

flutter::TEST ( TextInputModel  ,
SelectToEndMiddleReverseComposing   
)

Definition at line 1647 of file text_input_model_unittests.cc.

1647 {
1648 auto model = std::make_unique<TextInputModel>();
1649 model->SetText("ABCDE");
1650 model->BeginComposing();
1651 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 1));
1652 EXPECT_TRUE(model->SelectToEnd());
1653 EXPECT_EQ(model->selection(), TextRange(2, 4));
1654 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
1655 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1656}

◆ TEST() [292/363]

flutter::TEST ( TextInputModel  ,
SelectToEndReverseSelection   
)

Definition at line 1560 of file text_input_model_unittests.cc.

1560 {
1561 auto model = std::make_unique<TextInputModel>();
1562 model->SetText("ABCDE");
1563 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
1564 EXPECT_TRUE(model->SelectToEnd());
1565 EXPECT_EQ(model->selection(), TextRange(4, 5));
1566 EXPECT_EQ(model->composing_range(), TextRange(0));
1567 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1568}

◆ TEST() [293/363]

flutter::TEST ( TextInputModel  ,
SelectToEndSelection   
)

Definition at line 1540 of file text_input_model_unittests.cc.

1540 {
1541 auto model = std::make_unique<TextInputModel>();
1542 model->SetText("ABCDE");
1543 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
1544 EXPECT_TRUE(model->SelectToEnd());
1545 EXPECT_EQ(model->selection(), TextRange(1, 5));
1546 EXPECT_EQ(model->composing_range(), TextRange(0));
1547 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1548}

◆ TEST() [294/363]

flutter::TEST ( TextInputModel  ,
SelectToEndStart   
)

Definition at line 1480 of file text_input_model_unittests.cc.

1480 {
1481 auto model = std::make_unique<TextInputModel>();
1482 model->SetText("ABCDE");
1483 EXPECT_TRUE(model->SetSelection(TextRange(0)));
1484 EXPECT_TRUE(model->SelectToEnd());
1485 EXPECT_EQ(model->selection(), TextRange(0, 5));
1486 EXPECT_EQ(model->composing_range(), TextRange(0));
1487 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1488}

◆ TEST() [295/363]

flutter::TEST ( TextInputModel  ,
SelectToEndStartComposing   
)

Definition at line 1581 of file text_input_model_unittests.cc.

1581 {
1582 auto model = std::make_unique<TextInputModel>();
1583 model->SetText("ABCDE");
1584 model->BeginComposing();
1585 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1586 EXPECT_TRUE(model->SelectToEnd());
1587 EXPECT_EQ(model->selection(), TextRange(1, 4));
1588 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1589 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1590}

◆ TEST() [296/363]

flutter::TEST ( TextInputModel  ,
SelectToEndStartReverseComposing   
)

Definition at line 1603 of file text_input_model_unittests.cc.

1603 {
1604 auto model = std::make_unique<TextInputModel>();
1605 model->SetText("ABCDE");
1606 model->BeginComposing();
1607 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
1608 EXPECT_TRUE(model->SelectToEnd());
1609 EXPECT_EQ(model->selection(), TextRange(1, 4));
1610 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
1611 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
1612}

◆ TEST() [297/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeEnd   
)

Definition at line 190 of file text_input_model_unittests.cc.

190 {
191 auto model = std::make_unique<TextInputModel>();
192 model->SetText("ABCDE");
193 model->BeginComposing();
194 EXPECT_TRUE(model->SetComposingRange(TextRange(5, 5), 0));
195 EXPECT_EQ(model->selection(), TextRange(5));
196 EXPECT_EQ(model->composing_range(), TextRange(5));
197 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
198}

◆ TEST() [298/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeMiddle   
)

Definition at line 180 of file text_input_model_unittests.cc.

180 {
181 auto model = std::make_unique<TextInputModel>();
182 model->SetText("ABCDE");
183 model->BeginComposing();
184 EXPECT_TRUE(model->SetComposingRange(TextRange(2, 2), 0));
185 EXPECT_EQ(model->selection(), TextRange(2));
186 EXPECT_EQ(model->composing_range(), TextRange(2));
187 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
188}

◆ TEST() [299/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeOutsideString   
)

Definition at line 220 of file text_input_model_unittests.cc.

220 {
221 auto model = std::make_unique<TextInputModel>();
222 model->SetText("ABCDE");
223 model->BeginComposing();
224 EXPECT_FALSE(model->SetComposingRange(TextRange(4, 6), 0));
225 EXPECT_FALSE(model->SetComposingRange(TextRange(5, 6), 0));
226 EXPECT_FALSE(model->SetComposingRange(TextRange(6, 6), 0));
227}

◆ TEST() [300/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeReverseExtent   
)

Definition at line 210 of file text_input_model_unittests.cc.

210 {
211 auto model = std::make_unique<TextInputModel>();
212 model->SetText("ABCDE");
213 model->BeginComposing();
214 EXPECT_TRUE(model->SetComposingRange(TextRange(4, 1), 3));
215 EXPECT_EQ(model->selection(), TextRange(4));
216 EXPECT_EQ(model->composing_range(), TextRange(4, 1));
217 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
218}

◆ TEST() [301/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeStart   
)

Definition at line 170 of file text_input_model_unittests.cc.

170 {
171 auto model = std::make_unique<TextInputModel>();
172 model->SetText("ABCDE");
173 model->BeginComposing();
174 EXPECT_TRUE(model->SetComposingRange(TextRange(0, 0), 0));
175 EXPECT_EQ(model->selection(), TextRange(0));
176 EXPECT_EQ(model->composing_range(), TextRange(0));
177 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
178}

◆ TEST() [302/363]

flutter::TEST ( TextInputModel  ,
SetComposingRangeWithExtent   
)

Definition at line 200 of file text_input_model_unittests.cc.

200 {
201 auto model = std::make_unique<TextInputModel>();
202 model->SetText("ABCDE");
203 model->BeginComposing();
204 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 3));
205 EXPECT_EQ(model->selection(), TextRange(4));
206 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
207 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
208}

◆ TEST() [303/363]

flutter::TEST ( TextInputModel  ,
SetSelectionComposingEnd   
)

Definition at line 99 of file text_input_model_unittests.cc.

99 {
100 auto model = std::make_unique<TextInputModel>();
101 model->SetText("ABCDE");
102 model->BeginComposing();
103 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
104 EXPECT_TRUE(model->SetSelection(TextRange(4)));
105 EXPECT_EQ(model->selection(), TextRange(4));
106 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
107 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
108}

◆ TEST() [304/363]

flutter::TEST ( TextInputModel  ,
SetSelectionComposingMiddle   
)

Definition at line 79 of file text_input_model_unittests.cc.

79 {
80 auto model = std::make_unique<TextInputModel>();
81 model->SetText("ABCDE");
82 model->BeginComposing();
83 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
84 EXPECT_TRUE(model->SetSelection(TextRange(2)));
85 EXPECT_EQ(model->selection(), TextRange(2));
86 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
87 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
88}

◆ TEST() [305/363]

flutter::TEST ( TextInputModel  ,
SetSelectionComposingStart   
)

Definition at line 59 of file text_input_model_unittests.cc.

59 {
60 auto model = std::make_unique<TextInputModel>();
61 model->SetText("ABCDE");
62 model->BeginComposing();
63 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
64 EXPECT_TRUE(model->SetSelection(TextRange(1)));
65 EXPECT_EQ(model->selection(), TextRange(1));
66 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
67 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
68}

◆ TEST() [306/363]

flutter::TEST ( TextInputModel  ,
SetSelectionEnd   
)

Definition at line 90 of file text_input_model_unittests.cc.

90 {
91 auto model = std::make_unique<TextInputModel>();
92 model->SetText("ABCDE");
93 EXPECT_TRUE(model->SetSelection(TextRange(5)));
94 EXPECT_EQ(model->selection(), TextRange(5));
95 EXPECT_EQ(model->composing_range(), TextRange(0));
96 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
97}

◆ TEST() [307/363]

flutter::TEST ( TextInputModel  ,
SetSelectionMiddle   
)

Definition at line 70 of file text_input_model_unittests.cc.

70 {
71 auto model = std::make_unique<TextInputModel>();
72 model->SetText("ABCDE");
73 EXPECT_TRUE(model->SetSelection(TextRange(2)));
74 EXPECT_EQ(model->selection(), TextRange(2));
75 EXPECT_EQ(model->composing_range(), TextRange(0));
76 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
77}

◆ TEST() [308/363]

flutter::TEST ( TextInputModel  ,
SetSelectionOutsideComposingRange   
)

Definition at line 158 of file text_input_model_unittests.cc.

158 {
159 auto model = std::make_unique<TextInputModel>();
160 model->SetText("ABCDE");
161 model->BeginComposing();
162 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
163 EXPECT_FALSE(model->SetSelection(TextRange(0)));
164 EXPECT_EQ(model->selection(), TextRange(1));
165 EXPECT_FALSE(model->SetSelection(TextRange(5)));
166 EXPECT_EQ(model->selection(), TextRange(1));
167 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
168}

◆ TEST() [309/363]

flutter::TEST ( TextInputModel  ,
SetSelectionOutsideString   
)

Definition at line 150 of file text_input_model_unittests.cc.

150 {
151 auto model = std::make_unique<TextInputModel>();
152 model->SetText("ABCDE");
153 EXPECT_FALSE(model->SetSelection(TextRange(4, 6)));
154 EXPECT_FALSE(model->SetSelection(TextRange(5, 6)));
155 EXPECT_FALSE(model->SetSelection(TextRange(6)));
156}

◆ TEST() [310/363]

flutter::TEST ( TextInputModel  ,
SetSelectionReverseExtent   
)

Definition at line 130 of file text_input_model_unittests.cc.

130 {
131 auto model = std::make_unique<TextInputModel>();
132 model->SetText("ABCDE");
133 EXPECT_TRUE(model->SetSelection(TextRange(4, 1)));
134 EXPECT_EQ(model->selection(), TextRange(4, 1));
135 EXPECT_EQ(model->composing_range(), TextRange(0));
136 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
137}

◆ TEST() [311/363]

flutter::TEST ( TextInputModel  ,
SetSelectionReverseExtentComposing   
)

Definition at line 139 of file text_input_model_unittests.cc.

139 {
140 auto model = std::make_unique<TextInputModel>();
141 model->SetText("ABCDE");
142 model->BeginComposing();
143 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
144 EXPECT_FALSE(model->SetSelection(TextRange(4, 1)));
145 EXPECT_EQ(model->selection(), TextRange(1));
146 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
147 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
148}

◆ TEST() [312/363]

flutter::TEST ( TextInputModel  ,
SetSelectionStart   
)

Definition at line 50 of file text_input_model_unittests.cc.

50 {
51 auto model = std::make_unique<TextInputModel>();
52 model->SetText("ABCDE");
53 EXPECT_TRUE(model->SetSelection(TextRange(0)));
54 EXPECT_EQ(model->selection(), TextRange(0));
55 EXPECT_EQ(model->composing_range(), TextRange(0));
56 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
57}

◆ TEST() [313/363]

flutter::TEST ( TextInputModel  ,
SetSelectionWthExtent   
)

Definition at line 110 of file text_input_model_unittests.cc.

110 {
111 auto model = std::make_unique<TextInputModel>();
112 model->SetText("ABCDE");
113 EXPECT_TRUE(model->SetSelection(TextRange(1, 4)));
114 EXPECT_EQ(model->selection(), TextRange(1, 4));
115 EXPECT_EQ(model->composing_range(), TextRange(0));
116 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
117}

◆ TEST() [314/363]

flutter::TEST ( TextInputModel  ,
SetSelectionWthExtentComposing   
)

Definition at line 119 of file text_input_model_unittests.cc.

119 {
120 auto model = std::make_unique<TextInputModel>();
121 model->SetText("ABCDE");
122 model->BeginComposing();
123 EXPECT_TRUE(model->SetComposingRange(TextRange(1, 4), 0));
124 EXPECT_FALSE(model->SetSelection(TextRange(1, 4)));
125 EXPECT_EQ(model->selection(), TextRange(1));
126 EXPECT_EQ(model->composing_range(), TextRange(1, 4));
127 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
128}

◆ TEST() [315/363]

flutter::TEST ( TextInputModel  ,
SetText   
)

Definition at line 15 of file text_input_model_unittests.cc.

15 {
16 auto model = std::make_unique<TextInputModel>();
17 model->SetText("ABCDE");
18 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
19}

◆ TEST() [316/363]

flutter::TEST ( TextInputModel  ,
SetTextEmpty   
)

Definition at line 27 of file text_input_model_unittests.cc.

27 {
28 auto model = std::make_unique<TextInputModel>();
29 model->SetText("");
30 EXPECT_STREQ(model->GetText().c_str(), "");
31}

◆ TEST() [317/363]

flutter::TEST ( TextInputModel  ,
SetTextReplaceText   
)

Definition at line 33 of file text_input_model_unittests.cc.

33 {
34 auto model = std::make_unique<TextInputModel>();
35 model->SetText("ABCDE");
36 EXPECT_STREQ(model->GetText().c_str(), "ABCDE");
37 model->SetText("");
38 EXPECT_STREQ(model->GetText().c_str(), "");
39}

◆ TEST() [318/363]

flutter::TEST ( TextInputModel  ,
SetTextResetsSelection   
)

Definition at line 41 of file text_input_model_unittests.cc.

41 {
42 auto model = std::make_unique<TextInputModel>();
43 model->SetText("ABCDE");
44 EXPECT_TRUE(model->SetSelection(TextRange(3)));
45 EXPECT_EQ(model->selection(), TextRange(3));
46 model->SetText("FGHJI");
47 EXPECT_EQ(model->selection(), TextRange(0));
48}

◆ TEST() [319/363]

flutter::TEST ( TextInputModel  ,
SetTextWideCharacters   
)

Definition at line 21 of file text_input_model_unittests.cc.

21 {
22 auto model = std::make_unique<TextInputModel>();
23 model->SetText("😄🙃🤪🧐");
24 EXPECT_STREQ(model->GetText().c_str(), "😄🙃🤪🧐");
25}

◆ TEST() [320/363]

flutter::TEST ( TextInputModel  ,
UpdateComposingRemovesLastComposingCharacter   
)

Definition at line 395 of file text_input_model_unittests.cc.

395 {
396 auto model = std::make_unique<TextInputModel>();
397 model->SetText("ABCDE");
398 model->BeginComposing();
399 model->SetComposingRange(TextRange(1, 2), 1);
400 model->UpdateComposingText("");
401 EXPECT_EQ(model->selection(), TextRange(1));
402 EXPECT_EQ(model->composing_range(), TextRange(1));
403 model->SetText("ACDE");
404}

◆ TEST() [321/363]

flutter::TEST ( TextInputModel  ,
UpdateSelectionWhileComposing   
)

Definition at line 406 of file text_input_model_unittests.cc.

406 {
407 auto model = std::make_unique<TextInputModel>();
408 model->SetText("ABCDE");
409 model->BeginComposing();
410 model->SetComposingRange(TextRange(4, 5), 1);
411 model->UpdateComposingText(u"ぴょんぴょん", TextRange(3, 6));
412 EXPECT_STREQ(model->GetText().c_str(), "ABCDぴょんぴょん");
413 EXPECT_EQ(model->selection(), TextRange(7, 10));
414 EXPECT_EQ(model->composing_range(), TextRange(4, 10));
415}

◆ TEST() [322/363]

flutter::TEST ( TextRange  ,
ContainsEndPosition   
)

Definition at line 125 of file text_range_unittests.cc.

125 {
126 TextRange range(2, 6);
127 EXPECT_TRUE(range.Contains(6));
128}

◆ TEST() [323/363]

flutter::TEST ( TextRange  ,
ContainsEndPositionReversed   
)

Definition at line 151 of file text_range_unittests.cc.

151 {
152 TextRange range(6, 2);
153 EXPECT_TRUE(range.Contains(6));
154}

◆ TEST() [324/363]

flutter::TEST ( TextRange  ,
ContainsMiddlePosition   
)

Definition at line 119 of file text_range_unittests.cc.

119 {
120 TextRange range(2, 6);
121 EXPECT_TRUE(range.Contains(3));
122 EXPECT_TRUE(range.Contains(4));
123}

◆ TEST() [325/363]

flutter::TEST ( TextRange  ,
ContainsMiddlePositionReversed   
)

Definition at line 145 of file text_range_unittests.cc.

145 {
146 TextRange range(6, 2);
147 EXPECT_TRUE(range.Contains(3));
148 EXPECT_TRUE(range.Contains(4));
149}

◆ TEST() [326/363]

flutter::TEST ( TextRange  ,
ContainsPostEndPosition   
)

Definition at line 130 of file text_range_unittests.cc.

130 {
131 TextRange range(2, 6);
132 EXPECT_FALSE(range.Contains(7));
133}

◆ TEST() [327/363]

flutter::TEST ( TextRange  ,
ContainsPostEndPositionReversed   
)

Definition at line 156 of file text_range_unittests.cc.

156 {
157 TextRange range(6, 2);
158 EXPECT_FALSE(range.Contains(7));
159}

◆ TEST() [328/363]

flutter::TEST ( TextRange  ,
ContainsPreStartPosition   
)

Definition at line 109 of file text_range_unittests.cc.

109 {
110 TextRange range(2, 6);
111 EXPECT_FALSE(range.Contains(1));
112}

◆ TEST() [329/363]

flutter::TEST ( TextRange  ,
ContainsPreStartPositionReversed   
)

Definition at line 135 of file text_range_unittests.cc.

135 {
136 TextRange range(6, 2);
137 EXPECT_FALSE(range.Contains(1));
138}

◆ TEST() [330/363]

flutter::TEST ( TextRange  ,
ContainsRangeEndPosition   
)

Definition at line 182 of file text_range_unittests.cc.

182 {
183 TextRange range(2, 6);
184 EXPECT_TRUE(range.Contains(TextRange(6)));
185}

◆ TEST() [331/363]

flutter::TEST ( TextRange  ,
ContainsRangeEndPositionReversed   
)

Definition at line 223 of file text_range_unittests.cc.

223 {
224 TextRange range(6, 2);
225 EXPECT_TRUE(range.Contains(TextRange(5)));
226}

◆ TEST() [332/363]

flutter::TEST ( TextRange  ,
ContainsRangeMiddlePosition   
)

Definition at line 176 of file text_range_unittests.cc.

176 {
177 TextRange range(2, 6);
178 EXPECT_TRUE(range.Contains(TextRange(3, 4)));
179 EXPECT_TRUE(range.Contains(TextRange(4, 5)));
180}

◆ TEST() [333/363]

flutter::TEST ( TextRange  ,
ContainsRangeMiddlePositionReversed   
)

Definition at line 212 of file text_range_unittests.cc.

212 {
213 TextRange range(6, 2);
214 EXPECT_TRUE(range.Contains(TextRange(3, 4)));
215 EXPECT_TRUE(range.Contains(TextRange(4, 5)));
216}

◆ TEST() [334/363]

flutter::TEST ( TextRange  ,
ContainsRangePostEndPosition   
)

Definition at line 192 of file text_range_unittests.cc.

192 {
193 TextRange range(2, 6);
194 EXPECT_FALSE(range.Contains(TextRange(6, 7)));
195}

◆ TEST() [335/363]

flutter::TEST ( TextRange  ,
ContainsRangePostEndPositionReversed   
)

Definition at line 228 of file text_range_unittests.cc.

228 {
229 TextRange range(6, 2);
230 EXPECT_FALSE(range.Contains(TextRange(6, 7)));
231}

◆ TEST() [336/363]

flutter::TEST ( TextRange  ,
ContainsRangePreStartPosition   
)

Definition at line 161 of file text_range_unittests.cc.

161 {
162 TextRange range(2, 6);
163 EXPECT_FALSE(range.Contains(TextRange(0, 1)));
164}

◆ TEST() [337/363]

flutter::TEST ( TextRange  ,
ContainsRangePreStartPositionReversed   
)

Definition at line 197 of file text_range_unittests.cc.

197 {
198 TextRange range(6, 2);
199 EXPECT_FALSE(range.Contains(TextRange(0, 1)));
200}

◆ TEST() [338/363]

flutter::TEST ( TextRange  ,
ContainsRangeSpanningEndPosition   
)

Definition at line 187 of file text_range_unittests.cc.

187 {
188 TextRange range(2, 6);
189 EXPECT_FALSE(range.Contains(TextRange(5, 7)));
190}

◆ TEST() [339/363]

flutter::TEST ( TextRange  ,
ContainsRangeSpanningEndPositionReversed   
)

Definition at line 218 of file text_range_unittests.cc.

218 {
219 TextRange range(6, 2);
220 EXPECT_FALSE(range.Contains(TextRange(5, 7)));
221}

◆ TEST() [340/363]

flutter::TEST ( TextRange  ,
ContainsRangeSpanningStartPosition   
)

Definition at line 166 of file text_range_unittests.cc.

166 {
167 TextRange range(2, 6);
168 EXPECT_FALSE(range.Contains(TextRange(1, 3)));
169}

◆ TEST() [341/363]

flutter::TEST ( TextRange  ,
ContainsRangeSpanningStartPositionReversed   
)

Definition at line 202 of file text_range_unittests.cc.

202 {
203 TextRange range(6, 2);
204 EXPECT_FALSE(range.Contains(TextRange(1, 3)));
205}

◆ TEST() [342/363]

flutter::TEST ( TextRange  ,
ContainsRangeStartPosition   
)

Definition at line 171 of file text_range_unittests.cc.

171 {
172 TextRange range(2, 6);
173 EXPECT_TRUE(range.Contains(TextRange(2)));
174}

◆ TEST() [343/363]

flutter::TEST ( TextRange  ,
ContainsRangeStartPositionReversed   
)

Definition at line 207 of file text_range_unittests.cc.

207 {
208 TextRange range(6, 2);
209 EXPECT_TRUE(range.Contains(TextRange(2)));
210}

◆ TEST() [344/363]

flutter::TEST ( TextRange  ,
ContainsStartPosition   
)

Definition at line 114 of file text_range_unittests.cc.

114 {
115 TextRange range(2, 6);
116 EXPECT_TRUE(range.Contains(2));
117}

◆ TEST() [345/363]

flutter::TEST ( TextRange  ,
ContainsStartPositionReversed   
)

Definition at line 140 of file text_range_unittests.cc.

140 {
141 TextRange range(6, 2);
142 EXPECT_TRUE(range.Contains(2));
143}

◆ TEST() [346/363]

flutter::TEST ( TextRange  ,
ReversedCollapsedRange   
)

Definition at line 238 of file text_range_unittests.cc.

238 {
239 TextRange range(2, 2);
240 EXPECT_FALSE(range.reversed());
241}

◆ TEST() [347/363]

flutter::TEST ( TextRange  ,
ReversedForwardRange   
)

Definition at line 233 of file text_range_unittests.cc.

233 {
234 TextRange range(2, 6);
235 EXPECT_FALSE(range.reversed());
236}

◆ TEST() [348/363]

flutter::TEST ( TextRange  ,
ReversedReversedRange   
)

Definition at line 243 of file text_range_unittests.cc.

243 {
244 TextRange range(6, 2);
245 EXPECT_TRUE(range.reversed());
246}

◆ TEST() [349/363]

flutter::TEST ( TextRange  ,
SetBase   
)

Definition at line 53 of file text_range_unittests.cc.

53 {
54 TextRange range(3, 7);
55 range.set_base(4);
56 EXPECT_EQ(range.base(), size_t(4));
57 EXPECT_EQ(range.extent(), size_t(7));
58}

◆ TEST() [350/363]

flutter::TEST ( TextRange  ,
SetBaseReversed   
)

Definition at line 60 of file text_range_unittests.cc.

60 {
61 TextRange range(7, 3);
62 range.set_base(5);
63 EXPECT_EQ(range.base(), size_t(5));
64 EXPECT_EQ(range.extent(), size_t(3));
65}

◆ TEST() [351/363]

flutter::TEST ( TextRange  ,
SetEnd   
)

Definition at line 95 of file text_range_unittests.cc.

95 {
96 TextRange range(3, 7);
97 range.set_end(6);
98 EXPECT_EQ(range.base(), size_t(3));
99 EXPECT_EQ(range.extent(), size_t(6));
100}

◆ TEST() [352/363]

flutter::TEST ( TextRange  ,
SetEndReversed   
)

Definition at line 102 of file text_range_unittests.cc.

102 {
103 TextRange range(7, 3);
104 range.set_end(5);
105 EXPECT_EQ(range.base(), size_t(5));
106 EXPECT_EQ(range.extent(), size_t(3));
107}

◆ TEST() [353/363]

flutter::TEST ( TextRange  ,
SetExtent   
)

Definition at line 67 of file text_range_unittests.cc.

67 {
68 TextRange range(3, 7);
69 range.set_extent(6);
70 EXPECT_EQ(range.base(), size_t(3));
71 EXPECT_EQ(range.extent(), size_t(6));
72}

◆ TEST() [354/363]

flutter::TEST ( TextRange  ,
SetExtentReversed   
)

Definition at line 74 of file text_range_unittests.cc.

74 {
75 TextRange range(7, 3);
76 range.set_extent(4);
77 EXPECT_EQ(range.base(), size_t(7));
78 EXPECT_EQ(range.extent(), size_t(4));
79}

◆ TEST() [355/363]

flutter::TEST ( TextRange  ,
SetStart   
)

Definition at line 81 of file text_range_unittests.cc.

81 {
82 TextRange range(3, 7);
83 range.set_start(5);
84 EXPECT_EQ(range.base(), size_t(5));
85 EXPECT_EQ(range.extent(), size_t(7));
86}

◆ TEST() [356/363]

flutter::TEST ( TextRange  ,
SetStartReversed   
)

Definition at line 88 of file text_range_unittests.cc.

88 {
89 TextRange range(7, 3);
90 range.set_start(5);
91 EXPECT_EQ(range.base(), size_t(7));
92 EXPECT_EQ(range.extent(), size_t(5));
93}

◆ TEST() [357/363]

flutter::TEST ( TextRange  ,
TextRangeFromPositionNonZero   
)

Definition at line 22 of file text_range_unittests.cc.

22 {
23 TextRange range(3);
24 EXPECT_EQ(range.base(), size_t(3));
25 EXPECT_EQ(range.extent(), size_t(3));
26 EXPECT_EQ(range.start(), size_t(3));
27 EXPECT_EQ(range.end(), size_t(3));
28 EXPECT_EQ(range.length(), size_t(0));
29 EXPECT_EQ(range.position(), size_t(3));
30 EXPECT_TRUE(range.collapsed());
31}

◆ TEST() [358/363]

flutter::TEST ( TextRange  ,
TextRangeFromPositionZero   
)

Definition at line 11 of file text_range_unittests.cc.

11 {
12 TextRange range(0);
13 EXPECT_EQ(range.base(), size_t(0));
14 EXPECT_EQ(range.extent(), size_t(0));
15 EXPECT_EQ(range.start(), size_t(0));
16 EXPECT_EQ(range.end(), size_t(0));
17 EXPECT_EQ(range.length(), size_t(0));
18 EXPECT_EQ(range.position(), size_t(0));
19 EXPECT_TRUE(range.collapsed());
20}

◆ TEST() [359/363]

flutter::TEST ( TextRange  ,
TextRangeFromRange   
)

Definition at line 33 of file text_range_unittests.cc.

33 {
34 TextRange range(3, 7);
35 EXPECT_EQ(range.base(), size_t(3));
36 EXPECT_EQ(range.extent(), size_t(7));
37 EXPECT_EQ(range.start(), size_t(3));
38 EXPECT_EQ(range.end(), size_t(7));
39 EXPECT_EQ(range.length(), size_t(4));
40 EXPECT_FALSE(range.collapsed());
41}

◆ TEST() [360/363]

flutter::TEST ( TextRange  ,
TextRangeFromReversedRange   
)

Definition at line 43 of file text_range_unittests.cc.

43 {
44 TextRange range(7, 3);
45 EXPECT_EQ(range.base(), size_t(7));
46 EXPECT_EQ(range.extent(), size_t(3));
47 EXPECT_EQ(range.start(), size_t(3));
48 EXPECT_EQ(range.end(), size_t(7));
49 EXPECT_EQ(range.length(), size_t(4));
50 EXPECT_FALSE(range.collapsed());
51}

◆ TEST() [361/363]

flutter::TEST ( TextureRegistrarTest  ,
MarkFrameAvailableInvalidTexture   
)

Definition at line 143 of file texture_registrar_unittests.cc.

143 {
144 auto dummy_registrar_handle =
145 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
146 PluginRegistrar registrar(dummy_registrar_handle);
147
148 TextureRegistrar* textures = registrar.texture_registrar();
149
150 bool success = textures->MarkTextureFrameAvailable(42);
151 EXPECT_FALSE(success);
152}
virtual bool MarkTextureFrameAvailable(int64_t texture_id)=0

◆ TEST() [362/363]

flutter::TEST ( TextureRegistrarTest  ,
RegisterUnregisterTexture   
)

Definition at line 87 of file texture_registrar_unittests.cc.

87 {
88 testing::ScopedStubFlutterApi scoped_api_stub(std::make_unique<TestApi>());
89 auto test_api = static_cast<TestApi*>(scoped_api_stub.stub());
90
91 auto dummy_registrar_handle =
92 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
93 PluginRegistrar registrar(dummy_registrar_handle);
94 TextureRegistrar* textures = registrar.texture_registrar();
95 ASSERT_NE(textures, nullptr);
96
97 EXPECT_EQ(test_api->last_texture_id(), -1);
98 auto texture = test_api->GetFakeTexture(0);
99 EXPECT_EQ(texture, nullptr);
100
101 auto pixel_buffer_texture = std::make_unique<TextureVariant>(
102 PixelBufferTexture([](size_t width, size_t height) { return nullptr; }));
103 int64_t texture_id = textures->RegisterTexture(pixel_buffer_texture.get());
104 EXPECT_EQ(test_api->last_texture_id(), texture_id);
105 EXPECT_EQ(test_api->textures_size(), static_cast<size_t>(1));
106
107 texture = test_api->GetFakeTexture(texture_id);
108 EXPECT_EQ(texture->texture_id, texture_id);
109 EXPECT_EQ(texture->user_data,
110 std::get_if<PixelBufferTexture>(pixel_buffer_texture.get()));
111
114 bool success = textures->MarkTextureFrameAvailable(texture_id);
115 EXPECT_TRUE(success);
116 EXPECT_EQ(texture->mark_count, 3);
117
118 fml::AutoResetWaitableEvent unregister_latch;
119 textures->UnregisterTexture(texture_id, [&]() { unregister_latch.Signal(); });
120 unregister_latch.Wait();
121
122 texture = test_api->GetFakeTexture(texture_id);
123 EXPECT_EQ(texture, nullptr);
124 EXPECT_EQ(test_api->textures_size(), static_cast<size_t>(0));
125}
virtual void UnregisterTexture(int64_t texture_id, std::function< void()> callback)=0
virtual int64_t RegisterTexture(TextureVariant *texture)=0
FlTexture * texture

◆ TEST() [363/363]

flutter::TEST ( TextureRegistrarTest  ,
UnregisterInvalidTexture   
)

Definition at line 129 of file texture_registrar_unittests.cc.

129 {
130 auto dummy_registrar_handle =
131 reinterpret_cast<FlutterDesktopPluginRegistrarRef>(1);
132 PluginRegistrar registrar(dummy_registrar_handle);
133
134 TextureRegistrar* textures = registrar.texture_registrar();
135
137 textures->UnregisterTexture(42, [&]() { latch.Signal(); });
138 latch.Wait();
139}

◆ TEST_F() [1/19]

flutter::TEST_F ( DartProjectTest  ,
DartEntrypointArguments   
)

Definition at line 45 of file dart_project_unittests.cc.

45 {
46 DartProject project(L"test");
47
48 std::vector<std::string> test_arguments = {"arg1", "arg2", "arg3"};
49 project.set_dart_entrypoint_arguments(test_arguments);
50
51 auto returned_arguments = project.dart_entrypoint_arguments();
52 EXPECT_EQ(returned_arguments.size(), 3U);
53 EXPECT_EQ(returned_arguments[0], "arg1");
54 EXPECT_EQ(returned_arguments[1], "arg2");
55 EXPECT_EQ(returned_arguments[2], "arg3");
56}

◆ TEST_F() [2/19]

flutter::TEST_F ( DartProjectTest  ,
ProjectWithCustomPaths   
)

Definition at line 38 of file dart_project_unittests.cc.

38 {
39 DartProject project(L"data\\assets", L"icu\\icudtl.dat", L"lib\\file.so");
40 EXPECT_EQ(GetProjectIcuDataPath(project), L"icu\\icudtl.dat");
41 EXPECT_EQ(GetProjectAssetsPath(project), L"data\\assets");
42 EXPECT_EQ(GetProjectAotLibraryPath(project), L"lib\\file.so");
43}

◆ TEST_F() [3/19]

flutter::TEST_F ( DartProjectTest  ,
StandardProjectFormat   
)

Definition at line 31 of file dart_project_unittests.cc.

31 {
32 DartProject project(L"test");
33 EXPECT_EQ(GetProjectIcuDataPath(project), L"test\\icudtl.dat");
34 EXPECT_EQ(GetProjectAssetsPath(project), L"test\\flutter_assets");
35 EXPECT_EQ(GetProjectAotLibraryPath(project), L"test\\app.so");
36}

◆ TEST_F() [4/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorAcceptsMultipleRenders   
)

Definition at line 266 of file engine_animator_unittests.cc.

266 {
267 MockAnimatorDelegate animator_delegate;
268 std::unique_ptr<EngineContext> engine_context;
269
270 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
271 std::make_shared<MockPlatformMessageHandler>();
272 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
273 .WillOnce(ReturnRef(platform_message_handler));
275 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
276 .WillOnce(
277 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
278 auto status =
279 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
280 auto tasks = Sorted(item->layer_tree_tasks);
281 EXPECT_EQ(tasks.size(), 2u);
282 EXPECT_EQ(tasks[0]->view_id, 1);
283 EXPECT_EQ(tasks[1]->view_id, 2);
284 });
285 EXPECT_EQ(status, PipelineConsumeResult::Done);
286 draw_latch.Signal();
287 }));
288 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
289 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
290 uint64_t frame_number) {
291 engine_context->EngineTaskSync([&](Engine& engine) {
292 engine.BeginFrame(frame_target_time, frame_number);
293 });
294 }));
295
296 native_latch.Reset();
297 AddNativeCallback("NotifyNative", [](auto args) { native_latch.Signal(); });
298
299 std::unique_ptr<Animator> animator;
300 PostSync(task_runners_.GetUITaskRunner(),
301 [&animator, &animator_delegate, &task_runners = task_runners_] {
302 animator = std::make_unique<Animator>(
303 animator_delegate, task_runners,
304 static_cast<std::unique_ptr<VsyncWaiter>>(
305 std::make_unique<testing::ConstantFiringVsyncWaiter>(
306 task_runners)));
307 });
308
310 std::move(animator));
311 auto configuration = RunConfiguration::InferFromSettings(settings_);
312 configuration.SetEntrypoint("onDrawFrameRenderAllViews");
313 engine_context->Run(std::move(configuration));
314
315 engine_context->EngineTaskSync([](Engine& engine) {
316 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
317 [](bool added) { ASSERT_TRUE(added); });
318 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
319 [](bool added) { ASSERT_TRUE(added); });
320 });
321
322 native_latch.Wait();
323
324 engine_context->EngineTaskSync(
325 [](Engine& engine) { engine.ScheduleFrame(); });
326 draw_latch.Wait();
327}
Settings settings_
TaskRunners task_runners_
MockDelegate delegate_
static void PostSync(const fml::RefPtr< fml::TaskRunner > &task_runner, const fml::closure &task)

◆ TEST_F() [5/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitPartialViewsForWarmUp   
)

Definition at line 593 of file engine_animator_unittests.cc.

593 {
594 MockAnimatorDelegate animator_delegate;
595 std::unique_ptr<EngineContext> engine_context;
596
597 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
598 std::make_shared<MockPlatformMessageHandler>();
599 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
600 .WillOnce(ReturnRef(platform_message_handler));
601
602 fml::AutoResetWaitableEvent continuation_ready_latch;
604 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
605 .WillOnce(
606 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
607 auto status =
608 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
609 auto tasks = Sorted(item->layer_tree_tasks);
610 EXPECT_EQ(tasks.size(), 2u);
611 EXPECT_EQ(tasks[0]->view_id, 1);
612 EXPECT_EQ(tasks[1]->view_id, 2);
613 });
614 EXPECT_EQ(status, PipelineConsumeResult::Done);
615 draw_latch.Signal();
616 }));
617 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
618 .WillRepeatedly(
619 Invoke([&engine_context, &continuation_ready_latch](
620 fml::TimePoint frame_target_time, uint64_t frame_number) {
621 continuation_ready_latch.Signal();
622 engine_context->EngineTaskSync([&](Engine& engine) {
623 engine.BeginFrame(frame_target_time, frame_number);
624 });
625 }));
626
627 std::unique_ptr<Animator> animator;
628 PostSync(task_runners_.GetUITaskRunner(),
629 [&animator, &animator_delegate, &task_runners = task_runners_] {
630 animator = std::make_unique<Animator>(
631 animator_delegate, task_runners,
632 static_cast<std::unique_ptr<VsyncWaiter>>(
633 std::make_unique<testing::ConstantFiringVsyncWaiter>(
634 task_runners)));
635 });
636
638 std::move(animator));
639
640 engine_context->EngineTaskSync([](Engine& engine) {
641 // Schedule a frame to make the animator create a continuation.
642 engine.ScheduleFrame(true);
643 // Add multiple views.
644 engine.AddView(0, ViewportMetrics{1, 10, 10, 22, 0},
645 [](bool added) { ASSERT_TRUE(added); });
646 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
647 [](bool added) { ASSERT_TRUE(added); });
648 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
649 [](bool added) { ASSERT_TRUE(added); });
650 });
651
652 continuation_ready_latch.Wait();
653
654 auto configuration = RunConfiguration::InferFromSettings(settings_);
655 configuration.SetEntrypoint("renderWarmUpView1and2");
656 engine_context->Run(std::move(configuration));
657
658 draw_latch.Wait();
659}

◆ TEST_F() [6/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitsImplicitViewBeforeDrawFrameEnds   
)

Definition at line 462 of file engine_animator_unittests.cc.

462 {
463 MockAnimatorDelegate animator_delegate;
464 std::unique_ptr<EngineContext> engine_context;
465
466 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
467 std::make_shared<MockPlatformMessageHandler>();
468 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
469 .WillOnce(ReturnRef(platform_message_handler));
470
471 bool rasterization_started = false;
472 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
473 .WillOnce(Invoke([&rasterization_started](
474 const std::shared_ptr<FramePipeline>& pipeline) {
475 rasterization_started = true;
476 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
477 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
478 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
479 });
480 EXPECT_EQ(status, PipelineConsumeResult::Done);
481 }));
482 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
483 .WillRepeatedly(Invoke([&engine_context](fml::TimePoint frame_target_time,
484 uint64_t frame_number) {
485 engine_context->EngineTaskSync([&](Engine& engine) {
486 engine.BeginFrame(frame_target_time, frame_number);
487 });
488 }));
489
490 std::unique_ptr<Animator> animator;
491 PostSync(task_runners_.GetUITaskRunner(),
492 [&animator, &animator_delegate, &task_runners = task_runners_] {
493 animator = std::make_unique<Animator>(
494 animator_delegate, task_runners,
495 static_cast<std::unique_ptr<VsyncWaiter>>(
496 std::make_unique<testing::ConstantFiringVsyncWaiter>(
497 task_runners)));
498 });
499
500 native_latch.Reset();
501 // The native_latch is signaled at the end of handleDrawFrame.
502 AddNativeCallback("NotifyNative",
503 CREATE_NATIVE_ENTRY([&rasterization_started](auto args) {
504 EXPECT_EQ(rasterization_started, true);
505 native_latch.Signal();
506 }));
507
509 std::move(animator));
510
511 engine_context->EngineTaskSync([](Engine& engine) {
512 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1.0, 10, 10, 1, 0},
513 [](bool added) { ASSERT_TRUE(added); });
514 });
515
516 auto configuration = RunConfiguration::InferFromSettings(settings_);
517 configuration.SetEntrypoint("renderSingleViewAndCallAfterOnDrawFrame");
518 engine_context->Run(std::move(configuration));
519
520 native_latch.Wait();
521}
#define CREATE_NATIVE_ENTRY(native_entry)

◆ TEST_F() [7/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitWarmUpImplicitView   
)

Definition at line 526 of file engine_animator_unittests.cc.

526 {
527 MockAnimatorDelegate animator_delegate;
528 std::unique_ptr<EngineContext> engine_context;
529
530 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
531 std::make_shared<MockPlatformMessageHandler>();
532 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
533 .WillOnce(ReturnRef(platform_message_handler));
534
535 fml::AutoResetWaitableEvent continuation_ready_latch;
537 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
538 .WillOnce(Invoke([&draw_latch](
539 const std::shared_ptr<FramePipeline>& pipeline) {
540 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
541 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
542 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
543 });
544 EXPECT_EQ(status, PipelineConsumeResult::Done);
545 draw_latch.Signal();
546 }));
547 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
548 .WillRepeatedly(
549 Invoke([&engine_context, &continuation_ready_latch](
550 fml::TimePoint frame_target_time, uint64_t frame_number) {
551 continuation_ready_latch.Signal();
552 engine_context->EngineTaskSync([&](Engine& engine) {
553 engine.BeginFrame(frame_target_time, frame_number);
554 });
555 }));
556
557 std::unique_ptr<Animator> animator;
558 PostSync(task_runners_.GetUITaskRunner(),
559 [&animator, &animator_delegate, &task_runners = task_runners_] {
560 animator = std::make_unique<Animator>(
561 animator_delegate, task_runners,
562 static_cast<std::unique_ptr<VsyncWaiter>>(
563 std::make_unique<testing::ConstantFiringVsyncWaiter>(
564 task_runners)));
565 });
566
568 std::move(animator));
569
570 engine_context->EngineTaskSync([](Engine& engine) {
571 // Schedule a frame to trigger Animator::BeginFrame to create a
572 // continuation. The continuation needs to be available before `Engine::Run`
573 // since the Dart program immediately schedules a warm up frame.
574 engine.ScheduleFrame(true);
575 // Add the implicit view so that the engine recognizes it and that its
576 // metrics is not empty.
577 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1.0, 10, 10, 1, 0},
578 [](bool added) { ASSERT_TRUE(added); });
579 });
580 continuation_ready_latch.Wait();
581
582 auto configuration = RunConfiguration::InferFromSettings(settings_);
583 configuration.SetEntrypoint("renderWarmUpImplicitView");
584 engine_context->Run(std::move(configuration));
585
586 draw_latch.Wait();
587}

◆ TEST_F() [8/19]

flutter::TEST_F ( EngineAnimatorTest  ,
IgnoresDuplicateRenders   
)

Definition at line 386 of file engine_animator_unittests.cc.

386 {
387 MockAnimatorDelegate animator_delegate;
388 std::unique_ptr<EngineContext> engine_context;
389
390 std::vector<std::shared_ptr<Layer>> benchmark_layers;
391 auto capture_root_layer = [&benchmark_layers](Dart_NativeArguments args) {
392 auto handle = Dart_GetNativeArgument(args, 0);
393 intptr_t peer = 0;
395 handle, tonic::DartWrappable::kPeerIndex, &peer);
396 ASSERT_FALSE(Dart_IsError(result));
397 SceneBuilder* scene_builder = reinterpret_cast<SceneBuilder*>(peer);
398 ASSERT_TRUE(scene_builder);
399 std::shared_ptr<ContainerLayer> root_layer =
400 scene_builder->layer_stack()[0];
401 ASSERT_TRUE(root_layer);
402 benchmark_layers = root_layer->layers();
403 };
404
405 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
406 std::make_shared<MockPlatformMessageHandler>();
407 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
408 .WillOnce(ReturnRef(platform_message_handler));
410 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
411 .WillOnce(Invoke([&draw_latch, &benchmark_layers](
412 const std::shared_ptr<FramePipeline>& pipeline) {
413 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
414 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
415 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
416 ContainerLayer* root_layer = reinterpret_cast<ContainerLayer*>(
417 item->layer_tree_tasks[0]->layer_tree->root_layer());
418 std::vector<std::shared_ptr<Layer>> result_layers =
419 root_layer->layers();
420 EXPECT_EQ(result_layers.size(), benchmark_layers.size());
421 EXPECT_EQ(result_layers[0], benchmark_layers[0]);
422 });
423 EXPECT_EQ(status, PipelineConsumeResult::Done);
424 draw_latch.Signal();
425 }));
426 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
427 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
428 uint64_t frame_number) {
429 engine_context->EngineTaskSync([&](Engine& engine) {
430 engine.BeginFrame(frame_target_time, frame_number);
431 });
432 }));
433
434 AddNativeCallback("CaptureRootLayer",
435 CREATE_NATIVE_ENTRY(capture_root_layer));
436
437 std::unique_ptr<Animator> animator;
438 PostSync(task_runners_.GetUITaskRunner(),
439 [&animator, &animator_delegate, &task_runners = task_runners_] {
440 animator = std::make_unique<Animator>(
441 animator_delegate, task_runners,
442 static_cast<std::unique_ptr<VsyncWaiter>>(
443 std::make_unique<testing::ConstantFiringVsyncWaiter>(
444 task_runners)));
445 });
446
448 std::move(animator));
449
450 engine_context->EngineTaskSync([](Engine& engine) {
451 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1, 10, 10, 22, 0},
452 [](bool added) { ASSERT_TRUE(added); });
453 });
454
455 auto configuration = RunConfiguration::InferFromSettings(settings_);
456 configuration.SetEntrypoint("renderTwiceForOneView");
457 engine_context->Run(std::move(configuration));
458
459 draw_latch.Wait();
460}
const std::vector< std::shared_ptr< ContainerLayer > > & layer_stack()
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, int index, intptr_t *value)
struct _Dart_NativeArguments * Dart_NativeArguments
Definition: dart_api.h:3019

◆ TEST_F() [9/19]

flutter::TEST_F ( EngineAnimatorTest  ,
IgnoresOutOfFrameRenders   
)

Definition at line 329 of file engine_animator_unittests.cc.

329 {
330 MockAnimatorDelegate animator_delegate;
331 std::unique_ptr<EngineContext> engine_context;
332
333 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
334 std::make_shared<MockPlatformMessageHandler>();
335 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
336 .WillOnce(ReturnRef(platform_message_handler));
338 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
339 .WillOnce(
340 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
341 auto status =
342 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
343 // View 1 is rendered before the frame, and is ignored.
344 // View 2 is rendered within the frame, and is accepted.
345 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
346 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, 2);
347 });
348 EXPECT_EQ(status, PipelineConsumeResult::Done);
349 draw_latch.Signal();
350 }));
351 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
352 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
353 uint64_t frame_number) {
354 engine_context->EngineTaskSync([&](Engine& engine) {
355 engine.BeginFrame(frame_target_time, frame_number);
356 });
357 }));
358
359 std::unique_ptr<Animator> animator;
360 PostSync(task_runners_.GetUITaskRunner(),
361 [&animator, &animator_delegate, &task_runners = task_runners_] {
362 animator = std::make_unique<Animator>(
363 animator_delegate, task_runners,
364 static_cast<std::unique_ptr<VsyncWaiter>>(
365 std::make_unique<testing::ConstantFiringVsyncWaiter>(
366 task_runners)));
367 });
368
370 std::move(animator));
371
372 engine_context->EngineTaskSync([](Engine& engine) {
373 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
374 [](bool added) { ASSERT_TRUE(added); });
375 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
376 [](bool added) { ASSERT_TRUE(added); });
377 });
378
379 auto configuration = RunConfiguration::InferFromSettings(settings_);
380 configuration.SetEntrypoint("renderViewsInFrameAndOutOfFrame");
381 engine_context->Run(std::move(configuration));
382
383 draw_latch.Wait();
384}

◆ TEST_F() [10/19]

flutter::TEST_F ( EngineTest  ,
Create   
)

Definition at line 238 of file engine_unittests.cc.

238 {
239 PostUITaskSync([this] {
240 auto engine = std::make_unique<Engine>(
241 /*delegate=*/delegate_,
242 /*dispatcher_maker=*/dispatcher_maker_,
243 /*image_decoder_task_runner=*/image_decoder_task_runner_,
244 /*task_runners=*/task_runners_,
245 /*settings=*/settings_,
246 /*animator=*/std::move(animator_),
247 /*io_manager=*/io_manager_,
248 /*font_collection=*/std::make_shared<FontCollection>(),
249 /*runtime_controller=*/std::move(runtime_controller_),
250 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
252 });
253}
Settings settings_
std::shared_ptr< fml::ConcurrentTaskRunner > image_decoder_task_runner_
std::unique_ptr< RuntimeController > runtime_controller_
TaskRunners task_runners_
std::unique_ptr< Animator > animator_
PointerDataDispatcherMaker dispatcher_maker_
MockDelegate delegate_
fml::WeakPtr< IOManager > io_manager_

◆ TEST_F() [11/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageInitialRoute   
)

Definition at line 282 of file engine_unittests.cc.

282 {
283 PostUITaskSync([this] {
284 MockRuntimeDelegate client;
285 auto mock_runtime_controller =
286 std::make_unique<MockRuntimeController>(client, task_runners_);
287 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
288 .WillRepeatedly(::testing::Return(false));
289 auto engine = std::make_unique<Engine>(
290 /*delegate=*/delegate_,
291 /*dispatcher_maker=*/dispatcher_maker_,
292 /*image_decoder_task_runner=*/image_decoder_task_runner_,
293 /*task_runners=*/task_runners_,
294 /*settings=*/settings_,
295 /*animator=*/std::move(animator_),
296 /*io_manager=*/io_manager_,
297 /*font_collection=*/std::make_shared<FontCollection>(),
298 /*runtime_controller=*/std::move(mock_runtime_controller),
299 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
300
302 fml::MakeRefCounted<MockResponse>();
303 std::map<std::string, std::string> values{
304 {"method", "setInitialRoute"},
305 {"args", "test_initial_route"},
306 };
307 std::unique_ptr<PlatformMessage> message =
308 MakePlatformMessage("flutter/navigation", values, response);
309 engine->DispatchPlatformMessage(std::move(message));
310 EXPECT_EQ(engine->InitialRoute(), "test_initial_route");
311 });
312}

◆ TEST_F() [12/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageInitialRouteIgnored   
)

Definition at line 314 of file engine_unittests.cc.

314 {
315 PostUITaskSync([this] {
316 MockRuntimeDelegate client;
317 auto mock_runtime_controller =
318 std::make_unique<MockRuntimeController>(client, task_runners_);
319 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
320 .WillRepeatedly(::testing::Return(true));
321 EXPECT_CALL(*mock_runtime_controller, DispatchPlatformMessage(::testing::_))
322 .WillRepeatedly(::testing::Return(true));
323 auto engine = std::make_unique<Engine>(
324 /*delegate=*/delegate_,
325 /*dispatcher_maker=*/dispatcher_maker_,
326 /*image_decoder_task_runner=*/image_decoder_task_runner_,
327 /*task_runners=*/task_runners_,
328 /*settings=*/settings_,
329 /*animator=*/std::move(animator_),
330 /*io_manager=*/io_manager_,
331 /*font_collection=*/std::make_shared<FontCollection>(),
332 /*runtime_controller=*/std::move(mock_runtime_controller),
333 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
334
336 fml::MakeRefCounted<MockResponse>();
337 std::map<std::string, std::string> values{
338 {"method", "setInitialRoute"},
339 {"args", "test_initial_route"},
340 };
341 std::unique_ptr<PlatformMessage> message =
342 MakePlatformMessage("flutter/navigation", values, response);
343 engine->DispatchPlatformMessage(std::move(message));
344 EXPECT_EQ(engine->InitialRoute(), "");
345 });
346}

◆ TEST_F() [13/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageUnknown   
)

Definition at line 255 of file engine_unittests.cc.

255 {
256 PostUITaskSync([this] {
257 MockRuntimeDelegate client;
258 auto mock_runtime_controller =
259 std::make_unique<MockRuntimeController>(client, task_runners_);
260 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
261 .WillRepeatedly(::testing::Return(false));
262 auto engine = std::make_unique<Engine>(
263 /*delegate=*/delegate_,
264 /*dispatcher_maker=*/dispatcher_maker_,
265 /*image_decoder_task_runner=*/image_decoder_task_runner_,
266 /*task_runners=*/task_runners_,
267 /*settings=*/settings_,
268 /*animator=*/std::move(animator_),
269 /*io_manager=*/io_manager_,
270 /*font_collection=*/std::make_shared<FontCollection>(),
271 /*runtime_controller=*/std::move(mock_runtime_controller),
272 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
273
275 fml::MakeRefCounted<MockResponse>();
276 std::unique_ptr<PlatformMessage> message =
277 std::make_unique<PlatformMessage>("foo", response);
278 engine->DispatchPlatformMessage(std::move(message));
279 });
280}

◆ TEST_F() [14/19]

flutter::TEST_F ( EngineTest  ,
PassesLoadDartDeferredLibraryErrorToRuntime   
)

Definition at line 441 of file engine_unittests.cc.

441 {
442 PostUITaskSync([this] {
443 intptr_t error_id = 123;
444 const std::string error_message = "error message";
445 MockRuntimeDelegate client;
446 auto mock_runtime_controller =
447 std::make_unique<MockRuntimeController>(client, task_runners_);
448 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
449 .WillRepeatedly(::testing::Return(true));
450 EXPECT_CALL(*mock_runtime_controller,
451 LoadDartDeferredLibraryError(error_id, error_message, true))
452 .Times(1);
453 auto engine = std::make_unique<Engine>(
454 /*delegate=*/delegate_,
455 /*dispatcher_maker=*/dispatcher_maker_,
456 /*image_decoder_task_runner=*/image_decoder_task_runner_,
457 /*task_runners=*/task_runners_,
458 /*settings=*/settings_,
459 /*animator=*/std::move(animator_),
460 /*io_manager=*/io_manager_,
461 /*font_collection=*/std::make_shared<FontCollection>(),
462 /*runtime_controller=*/std::move(mock_runtime_controller),
463 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
464
465 engine->LoadDartDeferredLibraryError(error_id, error_message, true);
466 });
467}

◆ TEST_F() [15/19]

flutter::TEST_F ( EngineTest  ,
SpawnedEngineInheritsAssetManager   
)

Definition at line 469 of file engine_unittests.cc.

469 {
470 PostUITaskSync([this] {
471 MockRuntimeDelegate client;
472 auto mock_runtime_controller =
473 std::make_unique<MockRuntimeController>(client, task_runners_);
474 auto vm_ref = DartVMRef::Create(settings_);
475 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
476 .WillRepeatedly(::testing::Return(vm_ref.get()));
477
478 // auto mock_font_collection = std::make_shared<MockFontCollection>();
479 // EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
480 // .WillOnce(::testing::Return());
481 auto engine = std::make_unique<Engine>(
482 /*delegate=*/delegate_,
483 /*dispatcher_maker=*/dispatcher_maker_,
484 /*image_decoder_task_runner=*/image_decoder_task_runner_,
485 /*task_runners=*/task_runners_,
486 /*settings=*/settings_,
487 /*animator=*/std::move(animator_),
488 /*io_manager=*/io_manager_,
489 /*font_collection=*/std::make_shared<FontCollection>(),
490 /*runtime_controller=*/std::move(mock_runtime_controller),
491 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
492
493 EXPECT_EQ(engine->GetAssetManager(), nullptr);
494
495 auto asset_manager = std::make_shared<AssetManager>();
496 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
497 engine->UpdateAssetManager(asset_manager);
498 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
499
500 auto spawn =
502 std::string(), io_manager_, snapshot_delegate_, nullptr);
503 EXPECT_TRUE(spawn != nullptr);
504 EXPECT_EQ(engine->GetAssetManager(), spawn->GetAssetManager());
505 });
506}
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate_

◆ TEST_F() [16/19]

flutter::TEST_F ( EngineTest  ,
SpawnSharesFontLibrary   
)

Definition at line 348 of file engine_unittests.cc.

348 {
349 PostUITaskSync([this] {
350 MockRuntimeDelegate client;
351 auto mock_runtime_controller =
352 std::make_unique<MockRuntimeController>(client, task_runners_);
353 auto vm_ref = DartVMRef::Create(settings_);
354 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
355 .WillRepeatedly(::testing::Return(vm_ref.get()));
356 auto engine = std::make_unique<Engine>(
357 /*delegate=*/delegate_,
358 /*dispatcher_maker=*/dispatcher_maker_,
359 /*image_decoder_task_runner=*/image_decoder_task_runner_,
360 /*task_runners=*/task_runners_,
361 /*settings=*/settings_,
362 /*animator=*/std::move(animator_),
363 /*io_manager=*/io_manager_,
364 /*font_collection=*/std::make_shared<FontCollection>(),
365 /*runtime_controller=*/std::move(mock_runtime_controller),
366 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
367
368 auto spawn =
370 std::string(), io_manager_, snapshot_delegate_, nullptr);
371 EXPECT_TRUE(spawn != nullptr);
372 EXPECT_EQ(&engine->GetFontCollection(), &spawn->GetFontCollection());
373 });
374}

◆ TEST_F() [17/19]

flutter::TEST_F ( EngineTest  ,
SpawnWithCustomInitialRoute   
)

Definition at line 376 of file engine_unittests.cc.

376 {
377 PostUITaskSync([this] {
378 MockRuntimeDelegate client;
379 auto mock_runtime_controller =
380 std::make_unique<MockRuntimeController>(client, task_runners_);
381 auto vm_ref = DartVMRef::Create(settings_);
382 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
383 .WillRepeatedly(::testing::Return(vm_ref.get()));
384 auto engine = std::make_unique<Engine>(
385 /*delegate=*/delegate_,
386 /*dispatcher_maker=*/dispatcher_maker_,
387 /*image_decoder_task_runner=*/image_decoder_task_runner_,
388 /*task_runners=*/task_runners_,
389 /*settings=*/settings_,
390 /*animator=*/std::move(animator_),
391 /*io_manager=*/io_manager_,
392 /*font_collection=*/std::make_shared<FontCollection>(),
393 /*runtime_controller=*/std::move(mock_runtime_controller),
394 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
395
396 auto spawn =
397 engine->Spawn(delegate_, dispatcher_maker_, settings_, nullptr, "/foo",
399 EXPECT_TRUE(spawn != nullptr);
400 ASSERT_EQ("/foo", spawn->InitialRoute());
401 });
402}

◆ TEST_F() [18/19]

flutter::TEST_F ( EngineTest  ,
SpawnWithCustomSettings   
)

Definition at line 404 of file engine_unittests.cc.

404 {
405 PostUITaskSync([this] {
406 MockRuntimeDelegate client;
407 auto mock_runtime_controller =
408 std::make_unique<MockRuntimeController>(client, task_runners_);
409 auto vm_ref = DartVMRef::Create(settings_);
410 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
411 .WillRepeatedly(::testing::Return(vm_ref.get()));
412 auto engine = std::make_unique<Engine>(
413 /*delegate=*/delegate_,
414 /*dispatcher_maker=*/dispatcher_maker_,
415 /*image_decoder_task_runner=*/image_decoder_task_runner_,
416 /*task_runners=*/task_runners_,
417 /*settings=*/settings_,
418 /*animator=*/std::move(animator_),
419 /*io_manager=*/io_manager_,
420 /*font_collection=*/std::make_shared<FontCollection>(),
421 /*runtime_controller=*/std::move(mock_runtime_controller),
422 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
423
424 Settings custom_settings = settings_;
425 custom_settings.persistent_isolate_data =
426 std::make_shared<fml::DataMapping>("foo");
427 auto spawn =
428 engine->Spawn(delegate_, dispatcher_maker_, custom_settings, nullptr,
429 std::string(), io_manager_, snapshot_delegate_, nullptr);
430 EXPECT_TRUE(spawn != nullptr);
431 auto new_persistent_isolate_data =
432 const_cast<RuntimeController*>(spawn->GetRuntimeController())
433 ->GetPersistentIsolateData();
434 EXPECT_EQ(custom_settings.persistent_isolate_data->GetMapping(),
435 new_persistent_isolate_data->GetMapping());
436 EXPECT_EQ(custom_settings.persistent_isolate_data->GetSize(),
437 new_persistent_isolate_data->GetSize());
438 });
439}
std::shared_ptr< const fml::Mapping > persistent_isolate_data
Definition: settings.h:337

◆ TEST_F() [19/19]

flutter::TEST_F ( EngineTest  ,
UpdateAssetManagerWithEqualManagers   
)

Definition at line 508 of file engine_unittests.cc.

508 {
509 PostUITaskSync([this] {
510 MockRuntimeDelegate client;
511 auto mock_runtime_controller =
512 std::make_unique<MockRuntimeController>(client, task_runners_);
513 auto vm_ref = DartVMRef::Create(settings_);
514 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
515 .WillRepeatedly(::testing::Return(vm_ref.get()));
516
517 auto mock_font_collection = std::make_shared<MockFontCollection>();
518 EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
519 .WillOnce(::testing::Return());
520 auto engine = std::make_unique<Engine>(
521 /*delegate=*/delegate_,
522 /*dispatcher_maker=*/dispatcher_maker_,
523 /*image_decoder_task_runner=*/image_decoder_task_runner_,
524 /*task_runners=*/task_runners_,
525 /*settings=*/settings_,
526 /*animator=*/std::move(animator_),
527 /*io_manager=*/io_manager_,
528 /*font_collection=*/mock_font_collection,
529 /*runtime_controller=*/std::move(mock_runtime_controller),
530 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
531
532 EXPECT_EQ(engine->GetAssetManager(), nullptr);
533
534 auto asset_manager = std::make_shared<AssetManager>();
535 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
536
537 auto asset_manager_2 = std::make_shared<AssetManager>();
538 asset_manager_2->PushBack(std::make_unique<FontManifestAssetResolver>());
539
540 EXPECT_NE(asset_manager, asset_manager_2);
541 EXPECT_TRUE(*asset_manager == *asset_manager_2);
542
543 engine->UpdateAssetManager(asset_manager);
544 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
545
546 engine->UpdateAssetManager(asset_manager_2);
547 // Didn't change because they're equivalent.
548 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
549 });
550}

◆ ThreadExitCallback()

void flutter::ThreadExitCallback ( )

Definition at line 161 of file dart_vm.cc.

161{}

◆ ToDlISize()

const DlISize & flutter::ToDlISize ( const SkISize size)
inline

Definition at line 46 of file dl_geometry_types.h.

46 {
47 return *reinterpret_cast<const DlISize*>(&size);
48}

◆ ToDlMatrix() [1/2]

constexpr DlMatrix flutter::ToDlMatrix ( const SkM44 matrix)
inlineconstexpr

Definition at line 61 of file dl_geometry_types.h.

61 {
62 DlMatrix dl_matrix;
63 matrix.getColMajor(dl_matrix.m);
64 return dl_matrix;
65}
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
Scalar m[16]
Definition: matrix.h:39

◆ ToDlMatrix() [2/2]

constexpr DlMatrix flutter::ToDlMatrix ( const SkMatrix matrix)
inlineconstexpr

Definition at line 50 of file dl_geometry_types.h.

50 {
51 // clang-format off
52 return DlMatrix::MakeColumn(
55 0.0f, 0.0f, 1.0f, 0.0f,
57 );
58 // clang-format on
59}

◆ ToDlPoint()

const DlPoint & flutter::ToDlPoint ( const SkPoint point)
inline

Definition at line 38 of file dl_geometry_types.h.

38 {
39 return *reinterpret_cast<const DlPoint*>(&point);
40}

◆ ToDlRect()

const DlRect & flutter::ToDlRect ( const SkRect rect)
inline

Definition at line 42 of file dl_geometry_types.h.

42 {
43 return *reinterpret_cast<const DlRect*>(&rect);
44}

◆ toLower()

static uint64_t flutter::toLower ( uint64_t  n)
static

Definition at line 80 of file keyboard_key_embedder_handler.cc.

80 {
81 constexpr uint64_t lower_a = 0x61;
82 constexpr uint64_t upper_a = 0x41;
83 constexpr uint64_t upper_z = 0x5a;
84
85 constexpr uint64_t lower_a_grave = 0xe0;
86 constexpr uint64_t upper_a_grave = 0xc0;
87 constexpr uint64_t upper_thorn = 0xde;
88 constexpr uint64_t division = 0xf7;
89
90 // ASCII range.
91 if (n >= upper_a && n <= upper_z) {
92 return n - upper_a + lower_a;
93 }
94
95 // EASCII range.
96 if (n >= upper_a_grave && n <= upper_thorn && n != division) {
97 return n - upper_a_grave + lower_a_grave;
98 }
99
100 return n;
101}

◆ ToMatrix()

static impeller::Matrix flutter::ToMatrix ( const tonic::Float64List &  matrix4)
static

Definition at line 102 of file scene_node.cc.

102 {
103 return impeller::Matrix(static_cast<impeller::Scalar>(matrix4[0]),
104 static_cast<impeller::Scalar>(matrix4[1]),
105 static_cast<impeller::Scalar>(matrix4[2]),
106 static_cast<impeller::Scalar>(matrix4[3]),
107 static_cast<impeller::Scalar>(matrix4[4]),
108 static_cast<impeller::Scalar>(matrix4[5]),
109 static_cast<impeller::Scalar>(matrix4[6]),
110 static_cast<impeller::Scalar>(matrix4[7]),
111 static_cast<impeller::Scalar>(matrix4[8]),
112 static_cast<impeller::Scalar>(matrix4[9]),
113 static_cast<impeller::Scalar>(matrix4[10]),
114 static_cast<impeller::Scalar>(matrix4[11]),
115 static_cast<impeller::Scalar>(matrix4[12]),
116 static_cast<impeller::Scalar>(matrix4[13]),
117 static_cast<impeller::Scalar>(matrix4[14]),
118 static_cast<impeller::Scalar>(matrix4[15]));
119}
float Scalar
Definition: scalar.h:18
SK_API sk_sp< PrecompileColorFilter > Matrix()

◆ ToMatrix4()

tonic::Float64List flutter::ToMatrix4 ( const SkMatrix sk_matrix)

Definition at line 46 of file matrix.cc.

46 {
47 tonic::Float64List matrix4(Dart_NewTypedData(Dart_TypedData_kFloat64, 16));
48 for (int i = 0; i < 9; ++i) {
50 }
51 matrix4[10] = 1.0; // Identity along the z axis.
52 return matrix4;
53}
@ Dart_TypedData_kFloat64
Definition: dart_api.h:2624
SkMatrix sk_matrix
static const int kSkMatrixIndexToMatrix4Index[]
Definition: matrix.cc:13

◆ ToNonShaderSk()

SkPaint flutter::ToNonShaderSk ( const DlPaint paint)

Definition at line 62 of file dl_sk_conversions.cc.

62 {
63 DlPaint non_shader_paint = paint;
64 non_shader_paint.setColorSource(nullptr);
65 return ToSk(non_shader_paint);
66}
DlPaint & setColorSource(std::shared_ptr< const DlColorSource > source)
Definition: dl_paint.h:131
sk_sp< SkVertices > ToSk(const DlVertices *vertices)

◆ ToSk() [1/29]

SkBlurStyle flutter::ToSk ( const DlBlurStyle  blur_style)
inline

Definition at line 43 of file dl_sk_conversions.h.

43 {
44 return static_cast<SkBlurStyle>(blur_style);
45}
SkBlurStyle
Definition: SkBlurTypes.h:11

◆ ToSk() [2/29]

sk_sp< SkColorFilter > flutter::ToSk ( const DlColorFilter filter)
inline

Definition at line 104 of file dl_sk_conversions.h.

104 {
105 return ToSk(&filter);
106}
sk_sp< SkVertices > ToSk(const DlVertices &vertices)

◆ ToSk() [3/29]

sk_sp< SkColorFilter > flutter::ToSk ( const DlColorFilter filter)

Definition at line 235 of file dl_sk_conversions.cc.

235 {
236 if (!filter) {
237 return nullptr;
238 }
239 switch (filter->type()) {
240 case DlColorFilterType::kBlend: {
241 const DlBlendColorFilter* blend_filter = filter->asBlend();
242 FML_DCHECK(blend_filter != nullptr);
243 return SkColorFilters::Blend(ToSk(blend_filter->color()),
244 ToSk(blend_filter->mode()));
245 }
246 case DlColorFilterType::kMatrix: {
247 const DlMatrixColorFilter* matrix_filter = filter->asMatrix();
248 FML_DCHECK(matrix_filter != nullptr);
249 float matrix[20];
250 matrix_filter->get_matrix(matrix);
252 }
253 case DlColorFilterType::kSrgbToLinearGamma: {
255 }
256 case DlColorFilterType::kLinearToSrgbGamma: {
258 }
259 }
260}
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
static sk_sp< SkColorFilter > SRGBToLinearGamma()
static sk_sp< SkColorFilter > LinearToSRGBGamma()
virtual T type() const =0
virtual const DlBlendColorFilter * asBlend() const
virtual const DlMatrixColorFilter * asMatrix() const

◆ ToSk() [4/29]

sk_sp< SkShader > flutter::ToSk ( const DlColorSource source)
inline

Definition at line 86 of file dl_sk_conversions.h.

86 {
87 return ToSk(&source);
88}
SkBitmap source
Definition: examples.cpp:28

◆ ToSk() [5/29]

sk_sp< SkShader > flutter::ToSk ( const DlColorSource source)

Definition at line 68 of file dl_sk_conversions.cc.

68 {
69 if (!source) {
70 return nullptr;
71 }
72 static auto ToSkColors = [](const DlGradientColorSourceBase* gradient) {
73 return reinterpret_cast<const SkColor*>(gradient->colors());
74 };
75 switch (source->type()) {
77 const DlColorColorSource* color_source = source->asColor();
78 FML_DCHECK(color_source != nullptr);
79 return SkShaders::Color(ToSk(color_source->color()));
80 }
81 case DlColorSourceType::kImage: {
82 const DlImageColorSource* image_source = source->asImage();
83 FML_DCHECK(image_source != nullptr);
84 auto image = image_source->image();
85 if (!image || !image->skia_image()) {
86 return nullptr;
87 }
88 return image->skia_image()->makeShader(
89 ToSk(image_source->horizontal_tile_mode()),
90 ToSk(image_source->vertical_tile_mode()),
91 ToSk(image_source->sampling()), image_source->matrix_ptr());
92 }
93 case DlColorSourceType::kLinearGradient: {
94 const DlLinearGradientColorSource* linear_source =
95 source->asLinearGradient();
96 FML_DCHECK(linear_source != nullptr);
97 SkPoint pts[] = {linear_source->start_point(),
98 linear_source->end_point()};
100 pts, ToSkColors(linear_source), linear_source->stops(),
101 linear_source->stop_count(), ToSk(linear_source->tile_mode()), 0,
102 linear_source->matrix_ptr());
103 }
104 case DlColorSourceType::kRadialGradient: {
105 const DlRadialGradientColorSource* radial_source =
106 source->asRadialGradient();
107 FML_DCHECK(radial_source != nullptr);
109 radial_source->center(), radial_source->radius(),
110 ToSkColors(radial_source), radial_source->stops(),
111 radial_source->stop_count(), ToSk(radial_source->tile_mode()), 0,
112 radial_source->matrix_ptr());
113 }
114 case DlColorSourceType::kConicalGradient: {
115 const DlConicalGradientColorSource* conical_source =
116 source->asConicalGradient();
117 FML_DCHECK(conical_source != nullptr);
119 conical_source->start_center(), conical_source->start_radius(),
120 conical_source->end_center(), conical_source->end_radius(),
121 ToSkColors(conical_source), conical_source->stops(),
122 conical_source->stop_count(), ToSk(conical_source->tile_mode()), 0,
123 conical_source->matrix_ptr());
124 }
125 case DlColorSourceType::kSweepGradient: {
126 const DlSweepGradientColorSource* sweep_source =
127 source->asSweepGradient();
128 FML_DCHECK(sweep_source != nullptr);
130 sweep_source->center().x(), sweep_source->center().y(),
131 ToSkColors(sweep_source), sweep_source->stops(),
132 sweep_source->stop_count(), ToSk(sweep_source->tile_mode()),
133 sweep_source->start(), sweep_source->end(), 0,
134 sweep_source->matrix_ptr());
135 }
136 case DlColorSourceType::kRuntimeEffect: {
137 const DlRuntimeEffectColorSource* runtime_source =
138 source->asRuntimeEffect();
139 FML_DCHECK(runtime_source != nullptr);
140 auto runtime_effect = runtime_source->runtime_effect();
141 if (!runtime_effect || !runtime_effect->skia_runtime_effect()) {
142 return nullptr;
143 }
144
145 auto samplers = runtime_source->samplers();
146 std::vector<sk_sp<SkShader>> sk_samplers(samplers.size());
147 for (size_t i = 0; i < samplers.size(); i++) {
148 auto sampler = samplers[i];
149 if (sampler == nullptr) {
150 return nullptr;
151 }
152 sk_samplers[i] = ToSk(sampler);
153 }
154
155 auto uniform_data = runtime_source->uniform_data();
156 auto ref = new std::shared_ptr<std::vector<uint8_t>>(uniform_data);
157 auto sk_uniform_data = SkData::MakeWithProc(
158 uniform_data->data(), uniform_data->size(),
159 [](const void* ptr, void* context) {
160 delete reinterpret_cast<std::shared_ptr<std::vector<uint8_t>>*>(
161 context);
162 },
163 ref);
164
165 return runtime_effect->skia_runtime_effect()->makeShader(
166 sk_uniform_data, sk_samplers.data(), sk_samplers.size());
167 }
168#ifdef IMPELLER_ENABLE_3D
169 case DlColorSourceType::kScene: {
170 return nullptr;
171 }
172#endif // IMPELLER_ENABLE_3D
173 }
174}
sk_sp< SkImage > asImage() const
Definition: SkBitmap.cpp:645
static sk_sp< SkData > MakeWithProc(const void *ptr, size_t length, ReleaseProc proc, void *ctx)
Definition: SkData.cpp:128
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeRadial(const SkPoint &center, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
Definition: SkImage.cpp:179
SK_API sk_sp< SkShader > Color(SkColor)

◆ ToSk() [6/29]

SkFilterMode flutter::ToSk ( const DlFilterMode  filter_mode)
inline

Definition at line 47 of file dl_sk_conversions.h.

47 {
48 return static_cast<SkFilterMode>(filter_mode);
49}
SkFilterMode

◆ ToSk() [7/29]

sk_sp< SkImageFilter > flutter::ToSk ( const DlImageFilter filter)
inline

Definition at line 95 of file dl_sk_conversions.h.

95 {
96 return ToSk(&filter);
97}

◆ ToSk() [8/29]

sk_sp< SkImageFilter > flutter::ToSk ( const DlImageFilter filter)

Definition at line 176 of file dl_sk_conversions.cc.

176 {
177 if (!filter) {
178 return nullptr;
179 }
180 switch (filter->type()) {
182 const DlBlurImageFilter* blur_filter = filter->asBlur();
183 FML_DCHECK(blur_filter != nullptr);
184 return SkImageFilters::Blur(blur_filter->sigma_x(),
185 blur_filter->sigma_y(),
186 ToSk(blur_filter->tile_mode()), nullptr);
187 }
188 case DlImageFilterType::kDilate: {
189 const DlDilateImageFilter* dilate_filter = filter->asDilate();
190 FML_DCHECK(dilate_filter != nullptr);
191 return SkImageFilters::Dilate(dilate_filter->radius_x(),
192 dilate_filter->radius_y(), nullptr);
193 }
194 case DlImageFilterType::kErode: {
195 const DlErodeImageFilter* erode_filter = filter->asErode();
196 FML_DCHECK(erode_filter != nullptr);
197 return SkImageFilters::Erode(erode_filter->radius_x(),
198 erode_filter->radius_y(), nullptr);
199 }
200 case DlImageFilterType::kMatrix: {
201 const DlMatrixImageFilter* matrix_filter = filter->asMatrix();
202 FML_DCHECK(matrix_filter != nullptr);
204 matrix_filter->matrix(), ToSk(matrix_filter->sampling()), nullptr);
205 }
206 case DlImageFilterType::kCompose: {
207 const DlComposeImageFilter* compose_filter = filter->asCompose();
208 FML_DCHECK(compose_filter != nullptr);
209 return SkImageFilters::Compose(ToSk(compose_filter->outer()),
210 ToSk(compose_filter->inner()));
211 }
212 case DlImageFilterType::kColorFilter: {
213 const DlColorFilterImageFilter* cf_filter = filter->asColorFilter();
214 FML_DCHECK(cf_filter != nullptr);
215 return SkImageFilters::ColorFilter(ToSk(cf_filter->color_filter()),
216 nullptr);
217 }
218 case DlImageFilterType::kLocalMatrix: {
219 const DlLocalMatrixImageFilter* lm_filter = filter->asLocalMatrix();
220 FML_DCHECK(lm_filter != nullptr);
221 sk_sp<SkImageFilter> skia_filter = ToSk(lm_filter->image_filter());
222 // The image_filter property itself might have been null, or the
223 // construction of the SkImageFilter might be optimized to null
224 // for any number of reasons. In any case, if the filter is null
225 // or optimizaed away, let's then optimize away this local matrix
226 // case by returning null.
227 if (!skia_filter) {
228 return nullptr;
229 }
230 return skia_filter->makeWithLocalMatrix(lm_filter->matrix());
231 }
232 }
233}
sk_sp< SkImageFilter > makeWithLocalMatrix(const SkMatrix &matrix) const
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Erode(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Compose(sk_sp< SkImageFilter > outer, sk_sp< SkImageFilter > inner)
static sk_sp< SkImageFilter > MatrixTransform(const SkMatrix &matrix, const SkSamplingOptions &sampling, sk_sp< SkImageFilter > input)
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
virtual const DlLocalMatrixImageFilter * asLocalMatrix() const
virtual const DlColorFilterImageFilter * asColorFilter() const
virtual const DlMatrixImageFilter * asMatrix() const
virtual const DlComposeImageFilter * asCompose() const
virtual const DlBlurImageFilter * asBlur() const
virtual const DlDilateImageFilter * asDilate() const
virtual const DlErodeImageFilter * asErode() const

◆ ToSk() [9/29]

sk_sp< SkMaskFilter > flutter::ToSk ( const DlMaskFilter filter)
inline

Definition at line 113 of file dl_sk_conversions.h.

113 {
114 return ToSk(&filter);
115}

◆ ToSk() [10/29]

sk_sp< SkMaskFilter > flutter::ToSk ( const DlMaskFilter filter)

Definition at line 262 of file dl_sk_conversions.cc.

262 {
263 if (!filter) {
264 return nullptr;
265 }
266 switch (filter->type()) {
268 const DlBlurMaskFilter* blur_filter = filter->asBlur();
269 FML_DCHECK(blur_filter != nullptr);
270 return SkMaskFilter::MakeBlur(ToSk(blur_filter->style()),
271 blur_filter->sigma(),
272 blur_filter->respectCTM());
273 }
274 }
275}
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
virtual const DlBlurMaskFilter * asBlur() const

◆ ToSk() [11/29]

SkPaint flutter::ToSk ( const DlPaint paint)

Definition at line 22 of file dl_sk_conversions.cc.

22 {
23 SkPaint sk_paint;
24
25 sk_paint.setAntiAlias(paint.isAntiAlias());
26 sk_paint.setColor(ToSk(paint.getColor()));
27 sk_paint.setBlendMode(ToSk(paint.getBlendMode()));
28 sk_paint.setStyle(ToSk(paint.getDrawStyle()));
29 sk_paint.setStrokeWidth(paint.getStrokeWidth());
30 sk_paint.setStrokeMiter(paint.getStrokeMiter());
31 sk_paint.setStrokeCap(ToSk(paint.getStrokeCap()));
32 sk_paint.setStrokeJoin(ToSk(paint.getStrokeJoin()));
33 sk_paint.setImageFilter(ToSk(paint.getImageFilterPtr()));
34 auto color_filter = ToSk(paint.getColorFilterPtr());
35 if (paint.isInvertColors()) {
36 auto invert_filter = SkColorFilters::Matrix(kInvertColorMatrix);
37 if (color_filter) {
38 invert_filter = invert_filter->makeComposed(color_filter);
39 }
40 color_filter = invert_filter;
41 }
43
44 auto color_source = paint.getColorSourcePtr();
45 if (color_source) {
46 // Unconditionally set dither to true for gradient shaders.
47 sk_paint.setDither(color_source->isGradient());
48 sk_paint.setShader(ToSk(color_source));
49 }
50
51 sk_paint.setMaskFilter(ToSk(paint.getMaskFilterPtr()));
52
53 return sk_paint;
54}
static sk_sp< SkImage > color_filter(const SkImage *image, SkColorFilter *colorFilter)
void setStyle(Style style)
Definition: SkPaint.cpp:105
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setStrokeMiter(SkScalar miter)
Definition: SkPaint.cpp:169
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
void setDither(bool dither)
Definition: SkPaint.h:182
void setImageFilter(sk_sp< SkImageFilter > imageFilter)
void setStrokeCap(Cap cap)
Definition: SkPaint.cpp:179
void setStrokeJoin(Join join)
Definition: SkPaint.cpp:189
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
void setShader(sk_sp< SkShader > shader)
void setBlendMode(SkBlendMode mode)
Definition: SkPaint.cpp:151
void setColorFilter(sk_sp< SkColorFilter > colorFilter)
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
constexpr float kInvertColorMatrix[20]

◆ ToSk() [12/29]

sk_sp< SkVertices > flutter::ToSk ( const DlVertices vertices)
inline

Definition at line 122 of file dl_sk_conversions.h.

122 {
123 return ToSk(&vertices);
124}

◆ ToSk() [13/29]

sk_sp< SkVertices > flutter::ToSk ( const DlVertices vertices)

Definition at line 277 of file dl_sk_conversions.cc.

277 {
278 const SkColor* sk_colors =
279 reinterpret_cast<const SkColor*>(vertices->colors());
280 return SkVertices::MakeCopy(ToSk(vertices->mode()), vertices->vertex_count(),
281 vertices->vertices(),
282 vertices->texture_coordinates(), sk_colors,
283 vertices->index_count(), vertices->indices());
284}
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
Definition: SkVertices.cpp:200
const DlColor * colors() const
Definition: dl_vertices.h:217
int vertex_count() const
Definition: dl_vertices.h:202
DlVertexMode mode() const
Definition: dl_vertices.h:198
int index_count() const
Definition: dl_vertices.h:223
const SkPoint * vertices() const
Returns a pointer to the vertex information. Should be non-null.
Definition: dl_vertices.h:205
const uint16_t * indices() const
Definition: dl_vertices.h:227
const SkPoint * texture_coordinates() const
Definition: dl_vertices.h:211

◆ ToSk() [14/29]

sk_sp< SkColorFilter > flutter::ToSk ( const std::shared_ptr< const DlColorFilter > &  filter)
inline

Definition at line 100 of file dl_sk_conversions.h.

101 {
102 return ToSk(filter.get());
103}

◆ ToSk() [15/29]

sk_sp< SkShader > flutter::ToSk ( const std::shared_ptr< const DlColorSource > &  source)
inline

Definition at line 82 of file dl_sk_conversions.h.

83 {
84 return ToSk(source.get());
85}

◆ ToSk() [16/29]

sk_sp< SkImageFilter > flutter::ToSk ( const std::shared_ptr< const DlImageFilter > &  filter)
inline

Definition at line 91 of file dl_sk_conversions.h.

92 {
93 return ToSk(filter.get());
94}

◆ ToSk() [17/29]

sk_sp< SkMaskFilter > flutter::ToSk ( const std::shared_ptr< const DlMaskFilter > &  filter)
inline

Definition at line 109 of file dl_sk_conversions.h.

110 {
111 return ToSk(filter.get());
112}

◆ ToSk() [18/29]

sk_sp< SkVertices > flutter::ToSk ( const std::shared_ptr< const DlVertices > &  vertices)
inline

Definition at line 118 of file dl_sk_conversions.h.

119 {
120 return ToSk(vertices.get());
121}

◆ ToSk() [19/29]

SkBlendMode flutter::ToSk ( DlBlendMode  mode)
inline

Definition at line 17 of file dl_sk_conversions.h.

17 {
18 return static_cast<SkBlendMode>(mode);
19}
SkBlendMode
Definition: SkBlendMode.h:38
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

◆ ToSk() [20/29]

SkClipOp flutter::ToSk ( DlCanvas::ClipOp  op)
inline

Definition at line 73 of file dl_sk_conversions.h.

73 {
74 return static_cast<SkClipOp>(op);
75}
SkClipOp
Definition: SkClipOp.h:13

◆ ToSk() [21/29]

SkCanvas::PointMode flutter::ToSk ( DlCanvas::PointMode  mode)
inline

Definition at line 77 of file dl_sk_conversions.h.

77 {
78 return static_cast<SkCanvas::PointMode>(mode);
79}

◆ ToSk() [22/29]

SkCanvas::SrcRectConstraint flutter::ToSk ( DlCanvas::SrcRectConstraint  constraint)
inline

Definition at line 68 of file dl_sk_conversions.h.

69 {
70 return static_cast<SkCanvas::SrcRectConstraint>(constraint);
71}
SrcRectConstraint
Definition: SkCanvas.h:1541

◆ ToSk() [23/29]

SkColor flutter::ToSk ( DlColor  color)
inline

Definition at line 21 of file dl_sk_conversions.h.

21 {
22 // This is safe because both SkColor and DlColor are backed by ARGB uint32_t.
23 // See dl_sk_conversions_unittests.cc.
24 return reinterpret_cast<SkColor&>(color);
25}

◆ ToSk() [24/29]

SkPaint::Style flutter::ToSk ( DlDrawStyle  style)
inline

Definition at line 27 of file dl_sk_conversions.h.

27 {
28 return static_cast<SkPaint::Style>(style);
29}

◆ ToSk() [25/29]

SkSamplingOptions flutter::ToSk ( DlImageSampling  sampling)
inline

Definition at line 55 of file dl_sk_conversions.h.

55 {
56 switch (sampling) {
57 case DlImageSampling::kCubic:
58 return SkSamplingOptions(SkCubicResampler{1 / 3.0f, 1 / 3.0f});
61 case DlImageSampling::kMipmapLinear:
63 case DlImageSampling::kNearestNeighbor:
65 }
66}
SkSamplingOptions sampling
Definition: SkRecords.h:337
SkSamplingOptions(SkFilterMode::kLinear))

◆ ToSk() [26/29]

SkPaint::Cap flutter::ToSk ( DlStrokeCap  cap)
inline

Definition at line 31 of file dl_sk_conversions.h.

31 {
32 return static_cast<SkPaint::Cap>(cap);
33}

◆ ToSk() [27/29]

SkPaint::Join flutter::ToSk ( DlStrokeJoin  join)
inline

Definition at line 35 of file dl_sk_conversions.h.

35 {
36 return static_cast<SkPaint::Join>(join);
37}
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ ToSk() [28/29]

SkTileMode flutter::ToSk ( DlTileMode  dl_mode)
inline

Definition at line 39 of file dl_sk_conversions.h.

39 {
40 return static_cast<SkTileMode>(dl_mode);
41}
SkTileMode
Definition: SkTileMode.h:13

◆ ToSk() [29/29]

SkVertices::VertexMode flutter::ToSk ( DlVertexMode  dl_mode)
inline

Definition at line 51 of file dl_sk_conversions.h.

51 {
52 return static_cast<SkVertices::VertexMode>(dl_mode);
53}

◆ ToSkISize()

const SkISize & flutter::ToSkISize ( const DlISize size)
inline

Definition at line 75 of file dl_geometry_types.h.

75 {
76 return *reinterpret_cast<const SkISize*>(&size);
77}

◆ ToSkM44() [1/2]

constexpr SkM44 flutter::ToSkM44 ( const DlMatrix matrix)
inlineconstexpr

Definition at line 85 of file dl_geometry_types.h.

85 {
86 return SkM44::ColMajor(matrix.m);
87}
static SkM44 ColMajor(const SkScalar c[16])
Definition: SkM44.h:218

◆ ToSkM44() [2/2]

SkM44 flutter::ToSkM44 ( const tonic::Float64List &  matrix4)

Definition at line 21 of file matrix.cc.

21 {
22 // clang-format off
23 return SkM44(
24 SafeNarrow(matrix4[ 0]), SafeNarrow(matrix4[ 4]), SafeNarrow(matrix4[ 8]), SafeNarrow(matrix4[12]),
25 SafeNarrow(matrix4[ 1]), SafeNarrow(matrix4[ 5]), SafeNarrow(matrix4[ 9]), SafeNarrow(matrix4[13]),
26 SafeNarrow(matrix4[ 2]), SafeNarrow(matrix4[ 6]), SafeNarrow(matrix4[10]), SafeNarrow(matrix4[14]),
27 SafeNarrow(matrix4[ 3]), SafeNarrow(matrix4[ 7]), SafeNarrow(matrix4[11]), SafeNarrow(matrix4[15])
28 );
29 // clang-format on
30}
Definition: SkM44.h:150
static float SafeNarrow(double value)

◆ ToSkMatrix() [1/2]

constexpr SkMatrix flutter::ToSkMatrix ( const DlMatrix matrix)
inlineconstexpr

Definition at line 79 of file dl_geometry_types.h.

79 {
80 return SkMatrix::MakeAll(matrix.m[0], matrix.m[4], matrix.m[12], //
81 matrix.m[1], matrix.m[5], matrix.m[13], //
82 matrix.m[3], matrix.m[7], matrix.m[15]);
83}
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
Definition: SkMatrix.h:179

◆ ToSkMatrix() [2/2]

SkMatrix flutter::ToSkMatrix ( const tonic::Float64List &  matrix4)

Definition at line 32 of file matrix.cc.

32 {
33 FML_DCHECK(matrix4.data());
35 for (int i = 0; i < 9; ++i) {
36 int matrix4_index = kSkMatrixIndexToMatrix4Index[i];
37 if (matrix4_index < matrix4.num_elements()) {
38 sk_matrix[i] = SafeNarrow(matrix4[matrix4_index]);
39 } else {
40 sk_matrix[i] = 0.0f;
41 }
42 }
43 return sk_matrix;
44}

◆ ToSkPoint()

const SkPoint & flutter::ToSkPoint ( const DlPoint point)
inline

Definition at line 67 of file dl_geometry_types.h.

67 {
68 return *reinterpret_cast<const SkPoint*>(&point);
69}

◆ ToSkRect()

const SkRect & flutter::ToSkRect ( const DlRect rect)
inline

Definition at line 71 of file dl_geometry_types.h.

71 {
72 return *reinterpret_cast<const SkRect*>(&rect);
73}

◆ ToStrokedSk()

SkPaint flutter::ToStrokedSk ( const DlPaint paint)

Definition at line 56 of file dl_sk_conversions.cc.

56 {
57 DlPaint stroked_paint = paint;
58 stroked_paint.setDrawStyle(DlDrawStyle::kStroke);
59 return ToSk(stroked_paint);
60}

◆ TransformedSurfaceSize()

static SkISize flutter::TransformedSurfaceSize ( const SkISize size,
const SkMatrix transformation 
)
static

Definition at line 18 of file embedder_external_view.cc.

19 {
20 const auto source_rect = SkRect::MakeWH(size.width(), size.height());
21 const auto transformed_rect = transformation.mapRect(source_rect);
22 return SkISize::Make(transformed_rect.width(), transformed_rect.height());
23}
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141

◆ UnblockSIGPROF()

static void flutter::UnblockSIGPROF ( )
static

Definition at line 325 of file tester_main.cc.

325 {
326#if defined(FML_OS_POSIX)
327 sigset_t set;
328 sigemptyset(&set);
329 sigaddset(&set, SIGPROF);
330 pthread_sigmask(SIG_UNBLOCK, &set, NULL);
331#endif // defined(FML_OS_POSIX)
332}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition: switches.h:76

◆ UndeadChar()

uint32_t flutter::UndeadChar ( uint32_t  ch)
inline

Definition at line 34 of file keyboard_utils.h.

34 {
35 return ch & ~kDeadKeyCharMask;
36}

◆ Unit() [1/2]

flutter::Unit ( benchmark::kMicrosecond  )

◆ Unit() [2/2]

flutter::Unit ( benchmark::kNanosecond  )

◆ UnregisterTexture()

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

Definition at line 509 of file platform_view_android_jni_impl.cc.

512 {
513 ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture(
514 static_cast<int64_t>(texture_id));
515}

◆ UnsafeUploadTextureToPrivate()

static std::pair< sk_sp< DlImage >, std::string > flutter::UnsafeUploadTextureToPrivate ( const std::shared_ptr< impeller::Context > &  context,
const std::shared_ptr< impeller::DeviceBuffer > &  buffer,
const SkImageInfo image_info 
)
static

Only call this method if the GPU is available.

Definition at line 257 of file image_decoder_impeller.cc.

260 {
261 const auto pixel_format =
263 if (!pixel_format) {
264 std::string decode_error(impeller::SPrintF(
265 "Unsupported pixel format (SkColorType=%d)", image_info.colorType()));
266 FML_DLOG(ERROR) << decode_error;
267 return std::make_pair(nullptr, decode_error);
268 }
269
270 impeller::TextureDescriptor texture_descriptor;
272 texture_descriptor.format = pixel_format.value();
273 texture_descriptor.size = {image_info.width(), image_info.height()};
274 texture_descriptor.mip_count = texture_descriptor.size.MipCount();
276
277 auto dest_texture =
278 context->GetResourceAllocator()->CreateTexture(texture_descriptor);
279 if (!dest_texture) {
280 std::string decode_error("Could not create Impeller texture.");
281 FML_DLOG(ERROR) << decode_error;
282 return std::make_pair(nullptr, decode_error);
283 }
284
285 dest_texture->SetLabel(
286 impeller::SPrintF("ui.Image(%p)", dest_texture.get()).c_str());
287
288 auto command_buffer = context->CreateCommandBuffer();
289 if (!command_buffer) {
290 std::string decode_error(
291 "Could not create command buffer for mipmap generation.");
292 FML_DLOG(ERROR) << decode_error;
293 return std::make_pair(nullptr, decode_error);
294 }
295 command_buffer->SetLabel("Mipmap Command Buffer");
296
297 auto blit_pass = command_buffer->CreateBlitPass();
298 if (!blit_pass) {
299 std::string decode_error(
300 "Could not create blit pass for mipmap generation.");
301 FML_DLOG(ERROR) << decode_error;
302 return std::make_pair(nullptr, decode_error);
303 }
304 blit_pass->SetLabel("Mipmap Blit Pass");
306 dest_texture);
307 if (texture_descriptor.size.MipCount() > 1) {
308 blit_pass->GenerateMipmap(dest_texture);
309 }
310
311 blit_pass->EncodeCommands(context->GetResourceAllocator());
312 if (!context->GetCommandQueue()->Submit({command_buffer}).ok()) {
313 std::string decode_error("Failed to submit blit pass command buffer.");
314 FML_DLOG(ERROR) << decode_error;
315 return std::make_pair(nullptr, decode_error);
316 }
317
318 return std::make_pair(
319 impeller::DlImageImpeller::Make(std::move(dest_texture)), std::string());
320}
static BufferView AsBufferView(std::shared_ptr< DeviceBuffer > buffer)
Create a buffer view of this entire buffer.
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
std::optional< impeller::PixelFormat > ToPixelFormat(SkColorType type)
std::string SPrintF(const char *format,...)
Definition: strings.cc:12
int width() const
Definition: SkImageInfo.h:365
SkColorType colorType() const
Definition: SkImageInfo.h:373
int height() const
Definition: SkImageInfo.h:371
constexpr size_t MipCount() const
Definition: size.h:115
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...

◆ UpdateDisplayMetrics()

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

Definition at line 367 of file platform_view_android_jni_impl.cc.

369 {
370 ANDROID_SHELL_HOLDER->UpdateDisplayMetrics();
371}

◆ UpdateJavaAssetManager()

static void flutter::UpdateJavaAssetManager ( JNIEnv *  env,
jobject  obj,
jlong  shell_holder,
jobject  jAssetManager,
jstring  jAssetBundlePath 
)
static

Definition at line 643 of file platform_view_android_jni_impl.cc.

647 {
648 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
649 env, // jni environment
650 jAssetManager, // asset manager
651 fml::jni::JavaStringToString(env, jAssetBundlePath)); // apk asset dir
652
653 ANDROID_SHELL_HOLDER->GetPlatformView()->UpdateAssetResolverByType(
654 std::move(asset_resolver),
655 AssetResolver::AssetResolverType::kApkAssetProvider);
656}

◆ UploadRasterImage()

static SkiaGPUObject< SkImage > flutter::UploadRasterImage ( sk_sp< SkImage image,
const fml::WeakPtr< IOManager > &  io_manager,
const fml::tracing::TraceFlow flow 
)
static

Definition at line 164 of file image_decoder_skia.cc.

167 {
168 TRACE_EVENT0("flutter", __FUNCTION__);
169 flow.Step(__FUNCTION__);
170
171 // Should not already be a texture image because that is the entire point of
172 // the this method.
174
175 if (!io_manager->GetResourceContext() || !io_manager->GetSkiaUnrefQueue()) {
177 << "Could not acquire context of release queue for texture upload.";
178 return {};
179 }
180
181 SkPixmap pixmap;
182 if (!image->peekPixels(&pixmap)) {
183 FML_LOG(ERROR) << "Could not peek pixels of image for texture upload.";
184 return {};
185 }
186
187 SkiaGPUObject<SkImage> result;
188 io_manager->GetIsGpuDisabledSyncSwitch()->Execute(
190 .SetIfTrue([&result, &pixmap, &image] {
193 pixmap,
194 [](const void* pixels, SkImages::ReleaseContext context) {
195 SkSafeUnref(static_cast<SkImage*>(context));
196 },
197 image.get());
198 result = {std::move(texture_image), nullptr};
199 })
200 .SetIfFalse([&result, context = io_manager->GetResourceContext(),
201 &pixmap, queue = io_manager->GetSkiaUnrefQueue()] {
202 TRACE_EVENT0("flutter", "MakeCrossContextImageFromPixmap");
203 sk_sp<SkImage> texture_image =
205 context.get(), // context
206 pixmap, // pixmap
207 true, // buildMips,
208 true // limitToMaxTextureSize
209 );
210 if (!texture_image) {
211 FML_LOG(ERROR) << "Could not make x-context image.";
212 result = {};
213 } else {
214 result = {std::move(texture_image), queue};
215 }
216 }));
217
218 return result;
219}
static void SkSafeUnref(T *obj)
Definition: SkRefCnt.h:149
static T * SkSafeRef(T *obj)
Definition: SkRefCnt.h:140
VkQueue queue
Definition: main.cc:55
SK_API sk_sp< SkImage > RasterFromPixmap(const SkPixmap &pixmap, RasterReleaseProc rasterReleaseProc, ReleaseContext releaseContext)
SK_API sk_sp< SkImage > CrossContextTextureFromPixmap(GrDirectContext *context, const SkPixmap &pixmap, bool buildMips, bool limitToMaxTextureSize=false)
void * ReleaseContext
Definition: SkImage.h:50
Represents the 2 code paths available when calling |SyncSwitch::Execute|.
Definition: sync_switch.h:35

◆ ValidNumTextures()

static bool flutter::ValidNumTextures ( int  expected,
int  actual 
)
static

Definition at line 17 of file embedder_external_texture_metal.mm.

17 {
18 if (expected == actual) {
19 return true;
20 } else {
21 FML_LOG(ERROR) << "Invalid number of textures, expected: " << expected << ", got: " << actual;
22 return false;
23 }
24}

◆ VectorToSize()

static FlutterSize flutter::VectorToSize ( const SkVector vector)
static

Definition at line 92 of file embedder_layers.cc.

92 {
93 FlutterSize size = {};
94 size.width = vector.x();
95 size.height = vector.y();
96 return size;
97}
A structure to represent the width and height.
Definition: embedder.h:423
constexpr float y() const
Definition: SkPoint_impl.h:187
constexpr float x() const
Definition: SkPoint_impl.h:181

◆ WindowsPlatformThreadPrioritySetter()

static void flutter::WindowsPlatformThreadPrioritySetter ( FlutterThreadPriority  priority)
static

Definition at line 60 of file flutter_windows_engine.h.

61 {
62 // TODO(99502): Add support for tracing to the windows embedding so we can
63 // mark thread priorities and success/failure.
64 switch (priority) {
66 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
67 break;
68 }
70 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
71 break;
72 }
74 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
75 break;
76 }
78 // For normal or default priority we do not need to set the priority
79 // class.
80 break;
81 }
82 }
83}
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
Definition: embedder.h:260
@ kDisplay
Suitable for threads which generate data for the display.
Definition: embedder.h:264

◆ WrapOnscreenSurface()

static sk_sp< SkSurface > flutter::WrapOnscreenSurface ( GrDirectContext context,
const SkISize size,
intptr_t  fbo 
)
static

Definition at line 134 of file gpu_surface_gl_skia.cc.

136 {
139
140 GrGLFramebufferInfo framebuffer_info = {};
141 framebuffer_info.fFBOID = static_cast<GrGLuint>(fbo);
142 framebuffer_info.fFormat = format;
143
144 auto render_target =
145 GrBackendRenderTargets::MakeGL(size.width(), // width
146 size.height(), // height
147 0, // sample count
148 0, // stencil bits
149 framebuffer_info // framebuffer info
150 );
151
154
156 context, // Gr context
157 render_target, // render target
159 color_type, // color type
160 colorspace, // colorspace
161 &surface_props // surface properties
162 );
163}
unsigned int GrGLuint
Definition: GrGLTypes.h:113
unsigned int GrGLenum
Definition: GrGLTypes.h:102
@ kBottomLeft_GrSurfaceOrigin
Definition: GrTypes.h:149
@ kUnknown_SkPixelGeometry
SK_API GrBackendRenderTarget MakeGL(int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
SK_API sk_sp< SkSurface > WrapBackendRenderTarget(GrRecordingContext *context, const GrBackendRenderTarget &backendRenderTarget, GrSurfaceOrigin origin, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, RenderTargetReleaseProc releaseProc=nullptr, ReleaseContext releaseContext=nullptr)
static SkColorType FirstSupportedColorType(GrDirectContext *context, GrGLenum *format)
uint32_t color_type

◆ WriteServerErrorResponse()

static void flutter::WriteServerErrorResponse ( rapidjson::Document *  document,
const char *  message 
)
static

Definition at line 104 of file service_protocol.cc.

105 {
106 document->SetObject();
107 document->AddMember("code", -32000, document->GetAllocator());
108 rapidjson::Value message_value;
109 message_value.SetString(message, document->GetAllocator());
110 document->AddMember("message", message_value, document->GetAllocator());
111}

Variable Documentation

◆ allowlist

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia flutter::allowlist

Definition at line 171 of file switches.h.

◆ backends

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan flutter::backends

Definition at line 276 of file switches.h.

◆ buffer

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace flutter::buffer

Definition at line 126 of file switches.h.

◆ cache

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent flutter::cache

Definition at line 191 of file switches.h.

◆ canApplyBlurBackdrop

BOOL flutter::canApplyBlurBackdrop = YES

Definition at line 80 of file FlutterPlatformViews.mm.

◆ compilation

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader flutter::compilation

Definition at line 180 of file switches.h.

◆ counts

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core flutter::counts

Definition at line 239 of file switches.h.

◆ dart

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via flutter::dart

Definition at line 215 of file switches.h.

◆ dart_plugin_registrant_library_override

const char * flutter::dart_plugin_registrant_library_override = nullptr

The name of the library where the Dart Plugin Registrant will be looked for. This is available for testing.

Definition at line 16 of file dart_plugin_registrant.cc.

◆ data

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot flutter::data

Definition at line 41 of file switches.h.

◆ default

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By flutter::default

Definition at line 183 of file switches.h.

◆ dir

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets flutter::dir

Definition at line 145 of file switches.h.

◆ example

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For flutter::example

Definition at line 128 of file switches.h.

◆ fallback

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port flutter::fallback

Definition at line 154 of file switches.h.

◆ file

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank trace to flutter::file

Definition at line 201 of file switches.h.

◆ flow_type [1/2]

const auto* flutter::flow_type = "RasterCacheFlow::DisplayList"
static

Definition at line 144 of file display_list_raster_cache_item.cc.

◆ flow_type [2/2]

const auto* flutter::flow_type = "RasterCacheFlow::Layer"
static

Definition at line 140 of file layer_raster_cache_item.cc.

◆ fonts

it will be possible to load the file into Perfetto s trace viewer disable asset flutter::fonts

Definition at line 213 of file switches.h.

◆ forever

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run flutter::forever

Definition at line 227 of file switches.h.

◆ format

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent Remove all existing persistent cache This is mainly for debugging purposes such as reproducing the shader compilation jank trace to Write the timeline trace to a file at the specified path The file will be in Perfetto s proto flutter::format

Definition at line 203 of file switches.h.

◆ g_acquire_latest_image_method

jmethodID flutter::g_acquire_latest_image_method = nullptr
static

Definition at line 121 of file platform_view_android_jni_impl.cc.

◆ g_async_wait_for_vsync_method_

jmethodID flutter::g_async_wait_for_vsync_method_ = nullptr
static

Definition at line 21 of file vsync_waiter_android.cc.

◆ g_attach_to_gl_context_method

jmethodID flutter::g_attach_to_gl_context_method = nullptr
static

Definition at line 111 of file platform_view_android_jni_impl.cc.

◆ g_bitmap_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_bitmap_class = nullptr
static

Definition at line 62 of file platform_view_android_jni_impl.cc.

◆ g_bitmap_config_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_bitmap_config_class = nullptr
static

Definition at line 64 of file platform_view_android_jni_impl.cc.

◆ g_bitmap_config_value_of

jmethodID flutter::g_bitmap_config_value_of = nullptr
static

Definition at line 148 of file platform_view_android_jni_impl.cc.

◆ g_bitmap_copy_pixels_from_buffer_method

jmethodID flutter::g_bitmap_copy_pixels_from_buffer_method = nullptr
static

Definition at line 146 of file platform_view_android_jni_impl.cc.

◆ g_bitmap_create_bitmap_method

jmethodID flutter::g_bitmap_create_bitmap_method = nullptr
static

Definition at line 144 of file platform_view_android_jni_impl.cc.

◆ g_compute_platform_resolved_locale_method

jmethodID flutter::g_compute_platform_resolved_locale_method = nullptr
static

Definition at line 129 of file platform_view_android_jni_impl.cc.

◆ g_create_overlay_surface_method

jmethodID flutter::g_create_overlay_surface_method = nullptr
static

Definition at line 101 of file platform_view_android_jni_impl.cc.

◆ g_decode_image_method

jmethodID flutter::g_decode_image_method = nullptr
static

Definition at line 20 of file android_image_generator.cc.

◆ g_destroy_overlay_surfaces_method

jmethodID flutter::g_destroy_overlay_surfaces_method = nullptr
static

Definition at line 103 of file platform_view_android_jni_impl.cc.

◆ g_detach_from_gl_context_method

jmethodID flutter::g_detach_from_gl_context_method = nullptr
static

Definition at line 119 of file platform_view_android_jni_impl.cc.

◆ g_flutter_callback_info_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_callback_info_class
static
Initial value:
=
nullptr

Definition at line 43 of file platform_view_android_jni_impl.cc.

◆ g_flutter_callback_info_constructor

jmethodID flutter::g_flutter_callback_info_constructor = nullptr
static

Definition at line 68 of file platform_view_android_jni_impl.cc.

◆ g_flutter_jni_class [1/2]

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_jni_class = nullptr
static

Definition at line 19 of file android_image_generator.cc.

◆ g_flutter_jni_class [2/2]

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_jni_class = nullptr
static

Definition at line 46 of file platform_view_android_jni_impl.cc.

◆ g_flutter_main

std::unique_ptr<FlutterMain> flutter::g_flutter_main
static

Definition at line 56 of file flutter_main.cc.

◆ g_get_scaled_font_size_method

jmethodID flutter::g_get_scaled_font_size_method = nullptr
static

Definition at line 95 of file platform_view_android_jni_impl.cc.

◆ g_get_transform_matrix_method

jmethodID flutter::g_get_transform_matrix_method = nullptr
static

Definition at line 117 of file platform_view_android_jni_impl.cc.

◆ g_handle_platform_message_method

jmethodID flutter::g_handle_platform_message_method = nullptr
static

Definition at line 87 of file platform_view_android_jni_impl.cc.

◆ g_handle_platform_message_response_method

jmethodID flutter::g_handle_platform_message_response_method = nullptr
static

Definition at line 89 of file platform_view_android_jni_impl.cc.

◆ g_hardware_buffer_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_hardware_buffer_class = nullptr
static

Definition at line 58 of file platform_view_android_jni_impl.cc.

◆ g_hardware_buffer_close_method

jmethodID flutter::g_hardware_buffer_close_method = nullptr
static

Definition at line 127 of file platform_view_android_jni_impl.cc.

◆ g_image_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_image_class = nullptr
static

Definition at line 56 of file platform_view_android_jni_impl.cc.

◆ g_image_close_method

jmethodID flutter::g_image_close_method = nullptr
static

Definition at line 125 of file platform_view_android_jni_impl.cc.

◆ g_image_consumer_texture_registry_interface

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_image_consumer_texture_registry_interface = nullptr
static

Definition at line 54 of file platform_view_android_jni_impl.cc.

◆ g_image_get_hardware_buffer_method

jmethodID flutter::g_image_get_hardware_buffer_method = nullptr
static

Definition at line 123 of file platform_view_android_jni_impl.cc.

◆ g_java_long_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_java_long_class = nullptr
static

Definition at line 60 of file platform_view_android_jni_impl.cc.

◆ g_java_weak_reference_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_java_weak_reference_class
static
Initial value:
=
nullptr

Definition at line 48 of file platform_view_android_jni_impl.cc.

◆ g_java_weak_reference_get_method

jmethodID flutter::g_java_weak_reference_get_method = nullptr
static

Definition at line 109 of file platform_view_android_jni_impl.cc.

◆ g_jni_constructor

jmethodID flutter::g_jni_constructor = nullptr
static

Definition at line 83 of file platform_view_android_jni_impl.cc.

◆ g_jni_shell_holder_field

jfieldID flutter::g_jni_shell_holder_field = nullptr
static

Definition at line 81 of file platform_view_android_jni_impl.cc.

◆ g_long_constructor

jmethodID flutter::g_long_constructor = nullptr
static

Definition at line 85 of file platform_view_android_jni_impl.cc.

◆ g_mutators_stack_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_mutators_stack_class = nullptr
static

Definition at line 151 of file platform_view_android_jni_impl.cc.

◆ g_mutators_stack_init_method

jmethodID flutter::g_mutators_stack_init_method = nullptr
static

Definition at line 152 of file platform_view_android_jni_impl.cc.

◆ g_mutators_stack_push_cliprect_method

jmethodID flutter::g_mutators_stack_push_cliprect_method = nullptr
static

Definition at line 154 of file platform_view_android_jni_impl.cc.

◆ g_mutators_stack_push_cliprrect_method

jmethodID flutter::g_mutators_stack_push_cliprrect_method = nullptr
static

Definition at line 155 of file platform_view_android_jni_impl.cc.

◆ g_mutators_stack_push_transform_method

jmethodID flutter::g_mutators_stack_push_transform_method = nullptr
static

Definition at line 153 of file platform_view_android_jni_impl.cc.

◆ g_on_begin_frame_method

jmethodID flutter::g_on_begin_frame_method = nullptr
static

Definition at line 105 of file platform_view_android_jni_impl.cc.

◆ g_on_display_overlay_surface_method

jmethodID flutter::g_on_display_overlay_surface_method = nullptr
static

Definition at line 138 of file platform_view_android_jni_impl.cc.

◆ g_on_display_platform_view_method

jmethodID flutter::g_on_display_platform_view_method = nullptr
static

Definition at line 134 of file platform_view_android_jni_impl.cc.

◆ g_on_end_frame_method

jmethodID flutter::g_on_end_frame_method = nullptr
static

Definition at line 107 of file platform_view_android_jni_impl.cc.

◆ g_on_engine_restart_method

jmethodID flutter::g_on_engine_restart_method = nullptr
static

Definition at line 99 of file platform_view_android_jni_impl.cc.

◆ g_on_first_frame_method

jmethodID flutter::g_on_first_frame_method = nullptr
static

Definition at line 97 of file platform_view_android_jni_impl.cc.

◆ g_overlay_surface_id_method

jmethodID flutter::g_overlay_surface_id_method = nullptr
static

Definition at line 140 of file platform_view_android_jni_impl.cc.

◆ g_overlay_surface_surface_method

jmethodID flutter::g_overlay_surface_surface_method = nullptr
static

Definition at line 142 of file platform_view_android_jni_impl.cc.

◆ g_refresh_rate_

std::atomic_uint flutter::g_refresh_rate_ = 60
static

Definition at line 22 of file vsync_waiter_android.cc.

◆ g_request_dart_deferred_library_method

jmethodID flutter::g_request_dart_deferred_library_method = nullptr
static

Definition at line 131 of file platform_view_android_jni_impl.cc.

◆ g_shell

absl::NoDestructor<std::unique_ptr<Shell> > flutter::g_shell
static

Definition at line 127 of file tester_main.cc.

◆ g_surface_texture_wrapper_should_update

jmethodID flutter::g_surface_texture_wrapper_should_update = nullptr
static

Definition at line 113 of file platform_view_android_jni_impl.cc.

◆ g_texture_wrapper_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_texture_wrapper_class = nullptr
static

Definition at line 51 of file platform_view_android_jni_impl.cc.

◆ g_update_custom_accessibility_actions_method

jmethodID flutter::g_update_custom_accessibility_actions_method = nullptr
static

Definition at line 93 of file platform_view_android_jni_impl.cc.

◆ g_update_semantics_method

jmethodID flutter::g_update_semantics_method = nullptr
static

Definition at line 91 of file platform_view_android_jni_impl.cc.

◆ g_update_tex_image_method

jmethodID flutter::g_update_tex_image_method = nullptr
static

Definition at line 115 of file platform_view_android_jni_impl.cc.

◆ g_vsync_waiter_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_vsync_waiter_class = nullptr
static

Definition at line 20 of file vsync_waiter_android.cc.

◆ gc

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial flutter::gc

Definition at line 238 of file switches.h.

◆ gFontFile

std::string flutter::gFontFile
static

Definition at line 10 of file flow_test_utils.cc.

◆ gGoldenDir

std::string flutter::gGoldenDir
static

Definition at line 9 of file flow_test_utils.cc.

◆ gVM

std::weak_ptr<DartVM> flutter::gVM
static

Definition at line 16 of file dart_vm_lifecycle.cc.

◆ gVMData

std::weak_ptr<const DartVMData> flutter::gVMData
static

Definition at line 25 of file dart_vm_lifecycle.cc.

◆ gVMDependentsMutex

std::mutex flutter::gVMDependentsMutex
static

Definition at line 24 of file dart_vm_lifecycle.cc.

◆ gVMIsolateNameServer

std::weak_ptr<IsolateNameServer> flutter::gVMIsolateNameServer
static

Definition at line 27 of file dart_vm_lifecycle.cc.

◆ gVMLaunchCount

std::atomic_size_t flutter::gVMLaunchCount
static

Definition at line 279 of file dart_vm.cc.

◆ gVMLeak

std::shared_ptr<DartVM>* flutter::gVMLeak
static

Definition at line 17 of file dart_vm_lifecycle.cc.

◆ gVMMutex

std::mutex flutter::gVMMutex
static

Definition at line 15 of file dart_vm_lifecycle.cc.

◆ gVMServiceProtocol

std::weak_ptr<ServiceProtocol> flutter::gVMServiceProtocol
static

Definition at line 26 of file dart_vm_lifecycle.cc.

◆ h

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder flutter::h

Definition at line 59 of file switches.h.

◆ host

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service flutter::host

Definition at line 74 of file switches.h.

◆ impeller

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable flutter::impeller

Definition at line 266 of file switches.h.

◆ ipv6

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication flutter::ipv6

Definition at line 118 of file switches.h.

◆ kAccessibilityExpandedChanged

NSString* const flutter::kAccessibilityExpandedChanged = @"@"AXExpandedChanged"
static

Definition at line 20 of file AccessibilityBridgeMac.mm.

◆ kAccessibilityInvalidStatusChangedNotification

NSString* const flutter::kAccessibilityInvalidStatusChangedNotification = @"@"AXInvalidStatusChanged"
static

Definition at line 17 of file AccessibilityBridgeMac.mm.

◆ kAccessibilityLiveRegionChangedNotification

NSString* const flutter::kAccessibilityLiveRegionChangedNotification = @"@"AXLiveRegionChanged"
static

Definition at line 19 of file AccessibilityBridgeMac.mm.

◆ kAccessibilityLiveRegionCreatedNotification

NSString* const flutter::kAccessibilityLiveRegionCreatedNotification = @"@"AXLiveRegionCreated"
static

Definition at line 18 of file AccessibilityBridgeMac.mm.

◆ kAccessibilityLoadCompleteNotification

NSString* const flutter::kAccessibilityLoadCompleteNotification = @"@"AXLoadComplete"
static

Definition at line 16 of file AccessibilityBridgeMac.mm.

◆ kAccessibilityMenuItemSelectedNotification

NSString* const flutter::kAccessibilityMenuItemSelectedNotification = @"@"AXMenuItemSelected"
static

Definition at line 21 of file AccessibilityBridgeMac.mm.

◆ kAssetChannel

constexpr char flutter::kAssetChannel[] = "flutter/assets"
staticconstexpr

Definition at line 27 of file engine.cc.

◆ kBinarySearchThreshold

const int flutter::kBinarySearchThreshold = 10

Definition at line 13 of file dl_region.cc.

◆ kBlendModeDefault

constexpr uint32_t flutter::kBlendModeDefault
constexpr
Initial value:
=
static_cast<uint32_t>(SkBlendMode::kSrcOver)
@ kSrcOver
r = s + (1-sa)*d

Definition at line 51 of file paint.cc.

◆ kBlendModeIndex

constexpr int flutter::kBlendModeIndex = 2
constexpr

Definition at line 26 of file paint.cc.

◆ kBytesPerField

constexpr int flutter::kBytesPerField = sizeof(int64_t)
staticconstexpr

Definition at line 20 of file pointer_data.cc.

◆ kBytesPerKeyField

constexpr int flutter::kBytesPerKeyField = sizeof(int64_t)
staticconstexpr

Definition at line 17 of file key_data.h.

◆ kCacheName

const char* flutter::kCacheName = "flutter_callback_cache.json"
static

Definition at line 30 of file callback_cache.cc.

◆ kCapsLockLogicalKey

const uint64_t flutter::kCapsLockLogicalKey = 0x100000104

The logical key for CapsLock, which needs special handling.

Definition at line 246 of file KeyCodeMap.g.mm.

◆ kCapsLockPhysicalKey

const uint64_t flutter::kCapsLockPhysicalKey = 0x00070039

The physical key for CapsLock, which needs special handling.

Definition at line 245 of file KeyCodeMap.g.mm.

◆ kClassNameKey

const char* flutter::kClassNameKey = "class_name"
static

Definition at line 28 of file callback_cache.cc.

◆ kColorDefault

constexpr uint32_t flutter::kColorDefault = 0xFF000000
constexpr

Definition at line 48 of file paint.cc.

◆ kColorFilterIndex

constexpr int flutter::kColorFilterIndex = 1
constexpr

Definition at line 43 of file paint.cc.

◆ kColorIndex

constexpr int flutter::kColorIndex = 1
constexpr

Definition at line 25 of file paint.cc.

◆ kControl

constexpr int flutter::kControl = 1 << 3
constexpr

Definition at line 15 of file keyboard_utils.h.

◆ kDartAllConfigsArgs

const char* flutter::kDartAllConfigsArgs[]
static
Initial value:
= {
"--enable_mirrors=false",
"--background_compilation",
}

Definition at line 53 of file dart_vm.cc.

◆ kDartAssertArgs

const char* flutter::kDartAssertArgs[]
static
Initial value:
= {
"--enable_asserts",
}

Definition at line 84 of file dart_vm.cc.

◆ kDartDefaultTraceStreamsArgs

FML_ALLOW_UNUSED_TYPE const char* flutter::kDartDefaultTraceStreamsArgs[]
static
Initial value:
{
"--timeline_streams=Dart,Embedder,GC",
}

Definition at line 109 of file dart_vm.cc.

◆ kDartDisableIntegerDivisionArgs

FML_ALLOW_UNUSED_TYPE const char* flutter::kDartDisableIntegerDivisionArgs[]
static
Initial value:
= {
"--no_use_integer_division",
}

Definition at line 80 of file dart_vm.cc.

◆ kDartEndlessTraceBufferArgs

const char* flutter::kDartEndlessTraceBufferArgs[]
static
Initial value:
{
"--timeline_recorder=endless",
}

Definition at line 94 of file dart_vm.cc.

◆ kDartPrecompilationArgs

const char* flutter::kDartPrecompilationArgs[] = {"--precompilation"}
static

Definition at line 62 of file dart_vm.cc.

◆ kDartStartPausedArgs

const char* flutter::kDartStartPausedArgs[]
static
Initial value:
{
"--pause_isolates_on_start",
}

Definition at line 90 of file dart_vm.cc.

◆ kDartStartupTraceStreamsArgs

const char* flutter::kDartStartupTraceStreamsArgs[]
static
Initial value:
{
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM,API",
}

Definition at line 113 of file dart_vm.cc.

◆ kDartSystraceTraceBufferArgs

const char* flutter::kDartSystraceTraceBufferArgs[]
static
Initial value:
= {
"--timeline_recorder=systrace",
}

Definition at line 98 of file dart_vm.cc.

◆ kDartSystraceTraceStreamsArgs

const char* flutter::kDartSystraceTraceStreamsArgs[]
static
Initial value:
= {
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM,API",
}

Definition at line 117 of file dart_vm.cc.

◆ kDartWrapperInfoUIImage

const tonic::DartWrapperInfo flutter::kDartWrapperInfoUIImage("ui", "_Image") ( "ui"  ,
"_Image"   
)
static

◆ kDartWriteProtectCodeArgs

FML_ALLOW_UNUSED_TYPE const char* flutter::kDartWriteProtectCodeArgs[]
static
Initial value:
= {
"--no_write_protect_code",
}

Definition at line 75 of file dart_vm.cc.

◆ kDataByteCount

constexpr size_t flutter::kDataByteCount = 52
constexpr

Definition at line 37 of file paint.cc.

◆ kDeadKeyCharMask

constexpr int flutter::kDeadKeyCharMask = 0x80000000
constexpr

Definition at line 30 of file keyboard_utils.h.

◆ kDisplayEngineStatistics

const int flutter::kDisplayEngineStatistics = 1 << 2

Definition at line 20 of file performance_overlay_layer.h.

◆ kDisplayRasterizerStatistics

const int flutter::kDisplayRasterizerStatistics = 1 << 0

Definition at line 18 of file performance_overlay_layer.h.

◆ kEmpty [1/2]

constexpr DlRect flutter::kEmpty = DlRect()
staticconstexpr

Definition at line 117 of file dl_builder.cc.

◆ kEmpty [2/2]

constexpr DlRect flutter::kEmpty = DlRect()
staticconstexpr

Definition at line 21 of file dl_matrix_clip_tracker.cc.

◆ kExitTypeNames

constexpr const char* flutter::kExitTypeNames[]
staticconstexpr

◆ keyCodeToLogicalKey

const NSDictionary * flutter::keyCodeToLogicalKey

A map from macOS key codes to Flutter's logical key values.

This is used to derive logical keys that can't or shouldn't be derived from |charactersIgnoringModifiers|.

Definition at line 149 of file KeyCodeMap.g.mm.

◆ keyCodeToModifierFlag

const NSDictionary * flutter::keyCodeToModifierFlag
Initial value:
= @{
@0x00000038 : @(kModifierFlagShiftLeft),
@0x0000003c : @(kModifierFlagShiftRight),
@0x0000003b : @(kModifierFlagControlLeft),
@0x0000003e : @(kModifierFlagControlRight),
@0x0000003a : @(kModifierFlagAltLeft),
@0x0000003d : @(kModifierFlagAltRight),
@0x00000037 : @(kModifierFlagMetaLeft),
@0x00000036 : @(kModifierFlagMetaRight),
}

Map |NSEvent.keyCode| to its corresponding bitmask of NSEventModifierFlags.

This does not include CapsLock, for it is handled specially.

Definition at line 223 of file KeyCodeMap.g.mm.

◆ keyCodeToPhysicalKey

const NSDictionary * flutter::keyCodeToPhysicalKey

Maps macOS-specific key code values representing |PhysicalKeyboardKey|.

MacOS doesn't provide a scan code, but a virtual keycode to represent a physical key.

Definition at line 26 of file KeyCodeMap.g.mm.

◆ kFileUriPrefix

constexpr char flutter::kFileUriPrefix[] = "file://"
constexpr

Definition at line 127 of file dart_vm.cc.

◆ kFileUriPrefixLength

constexpr size_t flutter::kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1
constexpr

Definition at line 128 of file dart_vm.cc.

◆ kFilterQualities

const std::array<DlImageSampling, 4> flutter::kFilterQualities
static
Initial value:
= {
DlImageSampling::kNearestNeighbor,
DlImageSampling::kMipmapLinear,
DlImageSampling::kCubic,
}

Definition at line 25 of file image_filter.cc.

◆ kFilterQualityIndex

constexpr int flutter::kFilterQualityIndex = 8
constexpr

Definition at line 32 of file paint.cc.

◆ kFlutterImplicitViewId

constexpr int64_t flutter::kFlutterImplicitViewId = 0
constexpr

Definition at line 35 of file constants.h.

◆ kFlutterThreadName

constexpr const char* flutter::kFlutterThreadName = "io.flutter"
constexpr

Definition at line 113 of file embedder_thread_host.cc.

◆ kFontChange

constexpr char flutter::kFontChange[] = "fontsChange"
constexpr

Definition at line 51 of file shell.cc.

◆ kGetPreferredLanguageRegKey

constexpr const wchar_t flutter::kGetPreferredLanguageRegKey[]
constexpr
Initial value:
=
L"Control panel\\International\\User Profile"

Definition at line 18 of file system_utils.h.

◆ kGetPreferredLanguageRegValue

constexpr const wchar_t flutter::kGetPreferredLanguageRegValue[] = L"Languages"
constexpr

Definition at line 20 of file system_utils.h.

◆ kGiantRect

constexpr SkRect flutter::kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F)
staticconstexpr

Definition at line 50 of file layer.h.

◆ kGrCacheMaxByteSize

const size_t flutter::kGrCacheMaxByteSize = 24 * (1 << 20)
static

Definition at line 41 of file gpu_surface_gl_skia.cc.

◆ kHandleKey

const char* flutter::kHandleKey = "handle"
static

Definition at line 25 of file callback_cache.cc.

◆ kHasScrollingAction

constexpr int flutter::kHasScrollingAction
constexpr

◆ kHorizontalScrollSemanticsActions

const int flutter::kHorizontalScrollSemanticsActions
Initial value:
=
static_cast<int32_t>(SemanticsAction::kScrollLeft) |
static_cast<int32_t>(SemanticsAction::kScrollRight)

Definition at line 52 of file semantics_node.h.

◆ kImageFilterIndex

constexpr int flutter::kImageFilterIndex = 2
constexpr

Definition at line 44 of file paint.cc.

◆ kImageReaderSwapchainSize

constexpr size_t flutter::kImageReaderSwapchainSize = 6u
staticconstexpr

Definition at line 20 of file image_lru.h.

◆ kImpellerRepaintRatio

constexpr float flutter::kImpellerRepaintRatio = 0.7f
constexpr

The max ratio of pixel width or height to size that is dirty which results in a partial repaint.

Performing a partial repaint has a small overhead - Impeller needs to allocate a fairly large resolve texture for the root pass instead of using the drawable texture, and a final blit must be performed. At a minimum, if the damage rect is the entire buffer, we must not perform a partial repaint. Beyond that, we could only experimentally determine what this value should be. From looking at the Flutter Gallery, we noticed that there are occassionally small partial repaints which shave off trivial numbers of pixels.

Definition at line 208 of file compositor_context.cc.

◆ kImplicitViewId

static constexpr int64_t flutter::kImplicitViewId = 0
constexpr

Definition at line 55 of file flutter_windows_engine.h.

◆ kInvertColorIndex

constexpr int flutter::kInvertColorIndex = 12
constexpr

Definition at line 36 of file paint.cc.

◆ kInvertColorMatrix

constexpr float flutter::kInvertColorMatrix
constexpr
Initial value:
= {
-1.0, 0, 0, 1.0, 0,
0, -1.0, 0, 1.0, 0,
0, 0, -1.0, 1.0, 0,
1.0, 1.0, 1.0, 1.0, 0
}

Definition at line 14 of file dl_sk_conversions.cc.

◆ kIsAntiAliasIndex

constexpr int flutter::kIsAntiAliasIndex = 0
constexpr

Definition at line 24 of file paint.cc.

◆ kIsolateChannel

constexpr char flutter::kIsolateChannel[] = "flutter/isolate"
staticconstexpr

Definition at line 32 of file engine.cc.

◆ kKeyCodeControlLeft

constexpr int flutter::kKeyCodeControlLeft = 0xa2
constexpr

Definition at line 21 of file keyboard_utils.h.

◆ kKeyCodeShiftLeft

constexpr int flutter::kKeyCodeShiftLeft = 0xa0
constexpr

Definition at line 18 of file keyboard_utils.h.

◆ kKeyDataFieldCount

constexpr int flutter::kKeyDataFieldCount = 6
staticconstexpr

Definition at line 16 of file key_data.h.

◆ kLayoutGoals

const std::vector< LayoutGoal > flutter::kLayoutGoals

All keys that Flutter wants to derive layout for, and guides on how to derive them.

Definition at line 248 of file KeyCodeMap.g.mm.

◆ kLibraryPathKey

const char* flutter::kLibraryPathKey = "library_path"
static

Definition at line 29 of file callback_cache.cc.

◆ kLifecycleChannel

constexpr char flutter::kLifecycleChannel[] = "flutter/lifecycle"
staticconstexpr

Definition at line 28 of file engine.cc.

◆ kListViewsExtensionName

constexpr std::string_view flutter::kListViewsExtensionName
staticconstexpr
Initial value:
=
"_flutter.listViews"

Definition at line 47 of file service_protocol.cc.

◆ kLocalizationChannel

constexpr char flutter::kLocalizationChannel[] = "flutter/localization"
staticconstexpr

Definition at line 30 of file engine.cc.

◆ kMacosPlane

const uint64_t flutter::kMacosPlane = 0x01400000000

The plane value for the private keys defined by the macOS embedding.

Definition at line 24 of file KeyCodeMap.g.mm.

◆ kMaskFilterBlurStyleIndex

constexpr int flutter::kMaskFilterBlurStyleIndex = 10
constexpr

Definition at line 34 of file paint.cc.

◆ kMaskFilterIndex

constexpr int flutter::kMaskFilterIndex = 9
constexpr

Definition at line 33 of file paint.cc.

◆ kMaskFilterSigmaIndex

constexpr int flutter::kMaskFilterSigmaIndex = 11
constexpr

Definition at line 35 of file paint.cc.

◆ kMaxCount

constexpr size_t flutter::kMaxCount = 4
staticconstexpr

Definition at line 287 of file dart_vm.cc.

◆ kMaxFrameMarkers [1/2]

const size_t flutter::kMaxFrameMarkers = 8
static

Definition at line 18 of file stopwatch_dl.cc.

◆ kMaxFrameMarkers [2/2]

const size_t flutter::kMaxFrameMarkers = 8
static

Definition at line 16 of file stopwatch_sk.cc.

◆ kMaxSamples [1/3]

const size_t flutter::kMaxSamples = 120
static

Definition at line 9 of file stopwatch.cc.

◆ kMaxSamples [2/3]

const size_t flutter::kMaxSamples = 120
static

Definition at line 17 of file stopwatch_dl.cc.

◆ kMaxSamples [3/3]

const size_t flutter::kMaxSamples = 120
static

Definition at line 15 of file stopwatch_sk.cc.

◆ kMegaByteSizeInBytes

constexpr double flutter::kMegaByteSizeInBytes = (1 << 20)
constexpr

Definition at line 9 of file constants.h.

◆ kMinCount

constexpr size_t flutter::kMinCount = 2
staticconstexpr

Definition at line 286 of file dart_vm.cc.

◆ kMinimumAndroidApiLevelForVulkan

constexpr int flutter::kMinimumAndroidApiLevelForVulkan = 29
constexpr

Definition at line 35 of file flutter_main.cc.

◆ kMinPlatformViewId

constexpr int32_t flutter::kMinPlatformViewId = -1
constexpr

Definition at line 11 of file semantics_node.cc.

◆ kNameKey

const char* flutter::kNameKey = "name"
static

Definition at line 27 of file callback_cache.cc.

◆ kNavigationChannel

constexpr char flutter::kNavigationChannel[] = "flutter/navigation"
staticconstexpr

Definition at line 29 of file engine.cc.

◆ kObjectCount

constexpr int flutter::kObjectCount = 3
constexpr

Definition at line 45 of file paint.cc.

◆ kOpaqueBlack

constexpr int flutter::kOpaqueBlack = 0xff000000
constexpr

Definition at line 12 of file compositor_software.cc.

◆ kOrientationUpdateNotificationKey

const char *const flutter::kOrientationUpdateNotificationKey
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOrientationNotificationKey"

Definition at line 34 of file FlutterPlatformPlugin.mm.

◆ kOrientationUpdateNotificationName

const char *const flutter::kOrientationUpdateNotificationName
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOrientationNotificationName"

Definition at line 32 of file FlutterPlatformPlugin.mm.

◆ kOverlayStyleUpdateNotificationKey

const char *const flutter::kOverlayStyleUpdateNotificationKey
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOverlayNotificationKey"

Definition at line 38 of file FlutterPlatformPlugin.mm.

◆ kOverlayStyleUpdateNotificationName

const char *const flutter::kOverlayStyleUpdateNotificationName
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOverlayNotificationName"

Definition at line 36 of file FlutterPlatformPlugin.mm.

◆ kPlatformStrongDill

const uint8_t flutter::kPlatformStrongDill[]
extern

◆ kPlatformStrongDillSize

const intptr_t flutter::kPlatformStrongDillSize
extern

◆ kPointerDataFieldCount

constexpr int flutter::kPointerDataFieldCount = 36
staticconstexpr

Definition at line 19 of file pointer_data.cc.

◆ kRepresentationKey

const char* flutter::kRepresentationKey = "representation"
static

Definition at line 26 of file callback_cache.cc.

◆ kRootViewIdentifier

const auto flutter::kRootViewIdentifier = EmbedderExternalView::ViewIdentifier{}
static

Definition at line 17 of file embedder_external_view_embedder.cc.

◆ kScanCodeControlLeft

constexpr int flutter::kScanCodeControlLeft = 0x1d
constexpr

Definition at line 19 of file keyboard_utils.h.

◆ kScanCodeControlRight

constexpr int flutter::kScanCodeControlRight = 0xe01d
constexpr

Definition at line 20 of file keyboard_utils.h.

◆ kScanCodeShiftLeft

constexpr int flutter::kScanCodeShiftLeft = 0x2a
constexpr

Definition at line 16 of file keyboard_utils.h.

◆ kScanCodeShiftRight

constexpr int flutter::kScanCodeShiftRight = 0x36
constexpr

Definition at line 17 of file keyboard_utils.h.

◆ kScrollableSemanticsActions

const int flutter::kScrollableSemanticsActions
Initial value:

Definition at line 56 of file semantics_node.h.

◆ kScrollableSemanticsFlags

const int flutter::kScrollableSemanticsFlags
Initial value:
=
static_cast<int32_t>(SemanticsFlags::kHasImplicitScrolling)

Definition at line 96 of file semantics_node.h.

◆ kSerialGCArgs

const char* flutter::kSerialGCArgs[]
static
Initial value:
= {
"--concurrent_mark=false",
"--concurrent_sweep=false",
"--compactor_tasks=1",
"--scavenger_tasks=0",
"--marker_tasks=0",
}

Definition at line 64 of file dart_vm.cc.

◆ kSettingsChannel

constexpr char flutter::kSettingsChannel[] = "flutter/settings"
staticconstexpr

Definition at line 31 of file engine.cc.

◆ kShaderIndex

constexpr int flutter::kShaderIndex = 0
constexpr

Definition at line 42 of file paint.cc.

◆ kShift

constexpr int flutter::kShift = 1 << 0
constexpr

Definition at line 14 of file keyboard_utils.h.

◆ kSizeFactorSmall

const double flutter::kSizeFactorSmall = 0.3

Definition at line 316 of file dl_region_benchmarks.cc.

◆ kSkiaChannel

constexpr char flutter::kSkiaChannel[] = "flutter/skia"
constexpr

Definition at line 48 of file shell.cc.

◆ kSkMatrixIndexToMatrix4Index

const int flutter::kSkMatrixIndexToMatrix4Index[]
static
Initial value:
= {
0, 4, 12,
1, 5, 13,
3, 7, 15,
}

Definition at line 13 of file matrix.cc.

◆ kStderrStreamId

const char flutter::kStderrStreamId[] = "Stderr"
static

Definition at line 184 of file dart_vm.cc.

◆ kStdoutStreamId

const char flutter::kStdoutStreamId[] = "Stdout"
static

Definition at line 183 of file dart_vm.cc.

◆ kStrokeCapIndex

constexpr int flutter::kStrokeCapIndex = 5
constexpr

Definition at line 29 of file paint.cc.

◆ kStrokeJoinIndex

constexpr int flutter::kStrokeJoinIndex = 6
constexpr

Definition at line 30 of file paint.cc.

◆ kStrokeMiterLimitDefault

constexpr float flutter::kStrokeMiterLimitDefault = 4.0f
constexpr

Definition at line 56 of file paint.cc.

◆ kStrokeMiterLimitIndex

constexpr int flutter::kStrokeMiterLimitIndex = 7
constexpr

Definition at line 31 of file paint.cc.

◆ kStrokeWidthIndex

constexpr int flutter::kStrokeWidthIndex = 4
constexpr

Definition at line 28 of file paint.cc.

◆ kStyleIndex

constexpr int flutter::kStyleIndex = 3
constexpr

Definition at line 27 of file paint.cc.

◆ kSystemChannel

constexpr char flutter::kSystemChannel[] = "flutter/system"
constexpr

Definition at line 49 of file shell.cc.

◆ kTypeKey

constexpr char flutter::kTypeKey[] = "type"
constexpr

Definition at line 50 of file shell.cc.

◆ kUnicodePlane

const uint64_t flutter::kUnicodePlane = 0x00000000000

The plane value for keys which have a Unicode representation.

Definition at line 23 of file KeyCodeMap.g.mm.

◆ kUnknownDisplayRefreshRate

constexpr double flutter::kUnknownDisplayRefreshRate = 0
staticconstexpr

To be used when the display refresh rate is unknown.

Definition at line 20 of file display.h.

◆ kValueMask

const uint64_t flutter::kValueMask = 0x000ffffffff

Mask for the 32-bit value portion of the key code.

Definition at line 22 of file KeyCodeMap.g.mm.

◆ kVerticalScrollSemanticsActions

const int flutter::kVerticalScrollSemanticsActions
Initial value:
=
static_cast<int32_t>(SemanticsAction::kScrollUp) |
static_cast<int32_t>(SemanticsAction::kScrollDown)

Definition at line 48 of file semantics_node.h.

◆ kViewIdPrefx

constexpr std::string_view flutter::kViewIdPrefx = "_flutterView/"
staticconstexpr

Definition at line 46 of file service_protocol.cc.

◆ kVisualizeEngineStatistics

const int flutter::kVisualizeEngineStatistics = 1 << 3

Definition at line 21 of file performance_overlay_layer.h.

◆ kVisualizeRasterizerStatistics

const int flutter::kVisualizeRasterizerStatistics = 1 << 1

Definition at line 19 of file performance_overlay_layer.h.

◆ kVsyncFlowName

constexpr const char* flutter::kVsyncFlowName = "VsyncFlow"
staticconstexpr

Definition at line 17 of file vsync_waiter.cc.

◆ kVsyncTraceName

constexpr const char* flutter::kVsyncTraceName = "VsyncProcessCallback"
staticconstexpr

Definition at line 19 of file vsync_waiter.cc.

◆ manager

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font flutter::manager

Definition at line 218 of file switches.h.

◆ mode

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive flutter::mode

Definition at line 228 of file switches.h.

◆ modifierFlagToKeyCode

const NSDictionary * flutter::modifierFlagToKeyCode
Initial value:
= @{
@(kModifierFlagShiftLeft) : @0x00000038,
@(kModifierFlagShiftRight) : @0x0000003c,
@(kModifierFlagControlLeft) : @0x0000003b,
@(kModifierFlagControlRight) : @0x0000003e,
@(kModifierFlagAltLeft) : @0x0000003a,
@(kModifierFlagAltRight) : @0x0000003d,
@(kModifierFlagMetaLeft) : @0x00000037,
@(kModifierFlagMetaRight) : @0x00000036,
}

Map a bit of bitmask of NSEventModifierFlags to its corresponding |NSEvent.keyCode|.

This does not include CapsLock, for it is handled specially.

Definition at line 234 of file KeyCodeMap.g.mm.

◆ name

DEF_SWITCHES_START aot vmservice shared library flutter::name

Definition at line 32 of file switches.h.

◆ path

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib flutter::path

Definition at line 57 of file switches.h.

◆ policy

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network flutter::policy

Definition at line 248 of file switches.h.

◆ port

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service flutter::port

Definition at line 87 of file switches.h.

◆ publication

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service flutter::publication

Definition at line 110 of file switches.h.

◆ route

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however flutter::route

Definition at line 137 of file switches.h.

◆ service

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm flutter::service

Definition at line 99 of file switches.h.

◆ set

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not flutter::set

Definition at line 76 of file switches.h.

◆ size

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap flutter::size

Definition at line 259 of file switches.h.

◆ startup

DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace flutter::startup

Definition at line 162 of file switches.h.

◆ tracing

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan Enable loading Vulkan validation layers The layers must be available to the application and loadable On non Vulkan this flag does nothing enable vulkan gpu flutter::tracing

Definition at line 283 of file switches.h.

◆ validation

it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable Enable the Impeller renderer on supported platforms Ignored if Impeller is not supported on the platform enable vulkan flutter::validation

Definition at line 274 of file switches.h.