Flutter Engine
 
Loading...
Searching...
No Matches
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
 
struct  ActualWindowSize
 
class  AlertPlatformNodeDelegate
 
class  AndroidContext
 Holds state that is shared across Android surfaces. More...
 
class  AndroidContextDynamicImpeller
 An Impeller Android context that dynamically creates either an [AndroidContextGLImpeller] or an [AndroidContextVKImpeller]. More...
 
class  AndroidContextGLImpeller
 
class  AndroidContextGLSkia
 
class  AndroidContextVKImpeller
 
class  AndroidDisplay
 A |Display| that listens to refresh rate changes. More...
 
class  AndroidEGLSurface
 
class  AndroidEGLSurfaceDamage
 
class  AndroidEnvironmentGL
 
class  AndroidExternalViewEmbedder
 
class  AndroidExternalViewEmbedder2
 
class  AndroidExternalViewEmbedderWrapper
 
class  AndroidImageGenerator
 
class  AndroidNativeWindow
 
class  AndroidShellHolder
 This is the Android owner of the core engine Shell. More...
 
class  AndroidSnapshotSurfaceProducer
 
class  AndroidSurface
 
class  AndroidSurfaceDynamicImpeller
 An Impeller Android surface class that dynamically creates either an [AndroidSurfaceVKImpeller] or an [AndroidSurfaceGLImpeller]. More...
 
class  AndroidSurfaceFactory
 
class  AndroidSurfaceFactoryImpl
 
class  AndroidSurfaceGLImpeller
 
class  AndroidSurfaceGLSkia
 
class  AndroidSurfaceMock
 
class  AndroidSurfaceSoftware
 
class  AndroidSurfaceVKImpeller
 
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  BoxConstraints
 
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  ClipRSuperellipseEntry
 
class  ClipRSuperellipseLayer
 
class  ClipShapeLayer
 
class  Codec
 
class  ColorFilter
 
class  ColorFilterEntry
 
class  ColorFilterLayer
 
class  ComplexityCalculatorHelper
 
class  Compositor
 
class  CompositorContext
 
class  CompositorOpenGL
 
class  CompositorSoftware
 
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  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
 
struct  DialogWindowCreationRequest
 
class  DidDrawCanvas
 
class  DiffContext
 
class  DirectManipulationEventHandler
 
class  DirectManipulationOwner
 
class  DirectoryAssetBundle
 
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  DisplayManagerWin32
 
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  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  DlOpReceiverIgnore
 
class  DlOpSpy
 
class  DlPaint
 
class  DlPath
 
class  DlPathBuilder
 
class  DlRadialGradientColorSource
 
class  DlRegion
 
class  DlRTree
 
class  DlRuntimeEffect
 
class  DlRuntimeEffectColorSource
 
class  DlRuntimeEffectImageFilter
 
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  DlText
 
class  DlTextImpeller
 
class  DlTextSkia
 
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  DrawTextOp
 
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  EmbedderSurfaceVulkanImpeller
 
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  FlutterMain
 
class  FlutterPlatformNodeDelegate
 
class  FlutterPlatformNodeDelegateMac
 
class  FlutterPlatformNodeDelegateWindows
 
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
 
struct  FullscreenRequest
 
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  GPUSurfaceNoop
 A rendering surface that accepts rendering intent but does not render anything. More...
 
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  HostWindow
 
class  HostWindowDialog
 
class  HostWindowRegular
 
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
 External texture peered to a sequence of android.hardware.HardwareBuffers. More...
 
class  ImageExternalTextureGL
 
class  ImageExternalTextureGLImpeller
 
class  ImageExternalTextureGLSkia
 
class  ImageExternalTextureVKImpeller
 
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  IOSContextNoop
 A noop rendering context for usage on simulators without metal support. More...
 
class  IOSExternalTextureMetal
 
class  IOSExternalViewEmbedder
 
class  IOSSurface
 
class  IOSSurfaceMetalImpeller
 
class  IOSSurfaceNoop
 A rendering surface that accepts rendering intent but does not render anything. More...
 
class  Isolate
 
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  IsolateScope
 
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  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  NativeAssetsManager
 
class  NativeSemanticsFlags
 The peer class for all of the SemanticsFlags subclasses in semantics.dart. More...
 
class  NativeStringAttribute
 The peer class for all of the StringAttribute subclasses in semantics.dart. More...
 
class  OffscreenSurface
 
class  OpacityEntry
 
class  OpacityLayer
 
struct  OverlayLayer
 State holder for a Flutter overlay layer. More...
 
class  OverlayLayerPool
 Storage for Overlay layers across frames. More...
 
class  Paint
 
struct  PaintContext
 
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
 
struct  RegularWindowCreationRequest
 
class  ResourceCacheLimitCalculator
 
class  ResourceCacheLimitItem
 
struct  RestoreOp
 
class  ReusableFragmentShader
 
struct  RotateOp
 
class  RRect
 
class  RSuperellipse
 
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  SaveInfo
 
struct  SaveLayerBackdropOp
 
class  SaveLayerEntry
 
struct  SaveLayerOp
 
struct  SaveLayerOpBase
 
class  SaveLayerOptions
 
struct  SaveOp
 
struct  SaveOpBase
 
struct  ScaleOp
 
class  Scene
 
class  SceneBuilder
 
class  ScopedClipboardInterface
 
class  ScriptCompletionTaskObserver
 
struct  SemanticsFlags
 
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  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
 Instances of external textures peered to android.graphics.SurfaceTexture. More...
 
class  SurfaceTextureExternalTextureGLImpeller
 Binds the surface texture to an Impeller texture. More...
 
class  SurfaceTextureExternalTextureGLSkia
 Binds the surface texture to a Skia SkImage. More...
 
class  SurfaceTextureExternalTextureVKImpeller
 An external texture implementation for Vulkan that uses OpenGL to Vulkan texture interop to read SurfaceTexture based image data and render it into a Vulkan texture. More...
 
class  SwitchableGLContext
 
class  TaskRunner
 
class  TaskRunners
 
class  TaskRunnerWindow
 
class  TestAccessibilityBridge
 
class  TestBinaryMessenger
 
class  TestCustomValue
 
class  TesterExternalViewEmbedder
 
class  TesterGPUSurfaceSoftware
 
class  TesterPlatformView
 
struct  TextEditingDelta
 A change in the state of an input field. More...
 
class  TextInputManager
 
class  TextInputModel
 
class  TextInputPlugin
 
class  TextInputPluginModifier
 
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  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  Vertices
 
class  ViewFocusChangeRequest
 
class  ViewFocusEvent
 
class  ViewModifier
 
struct  ViewportMetrics
 
class  VsyncWaiter
 
class  VsyncWaiterAndroid
 
class  VsyncWaiterEmbedder
 
class  VsyncWaiterFallback
 A |VsyncWaiter| that will fire at 60 fps irrespective of the vsync. More...
 
class  VsyncWaiterIOS
 
class  WindowBindingHandler
 
class  WindowBindingHandlerDelegate
 
struct  WindowConstraints
 
struct  WindowFrame
 
struct  WindowingInitRequest
 
class  WindowManager
 
class  WindowProcDelegateManager
 
struct  WindowProperties
 
struct  WindowSizeRequest
 
class  WindowsLifecycleManager
 
struct  WindowsMessage
 
class  WindowsProcTable
 
class  WrappedTextureSourceVK
 

Typedefs

using TaskObserverAdd = std::function< fml::TaskQueueId(intptr_t, fml::closure)>
 
using TaskObserverRemove = std::function< void(fml::TaskQueueId, 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 DlIndex = uint32_t
 
using DlBlendMode = impeller::BlendMode
 
using Flags = DlVertices::Builder::Flags
 
using DlScalar = impeller::Scalar
 
using DlDegrees = impeller::Degrees
 
using DlRadians = impeller::Radians
 
using DlPoint = impeller::Point
 
using DlVector2 = impeller::Vector2
 
using DlVector3 = impeller::Vector3
 
using DlIPoint = impeller::IPoint32
 
using DlSize = impeller::Size
 
using DlISize = impeller::ISize32
 
using DlRect = impeller::Rect
 
using DlIRect = impeller::IRect32
 
using DlRoundRect = impeller::RoundRect
 
using DlRoundSuperellipse = impeller::RoundSuperellipse
 
using DlRoundingRadii = impeller::RoundingRadii
 
using DlMatrix = impeller::Matrix
 
using DlQuad = impeller::Quad
 
using DlRSTransform = impeller::RSTransform
 
using FillType = impeller::FillType
 
using Convexity = impeller::Convexity
 
using DlPathFillType = impeller::FillType
 
using DlPathReceiver = impeller::PathReceiver
 
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.
 
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.
 
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 >
 
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.
 

Enumerations

enum class  DisplayListOpType {
  kInvalidOp ,
  kMaxOp = kInvalidOp
}
 
enum class  DisplayListOpCategory {
  kAttribute ,
  kTransform ,
  kClip ,
  kSave ,
  kSaveLayer ,
  kRestore ,
  kRendering ,
  kSubDisplayList ,
  kInvalidCategory ,
  kMaxCategory = kInvalidCategory
}
 
enum class  DlColorSpace {
  kSRGB = 0 ,
  kExtendedSRGB = 1 ,
  kDisplayP3 = 2
}
 
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  DlClipOp {
  kDifference ,
  kIntersect
}
 
enum class  DlPointMode {
  kPoints ,
  kLines ,
  kPolygon
}
 
enum class  DlSrcRectConstraint {
  kStrict ,
  kFast
}
 
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 {
  kImage ,
  kLinearGradient ,
  kRadialGradient ,
  kConicalGradient ,
  kSweepGradient ,
  kRuntimeEffect
}
 
enum class  DlImageFilterType {
  kBlur ,
  kDilate ,
  kErode ,
  kMatrix ,
  kRuntimeEffect ,
  kColorFilter ,
  kCompose ,
  kLocalMatrix
}
 
enum class  DlMaskFilterType { kBlur }
 
enum class  DlBlurStyle {
  kNormal ,
  kSolid ,
  kOuter ,
  kInner
}
 
enum class  RasterStatus {
  kSuccess ,
  kResubmit ,
  kSkipAndRetry
}
 
enum class  MutatorType {
  kClipRect ,
  kClipRRect ,
  kClipRSE ,
  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  SemanticsTristate : int32_t {
  kNone = 0 ,
  kTrue = 1 ,
  kFalse = 2
}
 
enum class  SemanticsCheckState : int32_t {
  kNone = 0 ,
  kTrue = 1 ,
  kFalse = 2 ,
  kMixed = 3
}
 
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 ,
  kScrollToOffset = 1 << 23 ,
  kExpand = 1 << 24 ,
  kCollapse = 1 << 25
}
 
enum class  SemanticsRole : int32_t {
  kNone = 0 ,
  kTab = 1 ,
  kTabBar = 2 ,
  kTabPanel = 3 ,
  kDialog = 4 ,
  kAlertDialog = 5 ,
  kTable = 6 ,
  kCell = 7 ,
  kRow = 8 ,
  kColumnHeader = 9 ,
  kDragHandle = 10 ,
  kSpinButton = 11 ,
  kComboBox = 12 ,
  kMenuBar = 13 ,
  kMenu = 14 ,
  kMenuItem = 15 ,
  kMenuItemCheckbox = 16 ,
  kMenuItemRadio = 17 ,
  kList = 18 ,
  kListItem = 19 ,
  kForm = 20 ,
  kTooltip = 21 ,
  kLoadingSpinner = 22 ,
  kProgressBar = 23 ,
  kHotKey = 24 ,
  kRadioGroup = 25 ,
  kStatus = 26 ,
  kAlert = 27 ,
  kComplementary = 28 ,
  kContentInfo = 29 ,
  kMain = 30 ,
  kNavigation = 31 ,
  kRegion = 32
}
 
enum class  SemanticsValidationResult : int32_t {
  kNone = 0 ,
  kValid = 1 ,
  kInvalid = 2
}
 
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 ,
  kNoAnnounce = 1 << 7
}
 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  ViewFocusState : int64_t {
  kUnfocused = 0 ,
  kFocused
}
 
enum class  ViewFocusDirection : int64_t {
  kUndefined = 0 ,
  kForward ,
  kBackward
}
 
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  AndroidRenderingAPI {
  kSoftware ,
  kSkiaOpenGLES ,
  kImpellerOpenGLES ,
  kImpellerVulkan ,
  kImpellerAutoselect
}
 
enum class  LayoutUpdateMode {
  kSync ,
  kAsync
}
 
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  WindowArchetype {
  kRegular ,
  kDialog
}
 
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  GpuPreference {
  NoPreference ,
  LowPowerPreference
}
 
enum class  UIThreadPolicy {
  Default ,
  RunOnPlatformThread ,
  RunOnSeparateThread
}
 
enum class  FlutterGpuPreference {
  NoPreference ,
  LowPowerPreference
}
 
enum class  FlutterUIThreadPolicy {
  Default ,
  RunOnPlatformThread ,
  RunOnSeparateThread
}
 
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< SkData > ParseBase32 (const std::string &input)
 
sk_sp< SkData > ParseBase64 (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)
 
static void BM_DisplayListDispatchDefault (benchmark::State &state, DisplayListDispatchBenchmarkType type)
 
static void BM_DisplayListDispatchByIndexDefault (benchmark::State &state, DisplayListDispatchBenchmarkType type)
 
static void BM_DisplayListDispatchByIteratorDefault (benchmark::State &state, DisplayListDispatchBenchmarkType type)
 
static void BM_DisplayListDispatchByVectorDefault (benchmark::State &state, DisplayListDispatchBenchmarkType type)
 
static void BM_DisplayListDispatchCull (benchmark::State &state, DisplayListDispatchBenchmarkType type)
 
static void BM_DisplayListDispatchByVectorCull (benchmark::State &state, DisplayListDispatchBenchmarkType 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)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchDefault, kDefaultNoRtree, DisplayListDispatchBenchmarkType::kDefaultNoRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchDefault, kDefaultWithRtree, DisplayListDispatchBenchmarkType::kDefaultWithRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchCull, kCulledWithRtree, DisplayListDispatchBenchmarkType::kCulledWithRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchByIndexDefault, kDefaultNoRtree, DisplayListDispatchBenchmarkType::kDefaultNoRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchByIteratorDefault, kDefaultNoRtree, DisplayListDispatchBenchmarkType::kDefaultNoRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchByVectorDefault, kDefaultNoRtree, DisplayListDispatchBenchmarkType::kDefaultNoRtree) -> Unit(benchmark::kMicrosecond)
 
 BENCHMARK_CAPTURE (BM_DisplayListDispatchByVectorCull, kCulledWithRtree, DisplayListDispatchBenchmarkType::kCulledWithRtree) -> 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 void FillAllIndices (std::vector< DlIndex > &indices, DlIndex size)
 
static bool CompareOps (const DisplayListStorage &storageA, const std::vector< size_t > &offsetsA, const DisplayListStorage &storageB, const std::vector< size_t > &offsetsB)
 
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 const DlRectProtectEmpty (const DlRect &rect)
 
 DEFINE_DRAW_POINTS_OP (Points, kPoints)
 
 DEFINE_DRAW_POINTS_OP (Lines, kLines)
 
 DEFINE_DRAW_POINTS_OP (Polygon, kPolygon)
 
static constexpr bool is_power_of_two (int value)
 
static void DlVerticesDeleter (void *p)
 
static size_t bytes_needed (int vertex_count, Flags flags, int index_count)
 
static DlRect compute_bounds (const DlPoint *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 DlRect ToDlRect (const SkIRect &rect)
 
const DlIRectToDlIRect (const SkIRect &rect)
 
const DlISizeToDlISize (const SkISize &size)
 
const DlSizeToDlSize (const SkVector &vector)
 
const DlRoundRect ToDlRoundRect (const SkRRect &rrect)
 
DlMatrix ToDlMatrix (const SkMatrix &matrix)
 
DlMatrix ToDlMatrix (const SkM44 &matrix)
 
const SkPoint & ToSkPoint (const DlPoint &point)
 
const SkPoint * ToSkPoints (const DlPoint *points)
 
SkPoint * ToSkPoints (DlPoint *points)
 
const SkRect & ToSkRect (const DlRect &rect)
 
const SkIRect & ToSkIRect (const DlIRect &rect)
 
std::optional< const SkIRect > ToOptSkIRect (std::optional< const DlIRect > rect)
 
const SkRect * ToSkRect (const DlRect *rect)
 
const SkRect * ToSkRect (const std::optional< DlRect > &rect)
 
SkRect * ToSkRect (DlRect *rect)
 
const SkRect * ToSkRects (const DlRect *rects)
 
const SkIRect * ToSkIRects (const DlIRect *rects)
 
const SkSize & ToSkSize (const DlSize &size)
 
const SkISize & ToSkISize (const DlISize &size)
 
const SkVector & ToSkVector (const DlSize &size)
 
const SkRRect ToSkRRect (const DlRoundRect &round_rect)
 
const SkRRect ToApproximateSkRRect (const DlRoundSuperellipse &rse)
 
SkMatrix ToSkMatrix (const DlMatrix &matrix)
 
SkM44 ToSkM44 (const DlMatrix &matrix)
 
constexpr bool DlScalarNearlyZero (DlScalar x, DlScalar tolerance=kEhCloseEnough)
 
constexpr bool DlScalarNearlyEqual (DlScalar x, DlScalar y, DlScalar tolerance=kEhCloseEnough)
 
SkPaint ToSk (const DlPaint &paint)
 
SkPaint ToStrokedSk (const DlPaint &paint)
 
SkPaint ToNonShaderSk (const DlPaint &paint)
 
sk_sp< SkShader > ToSk (const DlColorSource *source)
 
sk_sp< SkImageFilter > ToSk (const DlImageFilter *filter)
 
sk_sp< SkColorFilter > ToSk (const DlColorFilter *filter)
 
sk_sp< SkMaskFilter > ToSk (const DlMaskFilter *filter)
 
sk_sp< SkVertices > ToSk (const std::shared_ptr< DlVertices > &vertices)
 
SkBlendMode ToSk (DlBlendMode mode)
 
SkColor4f ToSkColor4f (DlColor color)
 
SkColor ToSkColor (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 (DlSrcRectConstraint constraint)
 
SkClipOp ToSk (DlClipOp op)
 
SkCanvas::PointMode ToSk (DlPointMode mode)
 
sk_sp< SkShader > ToSk (const std::shared_ptr< const DlColorSource > &source)
 
sk_sp< SkShader > ToSk (const DlColorSource &source)
 
sk_sp< SkImageFilter > ToSk (const std::shared_ptr< DlImageFilter > &filter)
 
sk_sp< SkImageFilter > ToSk (const DlImageFilter &filter)
 
sk_sp< SkColorFilter > ToSk (const std::shared_ptr< const DlColorFilter > &filter)
 
sk_sp< SkColorFilter > ToSk (const DlColorFilter &filter)
 
sk_sp< SkMaskFilter > ToSk (const std::shared_ptr< const DlMaskFilter > &filter)
 
sk_sp< SkMaskFilter > ToSk (const DlMaskFilter &filter)
 
SkMatrix * ToSk (const DlMatrix *matrix, SkMatrix &scratch)
 
const SkRSXform * ToSk (const DlRSTransform *transforms)
 
template<class T , class U >
bool Equals (const T *a, const U *b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< const T > &a, const U *b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< T > &a, const U *b)
 
template<class T , class U >
bool Equals (const T *a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool Equals (const T *a, const std::shared_ptr< U > &b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< const T > &a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< T > &a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< const T > &a, const std::shared_ptr< U > &b)
 
template<class T , class U >
bool Equals (const std::shared_ptr< T > &a, const std::shared_ptr< U > &b)
 
template<class T , class U >
bool NotEquals (const T *a, const U *b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< const T > &a, const U *b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< T > &a, const U *b)
 
template<class T , class U >
bool NotEquals (const T *a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool NotEquals (const T *a, const std::shared_ptr< U > &b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< const T > &a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< T > &a, const std::shared_ptr< const U > &b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< const T > &a, const std::shared_ptr< U > &b)
 
template<class T , class U >
bool NotEquals (const std::shared_ptr< T > &a, const std::shared_ptr< U > &b)
 
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 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)
 
SkColorSpace * GetColorSpace (DlCanvas *canvas)
 
static sk_sp< SkSurface > CreateSnapshotSurface (GrDirectContext *surface_context, const DlISize &size)
 
static sk_sp< SkData > GetRasterData (const sk_sp< SkSurface > &offscreen_surface, bool compressed)
 
void DrawCheckerboard (DlCanvas *canvas, const DlRect &rect)
 
 TEST (FlowTest, SurfaceFrameDoesNotSubmitInDtor)
 
 TEST (FlowTest, SurfaceFrameDoesNotHaveEmptyCanvas)
 
 TEST (FlowTest, SurfaceFrameDoesNotPrepareRtree)
 
std::unordered_map< int64_t, DlRectSliceViews (DlCanvas *background_canvas, const std::vector< int64_t > &composition_order, const std::unordered_map< int64_t, std::unique_ptr< EmbedderViewSlice > > &slices, const std::unordered_map< int64_t, DlRect > &view_rects)
 Compute the required overlay layers and clip the view slices according to the size and position of the platform views.
 
 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, const 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, bool enable_microtask_profiling)
 
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 sk_sp< SkImage > ResizeRasterImage (const sk_sp< SkImage > &image, const SkISize &resized_dimensions, const fml::tracing::TraceFlow &flow)
 
static sk_sp< SkImage > ImageFromDecompressedData (ImageDescriptor *descriptor, uint32_t target_width, uint32_t target_height, const fml::tracing::TraceFlow &flow)
 
static SkiaGPUObject< SkImage > UploadRasterImage (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< SkImage > ConvertToRasterUsingResourceContext (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)
 
DlMatrix ToDlMatrix (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, const fml::RefPtr< SkiaUnrefQueue > &unref_queue)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, PictureRecorder)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, RSuperellipse)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Shader)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, Vertices)
 
 IMPLEMENT_WRAPPERTYPEINFO (ui, NativeSemanticsFlags)
 
 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)
 
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 * NativeAssetsDlopen (const char *asset_id, char **error)
 
static char * NativeAssetsAvailableAssets ()
 
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_paths, 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 ()
 
static bool ServiceStreamListenCallback (const char *stream_id)
 
static void ServiceStreamCancelCallback (const char *stream_id)
 
static std::vector< const char * > ProfilingFlags (bool enable_profiling, bool profile_startup)
 
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.
 
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.
 
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.
 
 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< SkData > ScreenshotLayerTreeAsPicture (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)
 
 TEST (RasterizerTest, isAiksContextInitialized)
 
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< SkData > SerializeTypefaceWithoutData (SkTypeface *typeface, void *ctx)
 
sk_sp< SkData > SerializeTypefaceWithData (SkTypeface *typeface, void *ctx)
 
sk_sp< SkTypeface > DeserializeTypefaceWithoutData (const void *data, size_t length, void *ctx)
 
struct flutter::ImageMetaData __attribute__ ((packed))
 
sk_sp< SkData > SerializeImageWithoutData (SkImage *image, void *ctx)
 
sk_sp< SkImage > DeserializeImageWithoutData (const void *data, size_t length, void *ctx)
 
static void ServiceProtocolParameterError (rapidjson::Document *response, std::string error_details)
 
static void ServiceProtocolFailureError (rapidjson::Document *response, std::string message)
 
static void StartupAndShutdownShell (benchmark::State &state, bool measure_startup, bool measure_shutdown)
 
static void BM_ShellInitialization (benchmark::State &state)
 
 BENCHMARK (BM_ShellInitialization)
 
static void BM_ShellShutdown (benchmark::State &state)
 
 BENCHMARK (BM_ShellShutdown)
 
static void BM_ShellInitializationAndShutdown (benchmark::State &state)
 
 BENCHMARK (BM_ShellInitializationAndShutdown)
 
void InitSkiaEventTracer (bool enabled, const std::optional< std::vector< std::string > > &allowlist)
 
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 (DeviceVMServicePort, "vm-service-port", "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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode DEF_SWITCH (DisableVMServicePublication, "disable-vm-service-publication", "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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode 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(ProfileStartup
 
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is new samples start overwriting the oldest ones This switch is only meaningful when set in conjunction with enable dart profiling DEF_SWITCH (EndlessTraceBuffer, "endless-trace-buffer", "Enable an endless trace buffer. The default is a ring buffer. " "This is useful when very old events need to viewed. For example, " "during application launch. Memory usage will continue to grow " "indefinitely however.") DEF_SWITCH(EnableSoftwareRendering
 
it will be possible to load the file into Perfetto s trace viewer DEF_SWITCH (ProfileMicrotasks, "profile-microtasks", "Enable collection of information about each microtask. Information " "about completed microtasks will be written to the \"Microtask\" " "timeline stream. Information about queued microtasks will be " "accessible from Dart / Flutter DevTools.") DEF_SWITCH(UseTestFonts
 
it will be possible to load the file into Perfetto s trace viewer use test 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:"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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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
 
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, bool require_merged_platform_ui_thread)
 
 TEST (Point, SetsCoordinates)
 
 TEST (Size, SetsDimensions)
 
 TEST (Size, ClampsDimensionsPositive)
 
 TEST (Rect, SetsOriginAndSize)
 
 TEST (Rect, ReturnsLTRB)
 
 TEST (Rect, ReturnsWidthHeight)
 
static bool IsProcResolverOpenGLES (const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)
 
static sk_sp< const GrGLInterface > CreateGLInterface (const GPUSurfaceGLDelegate::GLProcResolver &proc_resolver)
 
static SkColorType FirstSupportedColorType (GrDirectContext *context, GrGLenum *format)
 
static sk_sp< SkSurface > WrapOnscreenSurface (GrDirectContext *context, const DlISize &size, intptr_t fbo)
 
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, const AndroidContext::ContextSettings &p_settings)
 
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 (const flutter::TaskRunners &task_runners, AndroidRenderingAPI android_rendering_api, bool enable_opengl_gpu_tracing, const AndroidContext::ContextSettings &settings)
 
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, jlong engineId)
 
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, jlong engineId)
 
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 bool IsSurfaceControlEnabled (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, jboolean reset_on_background)
 
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)
 
static bool SetTextureLayout (const ContextVK &context, const TextureSourceVK *texture, vk::ImageLayout layout, LayoutUpdateMode mode)
 
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 (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)
 
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 DlISize TransformedSurfaceSize (const DlISize &size, const DlMatrix &transformation)
 
static void InvalidateApiState (SkSurface &skia_surface)
 
static FlutterBackingStoreConfig MakeBackingStoreConfig (int64_t view_id, const DlISize &backing_store_size)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (double opacity)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const DlRect &rect)
 
static FlutterSize ConvertSize (const DlSize &vector)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const DlRoundRect &rrect)
 
static std::unique_ptr< FlutterPlatformViewMutationConvertMutation (const DlMatrix &matrix)
 
FlutterSemanticsFlag SemanticsFlagsToInt (const SemanticsFlags &flags)
 
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.
 
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)
 
LONG RectWidth (const RECT &r)
 
LONG RectHeight (const RECT &r)
 
bool AreRectsEqual (const RECT &a, const RECT &b)
 
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)
 
std::string WCharBufferToString (const wchar_t *wstr)
 Convert a null terminated wchar_t buffer to a std::string using Windows utilities.
 
static int64_t NumWindowsForThread (const THREADENTRY32 &thread)
 
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 * GetFlutterContentHash ()
 
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)
 
SkPath * CreatePath (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()
 
static constexpr DlScalar kEhCloseEnough = impeller::kEhCloseEnough
 
static constexpr DlScalar kPi = impeller::kPi
 
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.
 
static std::string gGoldenDir
 
static std::string gFontFile
 
static const auto * flow_type = "RasterCacheFlow::DisplayList"
 
static constexpr DlRect kGiantRect = DlRect::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 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 kColorRedIndex = 1
 
constexpr int kColorGreenIndex = 2
 
constexpr int kColorBlueIndex = 3
 
constexpr int kColorAlphaIndex = 4
 
constexpr int kColorSpaceIndex = 5
 
constexpr int kBlendModeIndex = 6
 
constexpr int kStyleIndex = 7
 
constexpr int kStrokeWidthIndex = 8
 
constexpr int kStrokeCapIndex = 9
 
constexpr int kStrokeJoinIndex = 10
 
constexpr int kStrokeMiterLimitIndex = 11
 
constexpr int kFilterQualityIndex = 12
 
constexpr int kMaskFilterIndex = 13
 
constexpr int kMaskFilterBlurStyleIndex = 14
 
constexpr int kMaskFilterSigmaIndex = 15
 
constexpr int kInvertColorIndex = 16
 
constexpr size_t kDataByteCount = 68
 
constexpr int kShaderIndex = 0
 
constexpr int kColorFilterIndex = 1
 
constexpr int kImageFilterIndex = 2
 
constexpr int kObjectCount = 3
 
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
 
constexpr int kVerticalScrollSemanticsActions
 
constexpr int kHorizontalScrollSemanticsActions
 
constexpr int kScrollableSemanticsActions
 
constexpr int kSystemActions
 The following actions are not user-initiated.
 
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 const char * kDartWriteProtectCodeArgs []
 
static const char * kDartDisableIntegerDivisionArgs []
 
static const char * kDartAssertArgs []
 
static const char * kDartStartPausedArgs []
 
static const char * kDartEndlessTraceBufferArgs []
 
static const char * kDartSystraceTraceBufferArgs []
 
static const char * kDartDefaultTraceStreamsArgs []
 
static const char * kDartStartupTraceStreamsArgs []
 
static const char * kDartSystraceTraceStreamsArgs []
 
static const char * kDartProfileMicrotasksArgs []
 
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.
 
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 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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode 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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile 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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring 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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is full
 
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is new samples start overwriting the oldest ones This switch is only meaningful when set in conjunction with enable dart profiling enable software rendering
 
it will be possible to load the file into Perfetto s trace viewer use test fonts
 
it will be possible to load the file into Perfetto s trace viewer use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 use test 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 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 kMinimumAndroidApiLevelForImpeller = 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_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_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 jmethodID g_mutators_stack_push_opacity_method = nullptr
 
static jmethodID g_mutators_stack_push_clippath_method = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * path_class = nullptr
 
static jmethodID path_constructor = nullptr
 
static jmethodID path_move_to_method = nullptr
 
static jmethodID path_line_to_method = nullptr
 
static jmethodID path_quad_to_method = nullptr
 
static jmethodID path_cubic_to_method = nullptr
 
static jmethodID path_conic_to_method = nullptr
 
static jmethodID path_close_method = nullptr
 
static jmethodID path_set_fill_type_method = nullptr
 
static fml::jni::ScopedJavaGlobalRef< jclass > * g_path_fill_type_class = nullptr
 
static jfieldID g_path_fill_type_winding_field = nullptr
 
static jfieldID g_path_fill_type_even_odd_field = 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
 
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 UINT kDefaultDpi = 96
 
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 const uintptr_t kPollTimeoutTimerId = 1
 
static absl::NoDestructor< std::unique_ptr< Shell > > g_shell
 

Typedef Documentation

◆ AccessibilityNodeId

◆ 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

using flutter::ChildIsolatePreparer = typedef std::function<bool(DartIsolate*)>

Definition at line 24 of file dart_isolate_group_data.h.

◆ Convexity

Definition at line 37 of file dl_path.cc.

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

◆ DlBlendMode

Definition at line 12 of file dl_blend_mode.h.

◆ DlDegrees

Definition at line 18 of file dl_geometry_types.h.

◆ DlIndex

using flutter::DlIndex = typedef uint32_t

Definition at line 261 of file display_list.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 32 of file dl_geometry_types.h.

◆ DlPathFillType

Definition at line 16 of file dl_path.h.

◆ DlPathReceiver

Definition at line 17 of file dl_path.h.

◆ DlPoint

Definition at line 21 of file dl_geometry_types.h.

◆ DlQuad

Definition at line 33 of file dl_geometry_types.h.

◆ DlRadians

Definition at line 19 of file dl_geometry_types.h.

◆ DlRect

Definition at line 27 of file dl_geometry_types.h.

◆ DlRoundingRadii

Definition at line 31 of file dl_geometry_types.h.

◆ DlRoundRect

Definition at line 29 of file dl_geometry_types.h.

◆ DlRoundSuperellipse

◆ DlRSTransform

Definition at line 34 of file dl_geometry_types.h.

◆ DlScalar

Definition at line 17 of file dl_geometry_types.h.

◆ DlSize

Definition at line 25 of file dl_geometry_types.h.

◆ DlVector2

Definition at line 22 of file dl_geometry_types.h.

◆ DlVector3

Definition at line 23 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.

◆ FillType

Definition at line 36 of file dl_path.cc.

◆ Flags

Definition at line 12 of file dl_vertices.cc.

◆ FlutterViewId

typedef int64_t flutter::FlutterViewId

Definition at line 15 of file accessibility_plugin.h.

◆ FramePipeline

Definition at line 98 of file rasterizer.h.

◆ FrameRasterizedCallback

using flutter::FrameRasterizedCallback = typedef std::function<void(const FrameTiming&)>

Definition at line 91 of file settings.h.

◆ GPUCAMetalLayerHandle

Definition at line 23 of file gpu_surface_metal_delegate.h.

◆ GPUMTLCommandQueueHandle

Definition at line 20 of file gpu_surface_metal_delegate.h.

◆ GPUMTLDestructionCallback

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

Definition at line 28 of file gpu_surface_metal_delegate.h.

◆ GPUMTLDeviceHandle

Definition at line 17 of file gpu_surface_metal_delegate.h.

◆ GPUMTLTextureHandle

typedef const void* flutter::GPUMTLTextureHandle

Definition at line 26 of file gpu_surface_metal_delegate.h.

◆ Gradient

Definition at line 53 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 51 of file dart_ui.cc.

◆ ImageGeneratorFactory

using flutter::ImageGeneratorFactory = typedef 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.

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.

◆ 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 81 of file settings.h.

◆ MappingCallback

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

Definition at line 87 of file settings.h.

◆ Mappings

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

Definition at line 88 of file settings.h.

◆ MappingsCallback

using flutter::MappingsCallback = typedef std::function<Mappings(void)>

Definition at line 89 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

◆ PaintRegionMap

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

Definition at line 38 of file diff_context.h.

◆ Path

Definition at line 54 of file dart_ui.cc.

◆ PathMeasure

Definition at line 52 of file dart_ui.cc.

◆ PointerDataDispatcherMaker

Signature for constructing PointerDataDispatcher.

Parameters
[in]delegatethe Flutter::Engine

Definition at line 172 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

using flutter::Sampler = typedef 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.

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 181 of file semantics_node.h.

◆ SkiaUnrefQueue

using flutter::SkiaUnrefQueue = typedef UnrefQueue<GrDirectContext>

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<fml::TaskQueueId(intptr_t , fml::closure )>

Definition at line 73 of file settings.h.

◆ TaskObserverRemove

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

Definition at line 76 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 78 of file settings.h.

◆ UniqueAotDataPtr

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

Definition at line 43 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 
kSkiaOpenGLES 
kImpellerOpenGLES 
kImpellerVulkan 
kImpellerAutoselect 

Definition at line 11 of file android_rendering_selector.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};

◆ Clip

Enumerator
kNone 
kHardEdge 
kAntiAlias 
kAntiAliasWithSaveLayer 

Definition at line 43 of file layer.h.

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

◆ 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 50 of file shell.h.

50 {
51 // NOLINTBEGIN(readability-identifier-naming)
52 /// No error has occurred.
53 NoError = 0,
54 /// The Dart error code for an API error.
55 ApiError = 253,
56 /// The Dart error code for a compilation error.
57 CompilationError = 254,
58 /// The Dart error code for an unknown error.
59 UnknownError = 255
60 // NOLINTEND(readability-identifier-naming)
61};
@ 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 31 of file dl_op_records.h.

31 {
32 // The Op is deferring comparisons to a bulk memcmp performed lazily
33 // across all bulk-comparable ops.
35
36 // The Op provided a specific equals method that spotted a difference
38
39 // The Op provided a specific equals method that saw no differences
40 kEqual,
41};

◆ DisplayListOpCategory

enum class flutter::DisplayListOpCategory
strong
Enumerator
kAttribute 
kTransform 
kClip 
kSave 
kSaveLayer 
kRestore 
kRendering 
kSubDisplayList 
kInvalidCategory 
kMaxCategory 

Definition at line 151 of file display_list.h.

◆ DisplayListOpType

enum class flutter::DisplayListOpType
strong
Enumerator
kInvalidOp 
kMaxOp 

Definition at line 142 of file display_list.h.

142 {
144
145 // empty comment to make formatter happy
148};
#define FOR_EACH_DISPLAY_LIST_OP(V)
#define DL_OP_TO_ENUM_VALUE(name)

◆ 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:373
@ kOuter
nothing inside, fuzzy outside
@ kInner
fuzzy inside, nothing outside

◆ DlClipOp

enum class flutter::DlClipOp
strong
Enumerator
kDifference 
kIntersect 

Definition at line 10 of file dl_types.h.

◆ DlColorFilterType

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

Definition at line 19 of file dl_color_filter.h.

◆ DlColorSourceType

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

Definition at line 35 of file dl_color_source.h.

◆ DlColorSpace

enum class flutter::DlColorSpace
strong
Enumerator
kSRGB 
kExtendedSRGB 
kDisplayP3 

Definition at line 13 of file dl_color.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};

◆ DlImageFilterType

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

Definition at line 26 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 };

◆ DlPointMode

enum class flutter::DlPointMode
strong
Enumerator
kPoints 

draw each point separately

kLines 

draw each separate pair of points as a line segment

kPolygon 

draw each pair of overlapping points as a line segment

Definition at line 15 of file dl_types.h.

15 {
16 kPoints, //!< draw each point separately
17 kLines, //!< draw each separate pair of points as a line segment
18 kPolygon, //!< draw each pair of overlapping points as a line segment
19};
@ kLines
draw each separate pair of points as a line segment
@ kPolygon
draw each pair of overlapping points as a line segment
@ kPoints
draw each point separately

◆ DlSrcRectConstraint

enum class flutter::DlSrcRectConstraint
strong
Enumerator
kStrict 
kFast 

Definition at line 21 of file dl_types.h.

◆ 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 18 of file dl_vertices.h.

18 {
19 /// The vertices are taken 3 at a time to form a triangle.
21
22 /// The vertices are taken in overlapping triplets to form triangles, with
23 /// each triplet sharing 2 of its vertices with the preceding and following
24 /// triplets.
25 /// vertices [ABCDE] yield 3 triangles ABC,BCD,CDE
27
28 /// The vertices are taken in overlapping pairs and combined with the first
29 /// vertex to form triangles that radiate outward from the initial point.
30 /// vertices [ABCDE] yield 3 triangles ABC,ACD,ADE
32};
@ 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

◆ FlutterGpuPreference

enum class flutter::FlutterGpuPreference
strong
Enumerator
NoPreference 
LowPowerPreference 

Definition at line 20 of file flutter_project_bundle.h.

20 {
23};
@ LowPowerPreference
@ NoPreference

◆ FlutterUIThreadPolicy

enum class flutter::FlutterUIThreadPolicy
strong
Enumerator
Default 
RunOnPlatformThread 
RunOnSeparateThread 

Definition at line 25 of file flutter_project_bundle.h.

25 {
26 Default,
29};
@ RunOnPlatformThread
@ RunOnSeparateThread
@ Default

◆ 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};
@ kBackward
Definition embedder.h:1185
@ kForward
Definition embedder.h:1180

◆ 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 64 of file shell.h.

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

◆ GpuPreference

enum class flutter::GpuPreference
strong
Enumerator
NoPreference 
LowPowerPreference 

Definition at line 14 of file dart_project.h.

14 {
15 // No preference.
17 // Prefer energy efficiency over performance, such as an integrated GPU.
18 // This falls back to a high performance GPU if no low power GPU is
19 // available.
21};

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

23 {
24 /// The isolate is launched as a solo isolate or to start a new group.
26 /// The isolate is launched as part of a group, and avoids reloading the
27 /// kernel snapshot.
29};
@ 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:1245
@ kDown
Definition embedder.h:1252

◆ LayoutUpdateMode

enum class flutter::LayoutUpdateMode
strong
Enumerator
kSync 
kAsync 

Definition at line 39 of file surface_texture_external_texture_vk_impeller.cc.

◆ MaskFilterType

Enumerator
kNull 
kBlur 

Definition at line 61 of file paint.cc.

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

◆ 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 {
@ kModifierFlagControlLeft
@ kModifierFlagAltRight
@ kModifierFlagControlRight
@ kModifierFlagMetaRight
@ kModifierFlagShiftLeft
@ kModifierFlagShiftRight
@ kModifierFlagAltLeft
@ kModifierFlagMetaLeft

◆ MTLRenderTargetType

enum class flutter::MTLRenderTargetType
strong
Enumerator
kMTLTexture 
kCAMetalLayer 

Definition at line 37 of file gpu_surface_metal_delegate.h.

◆ MutatorType

enum class flutter::MutatorType
strong
Enumerator
kClipRect 
kClipRRect 
kClipRSE 
kClipPath 
kTransform 
kOpacity 
kBackdropFilter 

Definition at line 33 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
@ kPointerButtonMouseForward
@ kPointerButtonMouseSecondary
@ kPointerButtonMouseMiddle
@ kPointerButtonMousePrimary

◆ PointerButtonStylus

Enumerator
kPointerButtonStylusContact 
kPointerButtonStylusPrimary 
kPointerButtonStylusSecondary 

Definition at line 25 of file pointer_data.h.

25 : int64_t {
29};
@ kPointerButtonStylusSecondary
@ kPointerButtonStylusPrimary
@ kPointerButtonStylusContact

◆ PointerButtonTouch

Enumerator
kPointerButtonTouchContact 

Definition at line 21 of file pointer_data.h.

21 : int64_t {
23};
@ kPointerButtonTouchContact

◆ PostPrerollResult

enum class flutter::PostPrerollResult
strong
Enumerator
kSuccess 
kResubmitFrame 
kSkipAndRetryFrame 

Definition at line 266 of file embedded_views.h.

266 {
267 // Frame has successfully rasterized.
268 kSuccess,
269 // Frame is submitted twice. This is currently only used when
270 // thread configuration change occurs.
272 // Frame is dropped and a new frame with the same layer tree is
273 // attempted. This is currently only used when thread configuration
274 // change occurs.
276};

◆ RasterCacheKeyKind

enum class flutter::RasterCacheKeyKind
strong
Enumerator
kLayerMetrics 
kDisplayListMetrics 

Definition at line 74 of file raster_cache_key.h.

◆ RasterCacheKeyType

enum class flutter::RasterCacheKeyType
strong
Enumerator
kLayer 
kDisplayList 
kLayerChildren 

Definition at line 24 of file raster_cache_key.h.

◆ RasterCacheLayerStrategy

Enumerator
kLayer 
kLayerChildren 

Definition at line 28 of file raster_cache.h.

◆ RasterStatus

enum class flutter::RasterStatus
strong
Enumerator
kSuccess 
kResubmit 
kSkipAndRetry 

Definition at line 26 of file compositor_context.h.

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

◆ 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 
kScrollToOffset 
kExpand 
kCollapse 

Definition at line 23 of file semantics_node.h.

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

◆ SemanticsCheckState

enum class flutter::SemanticsCheckState : int32_t
strong
Enumerator
kNone 
kTrue 
kFalse 
kMixed 

Definition at line 18 of file semantics_flags.h.

◆ SemanticsRole

enum class flutter::SemanticsRole : int32_t
strong

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

Warning
This must match the SemanticsRole enum in lib/ui/semantics.dart. See also:
Enumerator
kNone 
kTab 
kTabBar 
kTabPanel 
kDialog 
kAlertDialog 
kTable 
kCell 
kRow 
kColumnHeader 
kDragHandle 
kSpinButton 
kComboBox 
kMenuBar 
kMenu 
kMenuItem 
kMenuItemCheckbox 
kMenuItemRadio 
kList 
kListItem 
kForm 
kTooltip 
kLoadingSpinner 
kProgressBar 
kHotKey 
kRadioGroup 
kStatus 
kAlert 
kComplementary 
kContentInfo 
kMain 
kNavigation 
kRegion 

Definition at line 74 of file semantics_node.h.

74 : int32_t {
75 kNone = 0,
76 kTab = 1,
77 kTabBar = 2,
78 kTabPanel = 3,
79 kDialog = 4,
80 kAlertDialog = 5,
81 kTable = 6,
82 kCell = 7,
83 kRow = 8,
84 kColumnHeader = 9,
85 kDragHandle = 10,
86 kSpinButton = 11,
87 kComboBox = 12,
88 kMenuBar = 13,
89 kMenu = 14,
90 kMenuItem = 15,
92 kMenuItemRadio = 17,
93 kList = 18,
94 kListItem = 19,
95 kForm = 20,
96 kTooltip = 21,
97 kLoadingSpinner = 22,
98 kProgressBar = 23,
99 kHotKey = 24,
100 kRadioGroup = 25,
101 kStatus = 26,
102 kAlert = 27,
103 kComplementary = 28,
104 kContentInfo = 29,
105 kMain = 30,
106 kNavigation = 31,
107 kRegion = 32,
108};

◆ SemanticsTristate

enum class flutter::SemanticsTristate : int32_t
strong
Enumerator
kNone 
kTrue 
kFalse 

Definition at line 13 of file semantics_flags.h.

13 : int32_t {
14 kNone = 0,
15 kTrue = 1,
16 kFalse = 2,
17};

◆ SemanticsValidationResult

enum class flutter::SemanticsValidationResult : int32_t
strong

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

Warning
This must match the SemanticsValidationResult enum in lib/ui/semantics.dart. See also:
Enumerator
kNone 
kValid 
kInvalid 

Definition at line 116 of file semantics_node.h.

116 : int32_t {
117 kNone = 0,
118 kValid = 1,
119 kInvalid = 2,
120};

◆ 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:1474
@ kLocale
Definition embedder.h:1476

◆ TracingResult

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

Definition at line 17 of file ptrace_check.h.

◆ UIThreadPolicy

enum class flutter::UIThreadPolicy
strong
Enumerator
Default 
RunOnPlatformThread 
RunOnSeparateThread 

Definition at line 24 of file dart_project.h.

24 {
25 // Default value. Currently will run the UI isolate on separate thread,
26 // later will be changed to running the UI isolate on platform thread.
27 Default,
28 // Run the UI isolate on platform thread.
30 // Run the UI isolate on a separate thread.
32};

◆ ViewFocusDirection

enum class flutter::ViewFocusDirection : int64_t
strong
Enumerator
kUndefined 
kForward 
kBackward 

Definition at line 22 of file view_focus.h.

22 : int64_t {
23 kUndefined = 0,
26};
@ kUndefined
Definition embedder.h:1175

◆ ViewFocusState

enum class flutter::ViewFocusState : int64_t
strong
Enumerator
kUnfocused 
kFocused 

Definition at line 14 of file view_focus.h.

14 : int64_t {
15 kUnfocused = 0,
17};
@ kUnfocused
Specifies that a view does not have platform focus.
Definition embedder.h:1191
@ kFocused
Specifies that a view has platform focus.
Definition embedder.h:1194

◆ WindowArchetype

enum class flutter::WindowArchetype
strong
Enumerator
kRegular 
kDialog 

Definition at line 11 of file windowing.h.

11 {
12 // Regular top-level window.
14
15 // Dialog window.
16 kDialog,
17};

◆ 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 35 of file android_shell_holder.cc.

36 {
37 // set thread name
39 // set thread priority
40 switch (config.priority) {
43 if (::setpriority(PRIO_PROCESS, 0, 10) != 0) {
44 FML_LOG(ERROR) << "Failed to set IO task runner priority";
45 }
46 break;
47 }
50 if (::setpriority(PRIO_PROCESS, 0, -1) != 0) {
51 FML_LOG(ERROR) << "Failed to set UI task runner priority";
52 }
53 break;
54 }
57 // Android describes -8 as "most important display threads, for
58 // compositing the screen and retrieving input events". Conservatively
59 // set the raster thread to slightly lower priority than it.
60 if (::setpriority(PRIO_PROCESS, 0, -5) != 0) {
61 // Defensive fallback. Depending on the OEM, it may not be possible
62 // to set priority to -5.
63 if (::setpriority(PRIO_PROCESS, 0, -2) != 0) {
64 FML_LOG(ERROR) << "Failed to set raster task runner priority";
65 }
66 }
67 break;
68 }
69 default:
71 if (::setpriority(PRIO_PROCESS, 0, 0) != 0) {
72 FML_LOG(ERROR) << "Failed to set priority";
73 }
74 }
75}
@ 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:101
@ kNotEfficiency
Request affinity for all non-efficiency 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.
ThreadPriority priority
Definition thread.h:45

References FML_LOG, fml::Thread::kBackground, fml::Thread::kDisplay, fml::kEfficiency, fml::kNotEfficiency, fml::kNotPerformance, fml::Thread::kRaster, fml::Thread::ThreadConfig::priority, fml::RequestAffinity(), and fml::Thread::SetCurrentThreadName().

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

◆ AppLifecycleStateToString()

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

Definition at line 72 of file app_lifecycle_state.h.

72 {
73 switch (state) {
74 case AppLifecycleState::kDetached:
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}

References kDetached, kHidden, kInactive, kPaused, and kResumed.

Referenced by flutter::WindowsLifecycleManager::SetLifecycleState().

◆ AreRectsEqual()

bool flutter::AreRectsEqual ( const RECT &  a,
const RECT &  b 
)

Definition at line 19 of file rect_helper.h.

19 {
20 return a.left == b.left && a.top == b.top && a.right == b.right &&
21 a.bottom == b.bottom;
22}

Referenced by flutter::HostWindow::SetFullscreen().

◆ AttachJNI()

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

Definition at line 184 of file platform_view_android_jni_impl.cc.

184 {
185 fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterJNI);
186 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
187 std::make_shared<PlatformViewAndroidJNIImpl>(java_object);
188 auto shell_holder = std::make_unique<AndroidShellHolder>(
189 FlutterMain::Get().GetSettings(), jni_facade,
190 FlutterMain::Get().GetAndroidRenderingAPI());
191 if (shell_holder->IsValid()) {
192 return reinterpret_cast<jlong>(shell_holder.release());
193 } else {
194 return 0;
195 }
196}

References flutter::FlutterMain::Get().

Referenced by RegisterApi().

◆ BENCHMARK() [1/3]

flutter::BENCHMARK ( BM_ShellInitialization  )

◆ BENCHMARK() [2/3]

flutter::BENCHMARK ( BM_ShellInitializationAndShutdown  )

◆ BENCHMARK() [3/3]

flutter::BENCHMARK ( BM_ShellShutdown  )

◆ BENCHMARK_CAPTURE() [1/83]

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

◆ BENCHMARK_CAPTURE() [2/83]

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

◆ BENCHMARK_CAPTURE() [3/83]

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

◆ BENCHMARK_CAPTURE() [4/83]

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

◆ BENCHMARK_CAPTURE() [5/83]

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

◆ BENCHMARK_CAPTURE() [6/83]

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

◆ BENCHMARK_CAPTURE() [7/83]

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

◆ BENCHMARK_CAPTURE() [8/83]

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

◆ BENCHMARK_CAPTURE() [9/83]

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

◆ BENCHMARK_CAPTURE() [10/83]

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

◆ BENCHMARK_CAPTURE() [11/83]

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

◆ BENCHMARK_CAPTURE() [12/83]

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

◆ BENCHMARK_CAPTURE() [13/83]

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

◆ BENCHMARK_CAPTURE() [14/83]

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

◆ BENCHMARK_CAPTURE() [15/83]

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

◆ BENCHMARK_CAPTURE() [16/83]

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

◆ BENCHMARK_CAPTURE() [17/83]

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

◆ BENCHMARK_CAPTURE() [18/83]

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

◆ BENCHMARK_CAPTURE() [19/83]

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

◆ BENCHMARK_CAPTURE() [20/83]

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

◆ BENCHMARK_CAPTURE() [21/83]

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

◆ BENCHMARK_CAPTURE() [22/83]

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

◆ BENCHMARK_CAPTURE() [23/83]

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

◆ BENCHMARK_CAPTURE() [24/83]

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

◆ BENCHMARK_CAPTURE() [25/83]

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

◆ BENCHMARK_CAPTURE() [26/83]

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

◆ BENCHMARK_CAPTURE() [27/83]

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

◆ BENCHMARK_CAPTURE() [28/83]

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

◆ BENCHMARK_CAPTURE() [29/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchByIndexDefault  ,
kDefaultNoRtree  ,
DisplayListDispatchBenchmarkType::kDefaultNoRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [30/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchByIteratorDefault  ,
kDefaultNoRtree  ,
DisplayListDispatchBenchmarkType::kDefaultNoRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [31/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchByVectorCull  ,
kCulledWithRtree  ,
DisplayListDispatchBenchmarkType::kCulledWithRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [32/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchByVectorDefault  ,
kDefaultNoRtree  ,
DisplayListDispatchBenchmarkType::kDefaultNoRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [33/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchCull  ,
kCulledWithRtree  ,
DisplayListDispatchBenchmarkType::kCulledWithRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [34/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchDefault  ,
kDefaultNoRtree  ,
DisplayListDispatchBenchmarkType::kDefaultNoRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [35/83]

flutter::BENCHMARK_CAPTURE ( BM_DisplayListDispatchDefault  ,
kDefaultWithRtree  ,
DisplayListDispatchBenchmarkType::kDefaultWithRtree   
) -> Unit(benchmark::kMicrosecond)

◆ BENCHMARK_CAPTURE() [36/83]

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

◆ BENCHMARK_CAPTURE() [37/83]

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

◆ BENCHMARK_CAPTURE() [38/83]

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

◆ BENCHMARK_CAPTURE() [39/83]

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

◆ BENCHMARK_CAPTURE() [40/83]

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

◆ BENCHMARK_CAPTURE() [41/83]

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

◆ BENCHMARK_CAPTURE() [42/83]

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

◆ BENCHMARK_CAPTURE() [43/83]

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

◆ BENCHMARK_CAPTURE() [44/83]

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

◆ BENCHMARK_CAPTURE() [45/83]

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

◆ BENCHMARK_CAPTURE() [46/83]

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

◆ BENCHMARK_CAPTURE() [47/83]

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

◆ BENCHMARK_CAPTURE() [48/83]

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

◆ BENCHMARK_CAPTURE() [49/83]

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

◆ BENCHMARK_CAPTURE() [50/83]

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

◆ BENCHMARK_CAPTURE() [51/83]

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

◆ BENCHMARK_CAPTURE() [52/83]

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

◆ BENCHMARK_CAPTURE() [53/83]

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

◆ BENCHMARK_CAPTURE() [54/83]

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

◆ BENCHMARK_CAPTURE() [55/83]

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

◆ BENCHMARK_CAPTURE() [56/83]

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

◆ BENCHMARK_CAPTURE() [57/83]

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

◆ BENCHMARK_CAPTURE() [58/83]

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

◆ BENCHMARK_CAPTURE() [59/83]

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

◆ BENCHMARK_CAPTURE() [60/83]

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

◆ BENCHMARK_CAPTURE() [61/83]

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

◆ BENCHMARK_CAPTURE() [62/83]

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

◆ BENCHMARK_CAPTURE() [63/83]

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

◆ BENCHMARK_CAPTURE() [64/83]

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

◆ BENCHMARK_CAPTURE() [65/83]

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

◆ BENCHMARK_CAPTURE() [66/83]

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

◆ BENCHMARK_CAPTURE() [67/83]

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

◆ BENCHMARK_CAPTURE() [68/83]

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

◆ BENCHMARK_CAPTURE() [69/83]

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

◆ BENCHMARK_CAPTURE() [70/83]

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

◆ BENCHMARK_CAPTURE() [71/83]

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

◆ BENCHMARK_CAPTURE() [72/83]

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

◆ BENCHMARK_CAPTURE() [73/83]

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

◆ BENCHMARK_CAPTURE() [74/83]

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

◆ BENCHMARK_CAPTURE() [75/83]

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

◆ BENCHMARK_CAPTURE() [76/83]

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

◆ BENCHMARK_CAPTURE() [77/83]

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

◆ BENCHMARK_CAPTURE() [78/83]

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

◆ BENCHMARK_CAPTURE() [79/83]

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

◆ BENCHMARK_CAPTURE() [80/83]

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

◆ BENCHMARK_CAPTURE() [81/83]

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

◆ BENCHMARK_CAPTURE() [82/83]

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

◆ BENCHMARK_CAPTURE() [83/83]

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   
)

◆ 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

References transform, and type.

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

References type.

◆ BM_DisplayListBuilderDefault()

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

Definition at line 91 of file dl_builder_benchmarks.cc.

92 {
93 bool prepare_rtree = NeedPrepareRTree(type);
94 while (state.KeepRunning()) {
95 DisplayListBuilder builder(prepare_rtree);
96 InvokeAllRenderingOps(builder);
97 Complete(builder, type);
98 }
99}

References type.

◆ BM_DisplayListBuilderWithClipRect()

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

Definition at line 127 of file dl_builder_benchmarks.cc.

129 {
130 DlRect clip_bounds = DlRect::MakeLTRB(6.5, 7.3, 90.2, 85.7);
131 bool prepare_rtree = NeedPrepareRTree(type);
132 while (state.KeepRunning()) {
133 DisplayListBuilder builder(prepare_rtree);
134 builder.ClipRect(clip_bounds, DlClipOp::kIntersect, true);
135 InvokeAllRenderingOps(builder);
136 Complete(builder, type);
137 }
138}

References flutter::DisplayListBuilder::ClipRect(), kIntersect, impeller::TRect< Scalar >::MakeLTRB(), and type.

◆ BM_DisplayListBuilderWithGlobalSaveLayer()

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

Definition at line 140 of file dl_builder_benchmarks.cc.

142 {
143 bool prepare_rtree = NeedPrepareRTree(type);
144 while (state.KeepRunning()) {
145 DisplayListBuilder builder(prepare_rtree);
146 builder.Scale(3.5, 3.5);
147 builder.Translate(10.3, 6.9);
148 builder.SaveLayer(std::nullopt, nullptr);
149 builder.Translate(45.3, 27.9);
151 for (auto& group : allRenderingOps) {
152 for (size_t i = 0; i < group.variants.size(); i++) {
153 auto& invocation = group.variants[i];
154 invocation.Invoke(receiver);
155 }
156 }
157 builder.Restore();
158 Complete(builder, type);
159 }
160}
Internal API for rendering recorded display lists to backends.
DlOpReceiver & DisplayListBuilderBenchmarkAccessor(DisplayListBuilder &builder)

References DisplayListBuilderBenchmarkAccessor(), i, flutter::DisplayListBuilder::Restore(), flutter::DisplayListBuilder::SaveLayer(), flutter::DisplayListBuilder::Scale(), flutter::DisplayListBuilder::Translate(), and type.

◆ BM_DisplayListBuilderWithPerspective()

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

Definition at line 114 of file dl_builder_benchmarks.cc.

116 {
117 bool prepare_rtree = NeedPrepareRTree(type);
118 while (state.KeepRunning()) {
119 DisplayListBuilder builder(prepare_rtree);
120 builder.TransformFullPerspective(0, 1, 0, 12, 1, 0, 0, 33, 3, 2, 5, 29, 0,
121 0, 0, 12);
122 InvokeAllRenderingOps(builder);
123 Complete(builder, type);
124 }
125}

References flutter::DisplayListBuilder::TransformFullPerspective(), and type.

◆ BM_DisplayListBuilderWithSaveLayer()

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

Definition at line 162 of file dl_builder_benchmarks.cc.

164 {
165 bool prepare_rtree = NeedPrepareRTree(type);
166 while (state.KeepRunning()) {
167 DisplayListBuilder builder(prepare_rtree);
169 for (auto& group : allRenderingOps) {
170 for (size_t i = 0; i < group.variants.size(); i++) {
171 auto& invocation = group.variants[i];
172 builder.SaveLayer(std::nullopt, nullptr);
173 invocation.Invoke(receiver);
174 builder.Restore();
175 }
176 }
177 Complete(builder, type);
178 }
179}

References DisplayListBuilderBenchmarkAccessor(), i, flutter::DisplayListBuilder::Restore(), flutter::DisplayListBuilder::SaveLayer(), and type.

◆ BM_DisplayListBuilderWithSaveLayerAndImageFilter()

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

Definition at line 181 of file dl_builder_benchmarks.cc.

183 {
184 DlPaint layer_paint;
185 layer_paint.setImageFilter(&testing::kTestBlurImageFilter1);
186 DlRect layer_bounds = DlRect::MakeLTRB(6.5, 7.3, 35.2, 42.7);
187 bool prepare_rtree = NeedPrepareRTree(type);
188 while (state.KeepRunning()) {
189 DisplayListBuilder builder(prepare_rtree);
191 for (auto& group : allRenderingOps) {
192 for (size_t i = 0; i < group.variants.size(); i++) {
193 auto& invocation = group.variants[i];
194 builder.SaveLayer(layer_bounds, &layer_paint);
195 invocation.Invoke(receiver);
196 builder.Restore();
197 }
198 }
199 Complete(builder, type);
200 }
201}
DlPaint & setImageFilter(std::nullptr_t filter)
Definition dl_paint.h:167

References DisplayListBuilderBenchmarkAccessor(), i, flutter::testing::kTestBlurImageFilter1(), impeller::TRect< Scalar >::MakeLTRB(), flutter::DisplayListBuilder::Restore(), flutter::DisplayListBuilder::SaveLayer(), flutter::DlPaint::setImageFilter(), and type.

◆ BM_DisplayListBuilderWithScaleAndTranslate()

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

Definition at line 101 of file dl_builder_benchmarks.cc.

103 {
104 bool prepare_rtree = NeedPrepareRTree(type);
105 while (state.KeepRunning()) {
106 DisplayListBuilder builder(prepare_rtree);
107 builder.Scale(3.5, 3.5);
108 builder.Translate(10.3, 6.9);
109 InvokeAllRenderingOps(builder);
110 Complete(builder, type);
111 }
112}

References flutter::DisplayListBuilder::Scale(), flutter::DisplayListBuilder::Translate(), and type.

◆ BM_DisplayListDispatchByIndexDefault()

static void flutter::BM_DisplayListDispatchByIndexDefault ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 223 of file dl_builder_benchmarks.cc.

225 {
226 bool prepare_rtree = NeedPrepareRTree(type);
227 DisplayListBuilder builder(prepare_rtree);
228 for (int i = 0; i < 5; i++) {
229 InvokeAllOps(builder);
230 }
231 auto display_list = builder.Build();
232 DlOpReceiverIgnore receiver;
233 while (state.KeepRunning()) {
234 DlIndex end = display_list->GetRecordCount();
235 for (DlIndex i = 0u; i < end; i++) {
236 display_list->Dispatch(receiver, i);
237 }
238 }
239}
const size_t end

References flutter::DisplayListBuilder::Build(), end, i, and type.

◆ BM_DisplayListDispatchByIteratorDefault()

static void flutter::BM_DisplayListDispatchByIteratorDefault ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 241 of file dl_builder_benchmarks.cc.

243 {
244 bool prepare_rtree = NeedPrepareRTree(type);
245 DisplayListBuilder builder(prepare_rtree);
246 for (int i = 0; i < 5; i++) {
247 InvokeAllOps(builder);
248 }
249 auto display_list = builder.Build();
250 DlOpReceiverIgnore receiver;
251 while (state.KeepRunning()) {
252 for (DlIndex i : *display_list) {
253 display_list->Dispatch(receiver, i);
254 }
255 }
256}

References flutter::DisplayListBuilder::Build(), i, and type.

◆ BM_DisplayListDispatchByVectorCull()

static void flutter::BM_DisplayListDispatchByVectorCull ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 293 of file dl_builder_benchmarks.cc.

295 {
296 bool prepare_rtree = NeedPrepareRTree(type);
297 DisplayListBuilder builder(prepare_rtree);
298 for (int i = 0; i < 5; i++) {
299 InvokeAllOps(builder);
300 }
301 auto display_list = builder.Build();
302 DlRect rect = DlRect::MakeLTRB(0, 0, 100, 100);
303 EXPECT_FALSE(rect.Contains(display_list->GetBounds()));
304 DlOpReceiverIgnore receiver;
305 while (state.KeepRunning()) {
306 std::vector<DlIndex> indices = display_list->GetCulledIndices(rect);
307 for (DlIndex index : indices) {
308 display_list->Dispatch(receiver, index);
309 }
310 }
311}

References flutter::DisplayListBuilder::Build(), impeller::TRect< T >::Contains(), i, impeller::TRect< Scalar >::MakeLTRB(), and type.

◆ BM_DisplayListDispatchByVectorDefault()

static void flutter::BM_DisplayListDispatchByVectorDefault ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 258 of file dl_builder_benchmarks.cc.

260 {
261 bool prepare_rtree = NeedPrepareRTree(type);
262 DisplayListBuilder builder(prepare_rtree);
263 for (int i = 0; i < 5; i++) {
264 InvokeAllOps(builder);
265 }
266 auto display_list = builder.Build();
267 DlOpReceiverIgnore receiver;
268 while (state.KeepRunning()) {
269 std::vector<DlIndex> indices =
270 display_list->GetCulledIndices(display_list->GetBounds());
271 for (DlIndex index : indices) {
272 display_list->Dispatch(receiver, index);
273 }
274 }
275}

References flutter::DisplayListBuilder::Build(), i, and type.

◆ BM_DisplayListDispatchCull()

static void flutter::BM_DisplayListDispatchCull ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 277 of file dl_builder_benchmarks.cc.

278 {
279 bool prepare_rtree = NeedPrepareRTree(type);
280 DisplayListBuilder builder(prepare_rtree);
281 for (int i = 0; i < 5; i++) {
282 InvokeAllOps(builder);
283 }
284 auto display_list = builder.Build();
285 DlRect rect = DlRect::MakeLTRB(0, 0, 100, 100);
286 EXPECT_FALSE(rect.Contains(display_list->GetBounds()));
287 DlOpReceiverIgnore receiver;
288 while (state.KeepRunning()) {
289 display_list->Dispatch(receiver, rect);
290 }
291}

References flutter::DisplayListBuilder::Build(), impeller::TRect< T >::Contains(), i, impeller::TRect< Scalar >::MakeLTRB(), and type.

◆ BM_DisplayListDispatchDefault()

static void flutter::BM_DisplayListDispatchDefault ( benchmark::State &  state,
DisplayListDispatchBenchmarkType  type 
)
static

Definition at line 208 of file dl_builder_benchmarks.cc.

210 {
211 bool prepare_rtree = NeedPrepareRTree(type);
212 DisplayListBuilder builder(prepare_rtree);
213 for (int i = 0; i < 5; i++) {
214 InvokeAllOps(builder);
215 }
216 auto display_list = builder.Build();
217 DlOpReceiverIgnore receiver;
218 while (state.KeepRunning()) {
219 display_list->Dispatch(receiver);
220 }
221}

References flutter::DisplayListBuilder::Build(), i, and type.

◆ BM_DlRegion_FromRects()

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

Definition at line 268 of file dl_region_benchmarks.cc.

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

◆ BM_DlRegion_GetRects()

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

Definition at line 276 of file dl_region_benchmarks.cc.

276 {
277 RunGetRectsBenchmark<DlRegionAdapter>(state, maxSize);
278}

◆ BM_DlRegion_IntersectsRegion()

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

Definition at line 302 of file dl_region_benchmarks.cc.

304 {
305 RunIntersectsRegionBenchmark<DlRegionAdapter>(state, maxSize, sizeFactor);
306}

◆ BM_DlRegion_IntersectsSingleRect()

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

Definition at line 314 of file dl_region_benchmarks.cc.

315 {
316 RunIntersectsSingleRectBenchmark<DlRegionAdapter>(state, maxSize);
317}

◆ BM_DlRegion_Operation()

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

Definition at line 284 of file dl_region_benchmarks.cc.

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

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

References transform, and type.

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

References transform, and type.

◆ BM_PlatformMessageResponseDartComplete()

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

Definition at line 21 of file ui_benchmarks.cc.

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

References flutter::DartVMRef::Create(), flutter::testing::DartFixture::CreateSettingsForFixture(), data, FML_CHECK, flutter::testing::GetDefaultKernelFilePath(), flutter::TaskRunners::GetUITaskRunner(), flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, message, flutter::ThreadHost::platform_thread, fml::TaskRunner::PostTask(), flutter::ThreadHost::raster_thread, flutter::testing::RunDartCodeInIsolate(), and flutter::ThreadHost::ui_thread.

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

References transform, and type.

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

References transform, and type.

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

References transform, and type.

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

References transform, and type.

◆ BM_ShellInitialization()

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

Definition at line 101 of file shell_benchmarks.cc.

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

References StartupAndShutdownShell().

◆ BM_ShellInitializationAndShutdown()

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

Definition at line 117 of file shell_benchmarks.cc.

117 {
118 while (state.KeepRunning()) {
119 StartupAndShutdownShell(state, true, true);
120 }
121}

References StartupAndShutdownShell().

◆ BM_ShellShutdown()

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

Definition at line 109 of file shell_benchmarks.cc.

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

References StartupAndShutdownShell().

◆ BM_SkRegion_FromRects()

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

Definition at line 272 of file dl_region_benchmarks.cc.

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

◆ BM_SkRegion_GetRects()

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

Definition at line 280 of file dl_region_benchmarks.cc.

280 {
281 RunGetRectsBenchmark<SkRegionAdapter>(state, maxSize);
282}

◆ BM_SkRegion_IntersectsRegion()

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

Definition at line 308 of file dl_region_benchmarks.cc.

310 {
311 RunIntersectsRegionBenchmark<SkRegionAdapter>(state, maxSize, sizeFactor);
312}

◆ BM_SkRegion_IntersectsSingleRect()

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

Definition at line 319 of file dl_region_benchmarks.cc.

320 {
321 RunIntersectsSingleRectBenchmark<SkRegionAdapter>(state, maxSize);
322}

◆ BM_SkRegion_Operation()

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

Definition at line 293 of file dl_region_benchmarks.cc.

297 {
298 RunRegionOpBenchmark<SkRegionAdapter>(state, op, withSingleRect, maxSize,
299 sizeFactor);
300}

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

References transform, and type.

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

References transform, and type.

◆ 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}
std::vector< Point > points

References FML_CHECK, i, points, transform, and type.

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

References transform, and type.

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

References transform, and type.

◆ 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(DlPoint);
27 if (flags.has_texture_coordinates) {
28 needed += vertex_count * sizeof(DlPoint);
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:69

Referenced by flutter::DlVertices::Builder::Builder(), and flutter::DlVertices::size().

◆ 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
std::unique_ptr< std::vector< uint8_t > > EncodeMessage(const T &message) const

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

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ 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());
73 EXPECT_TRUE(std::equal(
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}

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

Referenced by TEST().

◆ ChooseCompatibleAlphaType()

static SkAlphaType flutter::ChooseCompatibleAlphaType ( SkAlphaType  type)
static

Definition at line 127 of file image_decoder_impeller.cc.

127 {
128 return type;
129}

References type.

Referenced by flutter::ImageDecoderImpeller::DecompressTexture().

◆ ChooseCompatibleColorType()

static SkColorType flutter::ChooseCompatibleColorType ( SkColorType  type)
static

Definition at line 118 of file image_decoder_impeller.cc.

118 {
119 switch (type) {
120 case kRGBA_F32_SkColorType:
121 return kRGBA_F16_SkColorType;
122 default:
123 return kRGBA_8888_SkColorType;
124 }
125}

References type.

Referenced by flutter::ImageDecoderImpeller::DecompressTexture().

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

Referenced by flutter::AndroidContextGLSkia::AndroidContextGLSkia().

◆ CleanupMessageData()

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

Definition at line 484 of file platform_view_android_jni_impl.cc.

486 {
487 // Called from any thread.
488 free(reinterpret_cast<void*>(message_data));
489}

Referenced by RegisterApi().

◆ Close()

API void flutter::Close ( SkPath *  path)

Definition at line 36 of file path_ops.cc.

36 {
37 path->close();
38}
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 switch_defs.h:52

References path.

◆ CommandLineFromNSProcessInfo()

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

Definition at line 13 of file command_line.mm.

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

References fml::CommandLineFromIterators().

Referenced by FlutterDartProject::defaultBundleIdentifier.

◆ CompareOps()

static bool flutter::CompareOps ( const DisplayListStorage storageA,
const std::vector< size_t > &  offsetsA,
const DisplayListStorage storageB,
const std::vector< size_t > &  offsetsB 
)
static

Definition at line 401 of file display_list.cc.

404 {
405 const uint8_t* base_a = storageA.base();
406 const uint8_t* base_b = storageB.base();
407 // These conditions are checked by the caller...
408 FML_DCHECK(offsetsA.size() == offsetsB.size());
409 FML_DCHECK(base_a != base_b);
410 size_t bulk_start = 0u;
411 for (size_t i = 0; i < offsetsA.size(); i++) {
412 size_t offset = offsetsA[i];
413 FML_DCHECK(offsetsB[i] == offset);
414 auto opA = reinterpret_cast<const DLOp*>(base_a + offset);
415 auto opB = reinterpret_cast<const DLOp*>(base_b + offset);
416 if (opA->type != opB->type) {
417 return false;
418 }
419 DisplayListCompare result;
420 switch (opA->type) {
421#define DL_OP_EQUALS(name) \
422 case DisplayListOpType::k##name: \
423 result = static_cast<const name##Op*>(opA)->equals( \
424 static_cast<const name##Op*>(opB)); \
425 break;
426
428
429#undef DL_OP_EQUALS
430
431 default:
432 FML_DCHECK(false);
433 return false;
434 }
435 switch (result) {
436 case DisplayListCompare::kNotEqual:
437 return false;
438 case DisplayListCompare::kUseBulkCompare:
439 break;
440 case DisplayListCompare::kEqual:
441 // Check if we have a backlog of bytes to bulk compare and then
442 // reset the bulk compare pointers to the address following this op
443 if (bulk_start < offset) {
444 const uint8_t* bulk_start_a = base_a + bulk_start;
445 const uint8_t* bulk_start_b = base_b + bulk_start;
446 if (memcmp(bulk_start_a, bulk_start_b, offset - bulk_start) != 0) {
447 return false;
448 }
449 }
450 bulk_start =
451 i + 1 < offsetsA.size() ? offsetsA[i + 1] : storageA.size();
452 break;
453 }
454 }
455 if (bulk_start < storageA.size()) {
456 // Perform a final bulk compare if we have remaining bytes waiting
457 const uint8_t* bulk_start_a = base_a + bulk_start;
458 const uint8_t* bulk_start_b = base_b + bulk_start;
459 if (memcmp(bulk_start_a, bulk_start_b, storageA.size() - bulk_start) != 0) {
460 return false;
461 }
462 }
463 return true;
464}
uint8_t * base()
Returns a pointer to the base of the storage.
Definition dl_storage.h:23
size_t size() const
Returns the currently allocated size.
Definition dl_storage.h:27
#define DL_OP_EQUALS(name)
#define FML_DCHECK(condition)
Definition logging.h:122

References flutter::DisplayListStorage::base(), DL_OP_EQUALS, FML_DCHECK, FOR_EACH_DISPLAY_LIST_OP, i, kEqual, kNotEqual, kUseBulkCompare, and flutter::DisplayListStorage::size().

Referenced by flutter::DisplayList::Equals().

◆ compute_bounds()

static DlRect flutter::compute_bounds ( const DlPoint points,
int  count 
)
static

Definition at line 92 of file dl_vertices.cc.

92 {
93 AccumulationRect accumulator;
94 for (int i = 0; i < count; i++) {
95 accumulator.accumulate(points[i]);
96 }
97 return accumulator.GetBounds();
98}
void accumulate(DlScalar x, DlScalar y)

References flutter::AccumulationRect::accumulate(), flutter::AccumulationRect::GetBounds(), i, and points.

Referenced by flutter::DlVertices::Builder::build().

◆ ConfigureShell()

static void flutter::ConfigureShell ( Shell shell)
static

Definition at line 128 of file tester_main.cc.

128 {
129 auto device_pixel_ratio = 3.0;
130 auto physical_width = 2400.0; // 800 at 3x resolution.
131 auto physical_height = 1800.0; // 600 at 3x resolution.
132
133 std::vector<std::unique_ptr<Display>> displays;
134 displays.push_back(std::make_unique<Display>(
135 0, 60, physical_width, physical_height, device_pixel_ratio));
136 shell->OnDisplayUpdates(std::move(displays));
137
138 flutter::ViewportMetrics metrics{};
139 metrics.device_pixel_ratio = device_pixel_ratio;
140 metrics.physical_width = physical_width;
141 metrics.physical_height = physical_height;
142 metrics.display_id = 0;
143 metrics.physical_min_width_constraint = physical_width;
144 metrics.physical_max_width_constraint = physical_width;
145 metrics.physical_min_height_constraint = physical_height;
146 metrics.physical_max_height_constraint = physical_height;
147 shell->GetPlatformView()->SetViewportMetrics(kImplicitViewId, metrics);
148}
void OnDisplayUpdates(std::vector< std::unique_ptr< Display > > displays)
Notifies the display manager of the updates.
Definition shell.cc:2381
fml::WeakPtr< PlatformView > GetPlatformView()
Platform views may only be accessed on the platform task runner.
Definition shell.cc:930
static constexpr FlutterViewId kImplicitViewId
std::vector< FlutterEngineDisplay > * displays

References flutter::ViewportMetrics::device_pixel_ratio, displays, flutter::Shell::GetPlatformView(), kImplicitViewId, and flutter::Shell::OnDisplayUpdates().

Referenced by RunTester(), and Spawn().

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

References FML_DCHECK.

Referenced by flutter::testing::TEST().

◆ 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 =
49 image->makeRasterImage(resource_context.get())) {
50 // The image can be converted to a raster image.
51 encode_task(raster_image);
52 return;
53 }
54 }
55
56 if (!raster_task_runner) {
57 FML_LOG(ERROR) << "Raster task runner was null.";
58 encode_task(nullptr);
59 return;
60 }
61
62 if (!io_task_runner) {
63 FML_LOG(ERROR) << "IO task runner was null.";
64 encode_task(nullptr);
65 return;
66 }
67
68 // Cross-context images do not support makeRasterImage. Convert these images
69 // by drawing them into a surface. This must be done on the raster thread
70 // to prevent concurrent usage of the image on both the IO and raster threads.
71 raster_task_runner->PostTask([dl_image, encode_task = std::move(encode_task),
72 resource_context, snapshot_delegate,
73 io_task_runner, is_gpu_disabled_sync_switch,
74 raster_task_runner]() {
75 auto image = dl_image->skia_image();
76 if (!image || !snapshot_delegate) {
77 io_task_runner->PostTask(
78 [encode_task = encode_task]() mutable { encode_task(nullptr); });
79 return;
80 }
81
82 sk_sp<SkImage> raster_image =
83 snapshot_delegate->ConvertToRasterImage(image);
84
85 io_task_runner->PostTask([image, encode_task = encode_task,
86 raster_image = std::move(raster_image),
87 resource_context, is_gpu_disabled_sync_switch,
88 owning_context = dl_image->owning_context(),
89 raster_task_runner]() mutable {
90 if (!raster_image) {
91 // The rasterizer was unable to render the cross-context image
92 // (presumably because it does not have a GrContext). In that case,
93 // convert the image on the IO thread using the resource context.
95 image, resource_context, is_gpu_disabled_sync_switch);
96 }
97 encode_task(raster_image);
98 if (owning_context == DlImage::OwningContext::kRaster) {
99 raster_task_runner->PostTask([image = std::move(image)]() {});
100 }
101 });
102 });
103}
virtual void PostTask(const fml::closure &task) override
T * get() const
Definition weak_ptr.h:87
FlutterVulkanImage * image
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)

References ConvertToRasterUsingResourceContext(), FML_LOG, fml::WeakPtr< T >::get(), image, and flutter::DlImage::kRaster.

◆ ConvertMappingToNSData()

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

Definition at line 34 of file buffer_conversions.mm.

34 {
35 size_t size = buffer.GetSize();
36 return [NSData dataWithBytesNoCopy:buffer.Release() length:size];
37}
size_t length
it will be possible to load the file into Perfetto s trace viewer use test 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 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
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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring buffer
Definition switch_defs.h:98

References buffer, length, fml::RefCountedThreadSafe< T >::Release(), and size.

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

◆ ConvertMutation() [1/4]

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

Definition at line 119 of file embedder_layers.cc.

120 {
121 FlutterPlatformViewMutation mutation = {};
123 mutation.transformation.scaleX = matrix.m[0];
124 mutation.transformation.skewX = matrix.m[4];
125 mutation.transformation.transX = matrix.m[12];
126 mutation.transformation.skewY = matrix.m[1];
127 mutation.transformation.scaleY = matrix.m[5];
128 mutation.transformation.transY = matrix.m[13];
129 mutation.transformation.pers0 = matrix.m[3];
130 mutation.transformation.pers1 = matrix.m[7];
131 mutation.transformation.pers2 = matrix.m[15];
132 return std::make_unique<FlutterPlatformViewMutation>(mutation);
133}
@ kFlutterPlatformViewMutationTypeTransformation
Definition embedder.h:2009
FlutterTransformation transformation
Definition embedder.h:2019
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition embedder.h:2014
double transY
vertical translation
Definition embedder.h:400
double pers2
perspective scale factor
Definition embedder.h:406
double skewX
horizontal skew factor
Definition embedder.h:392
double pers0
input x-axis perspective factor
Definition embedder.h:402
double scaleX
horizontal scale factor
Definition embedder.h:390
double skewY
vertical skew factor
Definition embedder.h:396
double scaleY
vertical scale factor
Definition embedder.h:398
double pers1
input y-axis perspective factor
Definition embedder.h:404
double transX
horizontal translation
Definition embedder.h:394
Scalar m[16]
Definition matrix.h:39

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

◆ ConvertMutation() [2/4]

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

Definition at line 80 of file embedder_layers.cc.

81 {
82 FlutterPlatformViewMutation mutation = {};
84 mutation.clip_rect.left = rect.GetLeft();
85 mutation.clip_rect.top = rect.GetTop();
86 mutation.clip_rect.right = rect.GetRight();
87 mutation.clip_rect.bottom = rect.GetBottom();
88 return std::make_unique<FlutterPlatformViewMutation>(mutation);
89}
@ kFlutterPlatformViewMutationTypeClipRect
Definition embedder.h:2003
double bottom
Definition embedder.h:645
double top
Definition embedder.h:643
double left
Definition embedder.h:642
double right
Definition embedder.h:644
constexpr auto GetBottom() const
Definition rect.h:357
constexpr auto GetTop() const
Definition rect.h:353
constexpr auto GetLeft() const
Definition rect.h:351
constexpr auto GetRight() const
Definition rect.h:355

References FlutterRect::bottom, FlutterPlatformViewMutation::clip_rect, impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), kFlutterPlatformViewMutationTypeClipRect, FlutterRect::left, FlutterRect::right, FlutterRect::top, and FlutterPlatformViewMutation::type.

◆ ConvertMutation() [3/4]

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

Definition at line 98 of file embedder_layers.cc.

99 {
100 FlutterPlatformViewMutation mutation = {};
102 const auto& rect = rrect.GetBounds();
103 mutation.clip_rounded_rect.rect.left = rect.GetLeft();
104 mutation.clip_rounded_rect.rect.top = rect.GetTop();
105 mutation.clip_rounded_rect.rect.right = rect.GetRight();
106 mutation.clip_rounded_rect.rect.bottom = rect.GetBottom();
107 const auto& radii = rrect.GetRadii();
109 ConvertSize(radii.top_left);
111 ConvertSize(radii.top_right);
113 ConvertSize(radii.bottom_right);
115 ConvertSize(radii.bottom_left);
116 return std::make_unique<FlutterPlatformViewMutation>(mutation);
117}
@ kFlutterPlatformViewMutationTypeClipRoundedRect
Definition embedder.h:2006
FlutterRoundedRect clip_rounded_rect
Definition embedder.h:2018
FlutterRect rect
Definition embedder.h:656
FlutterSize upper_left_corner_radius
Definition embedder.h:657
FlutterSize lower_left_corner_radius
Definition embedder.h:660
FlutterSize upper_right_corner_radius
Definition embedder.h:658
FlutterSize lower_right_corner_radius
Definition embedder.h:659
constexpr const RoundingRadii & GetRadii() const
Definition round_rect.h:55
constexpr const Rect & GetBounds() const
Definition round_rect.h:53

References FlutterRect::bottom, FlutterPlatformViewMutation::clip_rounded_rect, ConvertSize(), impeller::RoundRect::GetBounds(), impeller::RoundRect::GetRadii(), kFlutterPlatformViewMutationTypeClipRoundedRect, FlutterRect::left, FlutterRoundedRect::lower_left_corner_radius, FlutterRoundedRect::lower_right_corner_radius, FlutterRoundedRect::rect, FlutterRect::right, FlutterRect::top, FlutterPlatformViewMutation::type, FlutterRoundedRect::upper_left_corner_radius, and FlutterRoundedRect::upper_right_corner_radius.

◆ ConvertMutation() [4/4]

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

Definition at line 72 of file embedder_layers.cc.

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

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

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

◆ ConvertNSDataToMappingPtr()

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

Definition at line 39 of file buffer_conversions.mm.

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

References data.

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

◆ ConvertSize()

static FlutterSize flutter::ConvertSize ( const DlSize vector)
static

Definition at line 91 of file embedder_layers.cc.

91 {
92 FlutterSize size = {};
93 size.width = vector.width;
94 size.height = vector.height;
95 return size;
96}
A structure to represent the width and height.
Definition embedder.h:627
Type height
Definition size.h:29
Type width
Definition size.h:28

References impeller::TSize< T >::height, size, impeller::TSize< T >::width, and FlutterSize::width.

Referenced by ConvertMutation().

◆ 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}
const char * language_code
Definition embedder.h:2259
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition embedder.h:2255
const char * script_code
Definition embedder.h:2269
const char * country_code
Definition embedder.h:2264
const char * variant_code
Definition embedder.h:2274

References FlutterLocale::country_code, FlutterLocale::language_code, FlutterLocale::script_code, FlutterLocale::struct_size, and FlutterLocale::variant_code.

Referenced by SetUpLocales().

◆ 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 {
22 sk_sp<SkSurface> surface;
23 SkImageInfo surface_info = SkImageInfo::MakeN32Premul(image->dimensions());
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) {
32 surface = SkSurfaces::RenderTarget(
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(resource_context.get());
57}
VkSurfaceKHR surface
Definition main.cc:65

References FML_LOG, fml::WeakPtr< T >::get(), image, and surface.

Referenced by ConvertImageToRasterSkia(), and flutter::testing::TEST_F().

◆ CopyMappingPtrToNSData()

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

Definition at line 43 of file buffer_conversions.mm.

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

References length.

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

◆ CopyNSDataToMapping()

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

Definition at line 29 of file buffer_conversions.mm.

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

References fml::MallocMapping::Copy(), and data.

◆ CopyV() [1/2]

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

Definition at line 23 of file dl_builder.cc.

23{}

Referenced by CopyV().

◆ 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 26 of file dl_builder.cc.

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

References CopyV(), and FML_DCHECK.

◆ CreateAndroidContext()

static std::shared_ptr< flutter::AndroidContext > flutter::CreateAndroidContext ( const flutter::TaskRunners task_runners,
AndroidRenderingAPI  android_rendering_api,
bool  enable_opengl_gpu_tracing,
const AndroidContext::ContextSettings settings 
)
static

Definition at line 109 of file platform_view_android.cc.

113 {
114 switch (android_rendering_api) {
115#if !SLIMPELLER
116 case AndroidRenderingAPI::kSoftware:
117 return std::make_shared<AndroidContext>(AndroidRenderingAPI::kSoftware);
118 case AndroidRenderingAPI::kSkiaOpenGLES:
119 return std::make_unique<AndroidContextGLSkia>(
120 fml::MakeRefCounted<AndroidEnvironmentGL>(), //
121 task_runners //
122 );
123#endif // !SLIMPELLER
124 case AndroidRenderingAPI::kImpellerVulkan:
125 return std::make_unique<AndroidContextVKImpeller>(settings);
126 case AndroidRenderingAPI::kImpellerOpenGLES:
127 return std::make_unique<AndroidContextGLImpeller>(
128 std::make_unique<impeller::egl::Display>(),
129 enable_opengl_gpu_tracing);
130 case AndroidRenderingAPI::kImpellerAutoselect:
131 // Determine if we're using GL or Vulkan.
132 return std::make_unique<AndroidContextDynamicImpeller>(settings);
133 }
135}
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE, kImpellerAutoselect, kImpellerOpenGLES, kImpellerVulkan, kSkiaOpenGLES, and kSoftware.

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

Referenced by flutter::AndroidContextGLSkia::AndroidContextGLSkia().

◆ 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,
const fml::RefPtr< SkiaUnrefQueue > &  unref_queue 
)
static

Definition at line 58 of file picture.cc.

65 {
66#if IMPELLER_SUPPORTS_RENDERING
67 if (impeller) {
68 return DlDeferredImageGPUImpeller::Make(
69 std::move(display_list), DlISize(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(
79 width, height, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
80 return DlDeferredImageGPUSkia::Make(image_info, std::move(display_list),
81 std::move(snapshot_delegate),
82 raster_task_runner, unref_queue);
83#endif // !SLIMPELLER
84}
int32_t height
int32_t width

References FML_LOG, height, flutter::DlDeferredImageGPUSkia::Make(), flutter::DlDeferredImageGPUImpeller::Make(), and width.

◆ 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,
const 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,
95 kRGBA_8888_SkColorType, kPremul_SkAlphaType);
96 return DlDeferredImageGPUSkia::MakeFromLayerTree(
97 image_info, std::move(layer_tree), std::move(snapshot_delegate),
98 raster_task_runner, unref_queue);
99#endif // SLIMPELLER
100}

References FML_LOG, flutter::DlDeferredImageGPUImpeller::Make(), and flutter::DlDeferredImageGPUSkia::MakeFromLayerTree().

Referenced by flutter::Picture::RasterizeToImageSync().

◆ 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 33 of file embedder_thread_host.cc.

33 {
34 if (description == nullptr) {
35 // This is not embedder error. The embedder API will just have to create a
36 // plain old task runner (and create a thread for it) instead of using a
37 // task runner provided to us by the embedder.
38 return {true, {}};
39 }
40
41 if (SAFE_ACCESS(description, runs_task_on_current_thread_callback, nullptr) ==
42 nullptr) {
43 FML_LOG(ERROR) << "FlutterTaskRunnerDescription.runs_task_on_current_"
44 "thread_callback was nullptr.";
45 return {false, {}};
46 }
47
48 if (SAFE_ACCESS(description, post_task_callback, nullptr) == nullptr) {
49 FML_LOG(ERROR)
50 << "FlutterTaskRunnerDescription.post_task_callback was nullptr.";
51 return {false, {}};
52 }
53
54 auto user_data = SAFE_ACCESS(description, user_data, nullptr);
55
56 // ABI safety checks have been completed.
57 auto post_task_callback_c = description->post_task_callback;
58 auto runs_task_on_current_thread_callback_c =
60
61 VoidCallback destruction_callback_c = [](void* user_data) {};
62 if (SAFE_ACCESS(description, destruction_callback, nullptr) != nullptr) {
63 destruction_callback_c = description->destruction_callback;
64 }
65
66 EmbedderTaskRunner::DispatchTable task_runner_dispatch_table = {
67 .post_task_callback = [post_task_callback_c, user_data](
68 EmbedderTaskRunner* task_runner,
69 uint64_t task_baton,
70 fml::TimePoint target_time) -> void {
71 FlutterTask task = {
72 // runner
73 reinterpret_cast<FlutterTaskRunner>(task_runner->unique_id()),
74 // task
75 task_baton,
76 };
77 post_task_callback_c(task, target_time.ToEpochDelta().ToNanoseconds(),
78 user_data);
79 },
80 .runs_task_on_current_thread_callback =
81 [runs_task_on_current_thread_callback_c, user_data]() -> bool {
82 return runs_task_on_current_thread_callback_c(user_data);
83 },
84 .destruction_callback =
85 [destruction_callback_c, user_data]() {
86 destruction_callback_c(user_data);
87 },
88 };
89
90 return {true, fml::MakeRefCounted<EmbedderTaskRunner>(
91 task_runner_dispatch_table,
92 SAFE_ACCESS(description, identifier, 0u))};
93}
void(* VoidCallback)(void *)
Definition embedder.h:409
struct _FlutterTaskRunner * FlutterTaskRunner
Definition embedder.h:1846
#define SAFE_ACCESS(pointer, member, default_value)
BoolCallback runs_task_on_current_thread_callback
Definition embedder.h:1870
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition embedder.h:1881
VoidCallback destruction_callback
The callback invoked when the task runner is destroyed.
Definition embedder.h:1886

References FlutterTaskRunnerDescription::destruction_callback, FML_LOG, FlutterTaskRunnerDescription::post_task_callback, flutter::EmbedderTaskRunner::DispatchTable::post_task_callback, FlutterTaskRunnerDescription::runs_task_on_current_thread_callback, SAFE_ACCESS, and user_data.

◆ CreateFinishedBuildRecorder() [1/2]

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

Definition at line 160 of file rasterizer_unittests.cc.

160 {
162}
static TimePoint Now()
Definition time_point.cc:49
static std::unique_ptr< FrameTimingsRecorder > CreateFinishedBuildRecorder(fml::TimePoint timestamp)

References CreateFinishedBuildRecorder(), and fml::TimePoint::Now().

Referenced by CreateFinishedBuildRecorder(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ CreateFinishedBuildRecorder() [2/2]

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

Definition at line 150 of file rasterizer_unittests.cc.

151 {
152 std::unique_ptr<FrameTimingsRecorder> recorder =
153 std::make_unique<FrameTimingsRecorder>();
154 recorder->RecordVsync(timestamp, timestamp);
155 recorder->RecordBuildStart(timestamp);
156 recorder->RecordBuildEnd(timestamp);
157 return recorder;
158}

◆ CreateFlutterViewID()

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

Definition at line 229 of file service_protocol.cc.

229 {
230 std::stringstream stream;
231 stream << kViewIdPrefx << "0x" << std::hex << handler;
232 return stream.str();
233}
const gchar FlBinaryMessengerMessageHandler handler
static constexpr std::string_view kViewIdPrefx

References handler, and kViewIdPrefx.

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

◆ CreateGLInterface()

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

Definition at line 84 of file gpu_surface_gl_delegate.cc.

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

References FML_LOG, and IsProcResolverOpenGLES().

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

◆ CreateImpellerContext() [1/2]

static std::shared_ptr< impeller::Context > flutter::CreateImpellerContext ( const fml::RefPtr< fml::NativeLibrary > &  vulkan_dylib,
const AndroidContext::ContextSettings p_settings 
)
static

Definition at line 18 of file android_context_vk_impeller.cc.

20 {
21 if (!vulkan_dylib) {
22 VALIDATION_LOG << "Could not open the Vulkan dylib.";
23 return nullptr;
24 }
25
26 std::vector<std::shared_ptr<fml::Mapping>> shader_mappings = {
27 std::make_shared<fml::NonOwnedMapping>(impeller_entity_shaders_vk_data,
28 impeller_entity_shaders_vk_length),
29 std::make_shared<fml::NonOwnedMapping>(
30 impeller_framebuffer_blend_shaders_vk_data,
31 impeller_framebuffer_blend_shaders_vk_length),
32 std::make_shared<fml::NonOwnedMapping>(impeller_modern_shaders_vk_data,
33 impeller_modern_shaders_vk_length),
34 };
35
36 auto instance_proc_addr =
37 vulkan_dylib->ResolveFunction<PFN_vkGetInstanceProcAddr>(
38 "vkGetInstanceProcAddr");
39
40 if (!instance_proc_addr.has_value()) {
41 VALIDATION_LOG << "Could not setup Vulkan proc table.";
42 return nullptr;
43 }
44
46 settings.proc_address_callback = instance_proc_addr.value();
47 settings.shader_libraries_data = std::move(shader_mappings);
49 settings.enable_validation = p_settings.enable_validation;
50 settings.enable_gpu_tracing = p_settings.enable_gpu_tracing;
52 settings.flags = p_settings.impeller_flags;
53
54 auto context = impeller::ContextVK::Create(std::move(settings));
55
56 if (!p_settings.quiet) {
57 if (context && impeller::CapabilitiesVK::Cast(*context->GetCapabilities())
59 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (Vulkan with "
60 "Validation Layers).";
61 } else {
62 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (Vulkan).";
63 }
64 }
65 if (context && context->GetDriverInfo()->IsKnownBadDriver()) {
66 FML_LOG(INFO)
67 << "Known bad Vulkan driver encountered, falling back to OpenGLES.";
68 return nullptr;
69 }
70
71 return context;
72}
const std::optional< T > ResolveFunction(const char *symbol)
static CapabilitiesVK & Cast(Capabilities &base)
static std::shared_ptr< ContextVK > Create(Settings settings)
fml::UniqueFD GetCachesDirectory()
std::vector< std::shared_ptr< fml::Mapping > > shader_libraries_data
Definition context_vk.h:81
PFN_vkGetInstanceProcAddr proc_address_callback
Definition context_vk.h:80
#define VALIDATION_LOG
Definition validation.h:91

References impeller::CapabilitiesVK::AreValidationsEnabled(), impeller::ContextVK::Settings::cache_directory, impeller::BackendCast< CapabilitiesVK, Capabilities >::Cast(), impeller::ContextVK::Create(), impeller::ContextVK::Settings::enable_gpu_tracing, flutter::AndroidContext::ContextSettings::enable_gpu_tracing, impeller::ContextVK::Settings::enable_surface_control, flutter::AndroidContext::ContextSettings::enable_surface_control, impeller::ContextVK::Settings::enable_validation, flutter::AndroidContext::ContextSettings::enable_validation, impeller::ContextVK::Settings::flags, FML_LOG, fml::paths::GetCachesDirectory(), flutter::AndroidContext::ContextSettings::impeller_flags, impeller::ContextVK::Settings::proc_address_callback, flutter::AndroidContext::ContextSettings::quiet, impeller::ContextVK::Settings::shader_libraries_data, and VALIDATION_LOG.

◆ 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 std::vector<std::shared_ptr<fml::Mapping>> gles2_shader_mappings = {
63 std::make_shared<fml::NonOwnedMapping>(
64 impeller_entity_shaders_gles_data,
65 impeller_entity_shaders_gles_length),
66 std::make_shared<fml::NonOwnedMapping>(
67 impeller_framebuffer_blend_shaders_gles_data,
68 impeller_framebuffer_blend_shaders_gles_length),
69 };
70
71// To maximally reduce code size, only load the older GLES2 shaders.
72#if !SLIMPELLER
73 bool is_gles3 = proc_table->GetDescription()->GetGlVersion().IsAtLeast(
74 impeller::Version{3, 0, 0});
75
76 std::vector<std::shared_ptr<fml::Mapping>> gles3_shader_mappings = {
77 std::make_shared<fml::NonOwnedMapping>(
78 impeller_entity_shaders_gles3_data,
79 impeller_entity_shaders_gles3_length),
80 std::make_shared<fml::NonOwnedMapping>(
81 impeller_framebuffer_blend_shaders_gles3_data,
82 impeller_framebuffer_blend_shaders_gles3_length),
83 };
84
85 auto context = impeller::ContextGLES::Create(
86 impeller::Flags{}, std::move(proc_table),
87 is_gles3 ? gles3_shader_mappings : gles2_shader_mappings,
88 enable_gpu_tracing);
89#else
90 auto context =
91 impeller::ContextGLES::Create(impeller::Flags{}, std::move(proc_table),
92 gles2_shader_mappings, enable_gpu_tracing);
93#endif // !SLIMPELLER
94
95 if (!context) {
96 FML_LOG(ERROR) << "Could not create OpenGLES Impeller Context.";
97 return nullptr;
98 }
99
100 if (!context->AddReactorWorker(worker).has_value()) {
101 FML_LOG(ERROR) << "Could not add reactor worker.";
102 return nullptr;
103 }
104 FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (OpenGLES).";
105 return context;
106}
static std::shared_ptr< ContextGLES > Create(const Flags &flags, std::unique_ptr< ProcTableGLES > gl, const std::vector< std::shared_ptr< fml::Mapping > > &shader_libraries, bool enable_gpu_tracing)
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

References impeller::ContextGLES::Create(), impeller::egl::CreateProcAddressResolver(), and FML_LOG.

◆ CreateIsolateID()

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

Definition at line 235 of file service_protocol.cc.

235 {
236 std::stringstream stream;
237 stream << "isolates/" << isolate;
238 return stream.str();
239}

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

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

References path.

◆ CreateSnapshotSurface()

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

Definition at line 20 of file offscreen_surface.cc.

21 {
22 const auto image_info = SkImageInfo::MakeN32Premul(size.width, size.height,
23 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}

References size.

Referenced by flutter::OffscreenSurface::OffscreenSurface().

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

References path.

◆ DartFileModifiedCallback()

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

Definition at line 121 of file dart_vm.cc.

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

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

◆ DartFileRecorderArgs()

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

Definition at line 83 of file dart_vm.cc.

83 {
84 std::ostringstream oss;
85 oss << "--timeline_recorder=perfettofile:" << path;
86 return oss.str();
87}

References path.

◆ DartOldGenHeapSizeArgs()

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

Definition at line 112 of file dart_vm.cc.

112 {
113 std::ostringstream oss;
114 oss << "--old_gen_heap_size=" << heap_size;
115 return oss.str();
116}

◆ DartPluginRegistrant_EnsureInitialized()

void flutter::DartPluginRegistrant_EnsureInitialized ( )

◆ DartTimelineTicksSinceEpoch()

fml::TimePoint flutter::DartTimelineTicksSinceEpoch ( )

Definition at line 34 of file dart_timestamp_provider.cc.

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

References flutter::DartTimestampProvider::Instance(), and flutter::DartTimestampProvider::Now().

Referenced by DartVMInitializer::Initialize().

◆ 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 SkSpan<uint8_t> outVerbs(data->verbs, verb_count);
63 path->getVerbs(outVerbs);
64 SkSpan<SkPoint> outPoints(reinterpret_cast<SkPoint*>(data->points),
65 point_count);
66 path->getPoints(outPoints);
67 return data;
68}

References data, and path.

Referenced by flutter::ImageLRU::AddImage(), flutter::ImageLRU::Clear(), flutter::DlPath::DlPath(), flutter::DlPath::DlPath(), flutter::DlPath::~DlPath(), and flutter::ImageLRU::~ImageLRU().

◆ decodeFontFeatures()

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

Definition at line 327 of file paragraph_builder.cc.

328 { // NOLINT
329 tonic::DartByteData byte_data(font_features_data);
330 FML_CHECK(byte_data.length_in_bytes() % kBytesPerFontFeature == 0);
331
332 size_t feature_count = byte_data.length_in_bytes() / kBytesPerFontFeature;
333 for (size_t feature_index = 0; feature_index < feature_count;
334 ++feature_index) {
335 size_t feature_offset = feature_index * kBytesPerFontFeature;
336 const char* feature_bytes =
337 static_cast<const char*>(byte_data.data()) + feature_offset;
338 std::string tag(feature_bytes, kFontFeatureTagLength);
339 int32_t value = *(reinterpret_cast<const int32_t*>(feature_bytes +
340 kFontFeatureTagLength));
341 font_features.SetFeature(tag, value);
342 }
343}
void SetFeature(const std::string &tag, int value)
int32_t value

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

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

◆ decodeFontVariations()

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

Definition at line 345 of file paragraph_builder.cc.

346 { // NOLINT
347 tonic::DartByteData byte_data(font_variations_data);
348 FML_CHECK(byte_data.length_in_bytes() % kBytesPerFontVariation == 0);
349
350 size_t variation_count = byte_data.length_in_bytes() / kBytesPerFontVariation;
351 for (size_t variation_index = 0; variation_index < variation_count;
352 ++variation_index) {
353 size_t variation_offset = variation_index * kBytesPerFontVariation;
354 const char* variation_bytes =
355 static_cast<const char*>(byte_data.data()) + variation_offset;
356 std::string tag(variation_bytes, kFontVariationTagLength);
357 float value = *(reinterpret_cast<const float*>(variation_bytes +
358 kFontVariationTagLength));
359 font_variations.SetAxisValue(tag, value);
360 }
361}
void SetAxisValue(const std::string &tag, float value)

References tonic::DartByteData::data(), FML_CHECK, tonic::DartByteData::length_in_bytes(), txt::FontVariations::SetAxisValue(), and value.

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

◆ 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 int32_t* int32_data = static_cast<const int32_t*>(byte_data.data());
180 int32_t mask = int32_data[0];
181
182 size_t int32_count = 1;
183 if (mask & kSFontWeightMask) {
184 paragraph_style.strut_font_weight = int32_data[int32_count++];
185 }
186 if (mask & kSFontStyleMask) {
187 paragraph_style.strut_font_style =
188 static_cast<txt::FontStyle>(int32_data[int32_count++]);
189 }
190
191 paragraph_style.strut_half_leading = mask & kSLeadingDistributionMask;
192
193 std::vector<float> float_data;
194 float_data.resize((byte_data.length_in_bytes() / 4) - int32_count);
195 memcpy(float_data.data(), int32_data + int32_count, float_data.size() * 4);
196 size_t float_count = 0;
197 if (mask & kSFontSizeMask) {
198 paragraph_style.strut_font_size = float_data[float_count++];
199 }
200 if (mask & kSHeightMask) {
201 paragraph_style.strut_height = float_data[float_count++];
202 paragraph_style.strut_has_height_override = true;
203 }
204 if (mask & kSLeadingMask) {
205 paragraph_style.strut_leading = float_data[float_count++];
206 }
207
208 // The boolean is stored as the last bit in the bitmask, as null
209 // and false have the same behavior.
210 paragraph_style.force_strut_height = mask & kSForceStrutHeightMask;
211
212 if (mask & kSFontFamilyMask) {
213 paragraph_style.strut_font_families = strut_font_families;
214 } else {
215 // Provide an empty font name so that the platform default font will be
216 // used.
217 paragraph_style.strut_font_families.push_back("");
218 }
219}
std::vector< std::string > strut_font_families
FontStyle
Definition font_style.h:10

References tonic::DartByteData::data(), txt::ParagraphStyle::force_strut_height, tonic::DartByteData::length_in_bytes(), txt::ParagraphStyle::strut_enabled, txt::ParagraphStyle::strut_font_families, txt::ParagraphStyle::strut_font_size, txt::ParagraphStyle::strut_font_style, txt::ParagraphStyle::strut_font_weight, txt::ParagraphStyle::strut_half_leading, txt::ParagraphStyle::strut_has_height_override, txt::ParagraphStyle::strut_height, and txt::ParagraphStyle::strut_leading.

◆ decodeTextShadows()

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

Definition at line 302 of file paragraph_builder.cc.

304 { // NOLINT
305 decoded_shadows.clear();
306
307 tonic::DartByteData byte_data(shadows_data);
308 FML_CHECK(byte_data.length_in_bytes() % kBytesPerShadow == 0);
309
310 const uint32_t* uint_data = static_cast<const uint32_t*>(byte_data.data());
311 const float* float_data = static_cast<const float*>(byte_data.data());
312
313 size_t shadow_count = byte_data.length_in_bytes() / kBytesPerShadow;
314 size_t shadow_count_offset = 0;
315 for (size_t shadow_index = 0; shadow_index < shadow_count; ++shadow_index) {
316 shadow_count_offset = shadow_index * kShadowPropertiesCount;
317 SkColor color =
318 uint_data[shadow_count_offset + kColorOffset] ^ kColorDefault;
319 decoded_shadows.emplace_back(
320 color,
321 SkPoint::Make(float_data[shadow_count_offset + kXOffset],
322 float_data[shadow_count_offset + kYOffset]),
323 float_data[shadow_count_offset + kBlurOffset]);
324 }
325}

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

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

◆ DEF_SWITCH() [1/18]

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

References DEF_SWITCH.

◆ DEF_SWITCH() [2/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 flutter::DEF_SWITCH ( DartFlags  ,
"dart-flags"  ,
"Flags passed directly to the Dart VM without being interpreted " "by the Flutter shell."   
)

◆ DEF_SWITCH() [3/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 flutter::DEF_SWITCH ( DeviceVMServicePort  ,
"vm-service-port"  ,
"A custom Dart VM Service port. The default is to pick a randomly " "available open port."   
)

◆ DEF_SWITCH() [4/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [5/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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode flutter::DEF_SWITCH ( DisableVMServicePublication  ,
"disable-vm-service-publication"  ,
"Disable mDNS Dart VM Service publication."   
)

◆ DEF_SWITCH() [6/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [7/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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode 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() [8/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [9/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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is new samples start overwriting the oldest ones This switch is only meaningful when set in conjunction with enable dart profiling flutter::DEF_SWITCH ( EndlessTraceBuffer  ,
"endless-trace-buffer"  ,
"Enable an endless trace buffer. The default is a ring buffer. " "This is useful when very old events need to viewed. For  example,
" "during application launch. Memory usage will continue to grow " "indefinitely however."   
)

◆ DEF_SWITCH() [10/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [11/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 flutter::DEF_SWITCH ( ICUSymbolPrefix  ,
"icu-symbol-prefix"  ,
"Prefix for the symbols representing ICU data linked into the " "Flutter library."   
)

◆ DEF_SWITCH() [12/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [13/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 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() [14/18]

it will be possible to load the file into Perfetto s trace viewer flutter::DEF_SWITCH ( ProfileMicrotasks  ,
"profile-microtasks"  ,
"Enable collection of information about each microtask. Information " "about completed microtasks will be written to the \"Microtask\" " "timeline stream. Information about queued microtasks will be " "accessible from Dart / Flutter DevTools."   
)

◆ DEF_SWITCH() [15/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [16/18]

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() [17/18]

it will be possible to load the file into Perfetto s trace viewer use test 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 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() [18/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 flutter::DEF_SWITCH ( VmSnapshotInstructions  ,
"vm-snapshot-instr"  ,
"The VM instructions snapshot that will be memory mapped as read " "and executable. SnapshotAssetPath must be present."   
)

◆ DeferredComponentInstallFailure()

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

Definition at line 649 of file platform_view_android_jni_impl.cc.

653 {
654 LoadLoadingUnitFailure(static_cast<intptr_t>(jLoadingUnitId),
655 fml::jni::JavaStringToString(env, jError),
656 static_cast<bool>(jTransient));
657}
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

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

Referenced by RegisterApi().

◆ 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);
69 auto info = SkImageInfo::Make(
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());
75 sk_sp<SkImage> image =
76 SkImages::RasterFromData(info, image_data, image_size.width() * 4);
77
78 return image;
79};

References data, FML_CHECK, image, and length.

◆ 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 70 of file path_ops.cc.

70 {
71 delete[] data->points;
72 delete[] data->verbs;
73 delete data;
74}

References data.

◆ DestroyJNI()

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

Definition at line 198 of file platform_view_android_jni_impl.cc.

198 {
200}
#define ANDROID_SHELL_HOLDER

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ DestroyPath()

API void flutter::DestroyPath ( SkPath *  path)

Definition at line 14 of file path_ops.cc.

14 {
15 delete path;
16}

References path.

◆ DestroyPathBuilder()

API void flutter::DestroyPathBuilder ( SkPath *  path)

◆ DispatchEmptyPlatformMessage()

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

Definition at line 472 of file platform_view_android_jni_impl.cc.

476 {
477 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage(
478 env, //
480 responseId //
481 );
482}
const gchar * channel

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

Referenced by RegisterApi().

◆ DispatchPlatformMessage()

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

Definition at line 456 of file platform_view_android_jni_impl.cc.

462 {
463 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage(
464 env, //
466 message, //
467 position, //
468 responseId //
469 );
470}

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

Referenced by RegisterApi(), and TEST_F().

◆ DispatchPointerDataPacket()

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

Definition at line 491 of file platform_view_android_jni_impl.cc.

495 {
496 uint8_t* data = static_cast<uint8_t*>(env->GetDirectBufferAddress(buffer));
497 auto packet = std::make_unique<flutter::PointerDataPacket>(data, position);
498 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPointerDataPacket(
499 std::move(packet));
500}

References ANDROID_SHELL_HOLDER, buffer, and data.

Referenced by RegisterApi().

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

508 {
509 ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction(
510 env, //
511 id, //
512 action, //
513 args, //
514 args_position //
515 );
516}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

References action, ANDROID_SHELL_HOLDER, and args.

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

◆ DisplayListBuilderBenchmarkAccessor()

DlOpReceiver & flutter::DisplayListBuilderBenchmarkAccessor ( DisplayListBuilder builder)

◆ DisplayListBuilderTestingAccessor()

DlOpReceiver & flutter::DisplayListBuilderTestingAccessor ( DisplayListBuilder builder)

Definition at line 36 of file display_list_unittests.cc.

36 {
37 return builder.asReceiver();
38}

Referenced by flutter::testing::DisplayListTestBase< BaseT >::ToReceiver().

◆ DisplayListBuilderTestingAttributes()

DlPaint flutter::DisplayListBuilderTestingAttributes ( DisplayListBuilder builder)

Definition at line 40 of file display_list_unittests.cc.

40 {
41 return builder.CurrentAttributes();
42}

Referenced by flutter::testing::DisplayListTestBase< BaseT >::check_defaults().

◆ DisplayListBuilderTestingLastOpIndex()

int flutter::DisplayListBuilderTestingLastOpIndex ( DisplayListBuilder builder)

Definition at line 44 of file display_list_unittests.cc.

44 {
45 return builder.LastOpIndex();
46}

Referenced by flutter::testing::TEST_F().

◆ DlGradientDeleter()

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

Definition at line 14 of file dl_color_source.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}

Referenced by flutter::DlColorSource::MakeConical(), flutter::DlColorSource::MakeConical(), flutter::DlColorSource::MakeLinear(), flutter::DlColorSource::MakeLinear(), flutter::DlColorSource::MakeRadial(), flutter::DlColorSource::MakeRadial(), flutter::DlColorSource::MakeSweep(), and flutter::DlColorSource::MakeSweep().

◆ DlScalarNearlyEqual()

constexpr bool flutter::DlScalarNearlyEqual ( DlScalar  x,
DlScalar  y,
DlScalar  tolerance = kEhCloseEnough 
)
inlineconstexpr

Definition at line 44 of file dl_geometry_types.h.

46 {
47 return impeller::ScalarNearlyEqual(x, y, tolerance);
48}
int32_t x
double y
constexpr bool ScalarNearlyEqual(Scalar x, Scalar y, Scalar tolerance=kEhCloseEnough)
Definition scalar.h:36

References impeller::ScalarNearlyEqual(), x, and y.

Referenced by flutter::DlBlurImageFilter::equals_(), and flutter::testing::SaveLayerBoundsExpector::saveLayer().

◆ DlScalarNearlyZero()

constexpr bool flutter::DlScalarNearlyZero ( DlScalar  x,
DlScalar  tolerance = kEhCloseEnough 
)
inlineconstexpr

Definition at line 39 of file dl_geometry_types.h.

40 {
41 return impeller::ScalarNearlyZero(x, tolerance);
42}
constexpr bool ScalarNearlyZero(Scalar x, Scalar tolerance=kEhCloseEnough)
Definition scalar.h:31

References impeller::ScalarNearlyZero(), and x.

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

Referenced by flutter::DlVertices::Builder::Builder().

◆ DrawCheckerboard()

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

Definition at line 32 of file paint_utils.cc.

32 {
33 // Draw a checkerboard
34 canvas->Save();
35 canvas->ClipRect(rect, DlClipOp::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
43 DlPaint paint;
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}
virtual void ClipRect(const DlRect &rect, DlClipOp clip_op=DlClipOp::kIntersect, bool is_aa=false)=0
virtual void DrawPaint(const DlPaint &paint)=0
virtual void DrawRect(const DlRect &rect, const DlPaint &paint)=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:115
DlPaint & setDrawStyle(DlDrawStyle style)
Definition dl_paint.h:93
DlPaint & setColorSource(std::nullptr_t source)
Definition dl_paint.h:131

References flutter::DlCanvas::ClipRect(), flutter::DlCanvas::DrawPaint(), flutter::DlCanvas::DrawRect(), kIntersect, kStroke, flutter::DlCanvas::Restore(), flutter::DlCanvas::Save(), flutter::DlPaint::setColor(), flutter::DlPaint::setColorSource(), flutter::DlPaint::setDrawStyle(), and flutter::DlPaint::setStrokeWidth().

Referenced by flutter::RasterCache::UpdateCacheEntry().

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

References type.

Referenced by FlutterStandardReaderWriter::readerWithData:.

◆ EmbedderInformationCallback()

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

Definition at line 235 of file dart_vm.cc.

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

◆ 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#if IMPELLER_SUPPORTS_RENDERING && FML_OS_IOS_SIMULATOR
182 if (canvas_image->image()->IsFakeImage()) {
183 sk_sp<SkData> data = SkData::MakeEmpty();
184 InvokeDataCallback(std::move(callback), data);
185 return Dart_Null();
186 }
187#endif // IMPELLER_SUPPORTS_RENDERING && FML_OS_IOS_SIMULATOR
188
189 const auto& task_runners = UIDartState::Current()->GetTaskRunners();
190
191 // The static leak checker gets confused by the use of fml::MakeCopyable.
192 // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
193 task_runners.GetIOTaskRunner()->PostTask(fml::MakeCopyable(
194 [callback = std::move(callback), image = canvas_image->image(),
195 image_format, ui_task_runner = task_runners.GetUITaskRunner(),
196 raster_task_runner = task_runners.GetRasterTaskRunner(),
197 io_task_runner = task_runners.GetIOTaskRunner(),
198 io_manager = UIDartState::Current()->GetIOManager(),
199 snapshot_delegate = UIDartState::Current()->GetSnapshotDelegate(),
200 is_impeller_enabled =
201 UIDartState::Current()->IsImpellerEnabled()]() mutable {
202 EncodeImageAndInvokeDataCallback(
203 image, std::move(callback), image_format, ui_task_runner,
204 raster_task_runner, io_task_runner,
205 io_manager->GetResourceContext(), snapshot_delegate,
206 io_manager->GetIsGpuDisabledSyncSwitch(),
207 io_manager->GetImpellerContext(), is_impeller_enabled);
208 }));
209
210 return Dart_Null();
211}
sk_sp< DlImage > image() const
Definition image.h:42
static DartState * Current()
Definition dart_state.cc:56
uint32_t uint32_t * format
FlutterDesktopBinaryReply callback
internal::CopyableLambda< T > MakeCopyable(T lambda)

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

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

◆ EncodeImage() [2/2]

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

Definition at line 213 of file image_encoding.cc.

214 {
215 TRACE_EVENT0("flutter", __FUNCTION__);
216
217 if (!raster_image) {
218 return fml::Status(fml::StatusCode::kInternal, "Missing raster image.");
219 }
220
221 switch (format) {
222 case kPNG: {
223 auto png_image = SkPngEncoder::Encode(nullptr, raster_image.get(), {});
224
225 if (png_image == nullptr) {
227 "Could not convert raster image to PNG.");
228 };
229 return png_image;
230 }
231 case kRawRGBA:
232 return CopyImageByteData(raster_image, kRGBA_8888_SkColorType,
233 kPremul_SkAlphaType);
234
235 case kRawStraightRGBA:
236 return CopyImageByteData(raster_image, kRGBA_8888_SkColorType,
237 kUnpremul_SkAlphaType);
238
239 case kRawUnmodified:
240 return CopyImageByteData(raster_image, raster_image->colorType(),
241 raster_image->alphaType());
243 return CopyImageByteData(raster_image, kRGBA_F32_SkColorType,
244 kUnpremul_SkAlphaType);
245 }
246
248 "Unknown error encoding image.");
249}
#define TRACE_EVENT0(category_group, name)

References format, fml::kInternal, kPNG, kRawExtendedRgba128, kRawRGBA, kRawStraightRGBA, kRawUnmodified, and TRACE_EVENT0.

◆ 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(
84 Dart_NewTypedData(Dart_TypedData_kFloat32, boxes.size() * 5));
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}
TextDirection direction
Definition paragraph.h:73

References txt::Paragraph::TextBox::direction, EncodeTextBoxes(), i, and txt::Paragraph::TextBox::rect.

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

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

References character, and FML_DCHECK.

Referenced by flutter::testing::TEST().

◆ Equals() [1/9]

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

Definition at line 50 of file dl_comparable.h.

51 {
52 return Equals(a.get(), b.get());
53}
bool Equals(const T *a, const U *b)

References Equals().

◆ Equals() [2/9]

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

Definition at line 61 of file dl_comparable.h.

61 {
62 return Equals(a.get(), b.get());
63}

References Equals().

◆ Equals() [3/9]

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

Definition at line 30 of file dl_comparable.h.

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

References Equals().

◆ Equals() [4/9]

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

Definition at line 56 of file dl_comparable.h.

56 {
57 return Equals(a.get(), b.get());
58}

References Equals().

◆ Equals() [5/9]

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

Definition at line 66 of file dl_comparable.h.

66 {
67 return Equals(a.get(), b.get());
68}

References Equals().

◆ Equals() [6/9]

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

Definition at line 35 of file dl_comparable.h.

35 {
36 return Equals(a.get(), b);
37}

References Equals().

◆ Equals() [7/9]

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

Definition at line 40 of file dl_comparable.h.

40 {
41 return Equals(a, b.get());
42}

References Equals().

◆ Equals() [8/9]

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

Definition at line 45 of file dl_comparable.h.

45 {
46 return Equals(a, b.get());
47}

References Equals().

◆ Equals() [9/9]

◆ FillAllIndices()

static void flutter::FillAllIndices ( std::vector< DlIndex > &  indices,
DlIndex  size 
)
static

Definition at line 363 of file display_list.cc.

363 {
364 indices.reserve(size);
365 for (DlIndex i = 0u; i < size; i++) {
366 indices.push_back(i);
367 }
368}
uint32_t DlIndex

References i, and size.

Referenced by flutter::DisplayList::GetCulledIndices().

◆ 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.
56 return InvokeDartPluginRegistrantIfAvailable(library);
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}
const char * dart_plugin_registrant_library_override
bool InvokeDartPluginRegistrantIfAvailable(Dart_Handle library_handle)
Dart_Handle ToDart(const T &object)

References dart_plugin_registrant_library_override, InvokeDartPluginRegistrantIfAvailable(), and tonic::ToDart().

Referenced by DartPluginRegistrant_EnsureInitialized(), and flutter::DartIsolate::RunFromLibrary().

◆ FirstSupportedColorType()

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

Definition at line 119 of file gpu_surface_gl_skia.cc.

120 {
121#define RETURN_IF_RENDERABLE(x, y) \
122 if (context->colorTypeSupportedAsSurface((x))) { \
123 *format = (y); \
124 return (x); \
125 }
126 RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GPU_GL_RGBA8);
127 RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GPU_GL_RGBA4);
128 RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GPU_GL_RGB565);
129 return kUnknown_SkColorType;
130}
#define GPU_GL_RGBA4
#define GPU_GL_RGB565
#define GPU_GL_RGBA8
#define RETURN_IF_RENDERABLE(x, y)

References GPU_GL_RGB565, GPU_GL_RGBA4, GPU_GL_RGBA8, and RETURN_IF_RENDERABLE.

Referenced by WrapOnscreenSurface().

◆ FlagForSwitch()

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

Definition at line 146 of file switches.cc.

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

References i.

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

◆ 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

References FlutterStandardFieldFloat32Data, FlutterStandardFieldFloat64Data, FlutterStandardFieldInt32Data, FlutterStandardFieldInt64Data, and FlutterStandardFieldUInt8Data.

Referenced by FlutterStandardReaderWriter::readerWithData:.

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

References FlutterStandardFieldFloat32Data, FlutterStandardFieldFloat64Data, FlutterStandardFieldInt32Data, FlutterStandardFieldInt64Data, FlutterStandardFieldUInt8Data, and type.

Referenced by FlutterStandardWriter::writeValue:.

◆ FlutterTextUtilsIsEmoji()

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

Definition at line 613 of file platform_view_android_jni_impl.cc.

615 {
616 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI);
617}

Referenced by RegisterApi().

◆ FlutterTextUtilsIsEmojiModifier()

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

Definition at line 619 of file platform_view_android_jni_impl.cc.

621 {
622 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER);
623}

Referenced by RegisterApi().

◆ FlutterTextUtilsIsEmojiModifierBase()

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

Definition at line 625 of file platform_view_android_jni_impl.cc.

627 {
628 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_EMOJI_MODIFIER_BASE);
629}

Referenced by RegisterApi().

◆ FlutterTextUtilsIsRegionalIndicator()

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

Definition at line 637 of file platform_view_android_jni_impl.cc.

639 {
640 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_REGIONAL_INDICATOR);
641}

Referenced by RegisterApi().

◆ FlutterTextUtilsIsVariationSelector()

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

Definition at line 631 of file platform_view_android_jni_impl.cc.

633 {
634 return u_hasBinaryProperty(codePoint, UProperty::UCHAR_VARIATION_SELECTOR);
635}

Referenced by RegisterApi().

◆ ForceShutdownIsolate()

EXPORTED void flutter::ForceShutdownIsolate ( )

Definition at line 615 of file tester_main.cc.

615 {
616 // Enable Isolate.exit().
617 FML_DCHECK(Dart_CurrentIsolate() != nullptr);
618 Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate"));
620 Dart_Handle isolate_type = Dart_GetNonNullableType(
621 isolate_lib, tonic::ToDart("Isolate"), 0, nullptr);
623 Dart_Handle result =
624 Dart_SetField(isolate_type, tonic::ToDart("_mayExit"), Dart_True());
626}
bool CheckAndHandleError(Dart_Handle handle)
Definition dart_error.cc:33

References tonic::CheckAndHandleError(), FML_CHECK, FML_DCHECK, and tonic::ToDart().

◆ GetBitmap()

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

Definition at line 423 of file platform_view_android_jni_impl.cc.

423 {
424 auto screenshot = ANDROID_SHELL_HOLDER->Screenshot(
425 Rasterizer::ScreenshotType::UncompressedImage, false);
426 if (screenshot.data == nullptr) {
427 return nullptr;
428 }
429
430 jstring argb = env->NewStringUTF("ARGB_8888");
431 if (argb == nullptr) {
432 return nullptr;
433 }
434
435 jobject bitmap_config = env->CallStaticObjectMethod(
436 g_bitmap_config_class->obj(), g_bitmap_config_value_of, argb);
437 if (bitmap_config == nullptr) {
438 return nullptr;
439 }
440
441 auto bitmap = env->CallStaticObjectMethod(
442 g_bitmap_class->obj(), g_bitmap_create_bitmap_method,
443 screenshot.frame_size.width, screenshot.frame_size.height, bitmap_config);
444
446 env,
447 env->NewDirectByteBuffer(const_cast<uint8_t*>(screenshot.data->bytes()),
448 screenshot.data->size()));
449
450 env->CallVoidMethod(bitmap, g_bitmap_copy_pixels_from_buffer_method,
451 buffer.obj());
452
453 return bitmap;
454}
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_class
static fml::jni::ScopedJavaGlobalRef< jclass > * g_bitmap_config_class

References ANDROID_SHELL_HOLDER, buffer, g_bitmap_class, g_bitmap_config_class, g_bitmap_config_value_of, g_bitmap_copy_pixels_from_buffer_method, g_bitmap_create_bitmap_method, and flutter::Rasterizer::UncompressedImage.

Referenced by RegisterApi().

◆ GetColorSpace()

SkColorSpace * flutter::GetColorSpace ( DlCanvas canvas)
inline

Definition at line 24 of file layer_tree.cc.

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

References flutter::DlCanvas::GetImageInfo().

Referenced by flutter::LayerTree::Paint(), and flutter::LayerTree::Preroll().

◆ GetCoreAnimationLayerClassForRenderingAPI()

Class flutter::GetCoreAnimationLayerClassForRenderingAPI ( IOSRenderingAPI  rendering_api)

Definition at line 59 of file rendering_api_selection.mm.

59 {
60 switch (rendering_api) {
61 case IOSRenderingAPI::kSoftware:
62 return [CALayer class];
63 case IOSRenderingAPI::kMetal:
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

References FML_CHECK, kMetal, kSoftware, and METAL_IOS_VERSION_BASELINE.

◆ GetCurrentThreadTaskRunner()

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

Definition at line 121 of file embedder_thread_host.cc.

121 {
124}
static void EnsureInitializedForCurrentThread()
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()

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

◆ GetCursorFromBuffer()

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

Definition at line 186 of file cursor_handler.cc.

190 {
191 HCURSOR cursor = nullptr;
192 HDC display_dc = GetDC(NULL);
193 // Flutter should returns rawBGRA, which has 8bits * 4channels.
194 BITMAPINFO bmi;
195 memset(&bmi, 0, sizeof(bmi));
196 bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
197 bmi.bmiHeader.biWidth = width;
198 bmi.bmiHeader.biHeight = -height;
199 bmi.bmiHeader.biPlanes = 1;
200 bmi.bmiHeader.biBitCount = 32;
201 bmi.bmiHeader.biCompression = BI_RGB;
202 bmi.bmiHeader.biSizeImage = width * height * 4;
203 // Create the pixmap DIB section
204 uint8_t* pixels = 0;
205 HBITMAP bitmap =
206 CreateDIBSection(display_dc, &bmi, DIB_RGB_COLORS, (void**)&pixels, 0, 0);
207 ReleaseDC(0, display_dc);
208 if (!bitmap || !pixels) {
209 return nullptr;
210 }
211 int bytes_per_line = width * 4;
212 for (int y = 0; y < height; ++y) {
213 memcpy(pixels + y * bytes_per_line, &buffer[bytes_per_line * y],
214 bytes_per_line);
215 }
216 HBITMAP mask;
217 GetMaskBitmaps(bitmap, mask);
218 ICONINFO icon_info;
219 icon_info.fIcon = 0;
220 icon_info.xHotspot = hot_x;
221 icon_info.yHotspot = hot_y;
222 icon_info.hbmMask = mask;
223 icon_info.hbmColor = bitmap;
224 cursor = CreateIconIndirect(&icon_info);
225 DeleteObject(mask);
226 DeleteObject(bitmap);
227 return cursor;
228}
void GetMaskBitmaps(HBITMAP bitmap, HBITMAP &mask_bitmap)

References buffer, GetMaskBitmaps(), height, width, and y.

◆ GetDartVersion()

const char * flutter::GetDartVersion ( )

Definition at line 23 of file version.cc.

23 {
24 return DART_VERSION;
25}

Referenced by PrintUsage().

◆ GetDefaultPlatformData()

static PlatformData flutter::GetDefaultPlatformData ( )
static

Definition at line 76 of file android_shell_holder.cc.

76 {
77 PlatformData platform_data;
78 platform_data.lifecycle_state = "AppLifecycleState.detached";
79 return platform_data;
80}
std::string lifecycle_state

References flutter::PlatformData::lifecycle_state.

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

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

128 {
129 return GetHelper()->GetDpiForWindow(hwnd);
130}

Referenced by FlutterDesktopGetDpiForHWND(), flutter::FlutterWindow::FlutterWindow(), flutter::HostWindow::GetWindowSizeForClientSize(), flutter::HostWindow::HandleMessage(), flutter::FlutterWindow::HandleMessage(), flutter::HostWindow::SetFullscreen(), flutter::testing::TEST(), and flutter::testing::TEST().

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

132 {
133 return GetHelper()->GetDpiForMonitor(monitor);
134}

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

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

References buffer, length, and MAX_PATH.

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

◆ 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

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

Referenced by SearchMapping().

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

References path.

◆ GetFlutterContentHash()

const char * flutter::GetFlutterContentHash ( )

Definition at line 15 of file version.cc.

15 {
16 return FLUTTER_CONTENT_HASH;
17}

Referenced by PrintUsage().

◆ GetFlutterEngineVersion()

const char * flutter::GetFlutterEngineVersion ( )

Definition at line 11 of file version.cc.

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

References FLUTTER_ENGINE_VERSION.

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

◆ 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

References gFontFile.

◆ GetFunctionClassName()

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

Definition at line 222 of file dart_runtime_hooks.cc.

222 {
223 Dart_Handle result;
224
225 if (Dart_IsClosure(closure)) {
226 closure = Dart_ClosureFunction(closure);
227 PropagateIfError(closure);
228 }
229
230 if (!Dart_IsFunction(closure)) {
231 return "";
232 }
233
234 bool is_static = false;
235 result = Dart_FunctionIsStatic(closure, &is_static);
236 PropagateIfError(result);
237 if (!is_static) {
238 return "";
239 }
240
241 result = Dart_FunctionOwner(closure);
242 PropagateIfError(result);
243
244 if (Dart_IsLibrary(result) || !Dart_IsInstance(result)) {
245 return "";
246 }
247 return DartConverter<std::string>::FromDart(Dart_ClassName(result));
248}
static void PropagateIfError(Dart_Handle result)

References PropagateIfError().

Referenced by flutter::DartRuntimeHooks::GetCallbackHandle().

◆ GetFunctionLibraryUrl()

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

Definition at line 200 of file dart_runtime_hooks.cc.

200 {
201 if (Dart_IsClosure(closure)) {
202 closure = Dart_ClosureFunction(closure);
203 PropagateIfError(closure);
204 }
205
206 if (!Dart_IsFunction(closure)) {
207 return "";
208 }
209
210 Dart_Handle url = Dart_Null();
211 Dart_Handle owner = Dart_FunctionOwner(closure);
212 if (Dart_IsInstance(owner)) {
213 owner = Dart_ClassLibrary(owner);
214 }
215 if (Dart_IsLibrary(owner)) {
216 url = Dart_LibraryUrl(owner);
217 PropagateIfError(url);
218 }
220}

References PropagateIfError().

Referenced by flutter::DartRuntimeHooks::GetCallbackHandle().

◆ GetFunctionName()

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

Definition at line 250 of file dart_runtime_hooks.cc.

250 {
251 if (Dart_IsClosure(func)) {
252 func = Dart_ClosureFunction(func);
253 PropagateIfError(func);
254 }
255
256 if (!Dart_IsFunction(func)) {
257 return "";
258 }
259
260 bool is_static = false;
261 Dart_Handle result = Dart_FunctionIsStatic(func, &is_static);
262 PropagateIfError(result);
263 if (!is_static) {
264 return "";
265 }
266
267 result = Dart_FunctionName(func);
268 PropagateIfError(result);
269
271}

References PropagateIfError().

Referenced by flutter::DartRuntimeHooks::GetCallbackHandle().

◆ 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

References gGoldenDir.

◆ getInfoIncludingExif()

static SkImageInfo flutter::getInfoIncludingExif ( SkCodec *  codec)
static

Definition at line 86 of file image_generator.cc.

86 {
87 SkImageInfo info = codec->getInfo();
88 if (SkEncodedOriginSwapsWidthHeight(codec->getOrigin())) {
89 info = SkPixmapUtils::SwapWidthHeight(info);
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}

Referenced by flutter::BuiltinSkiaCodecImageGenerator::BuiltinSkiaCodecImageGenerator(), and flutter::BuiltinSkiaCodecImageGenerator::BuiltinSkiaCodecImageGenerator().

◆ GetIsSoftwareRendering()

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

Definition at line 532 of file platform_view_android_jni_impl.cc.

532 {
533 return FlutterMain::Get().GetSettings().enable_software_rendering;
534}

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

Referenced by RegisterApi().

◆ GetMaskBitmaps()

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

Definition at line 230 of file cursor_handler.cc.

230 {
231 HDC h_dc = ::GetDC(NULL);
232 HDC h_main_dc = ::CreateCompatibleDC(h_dc);
233 HDC h_and_mask_dc = ::CreateCompatibleDC(h_dc);
234
235 // Get the dimensions of the source bitmap
236 BITMAP bm;
237 ::GetObject(bitmap, sizeof(BITMAP), &bm);
238 mask_bitmap = ::CreateCompatibleBitmap(h_dc, bm.bmWidth, bm.bmHeight);
239
240 // Select the bitmaps to DC
241 HBITMAP h_old_main_bitmap = (HBITMAP)::SelectObject(h_main_dc, bitmap);
242 HBITMAP h_old_and_mask_bitmap =
243 (HBITMAP)::SelectObject(h_and_mask_dc, mask_bitmap);
244
245 // Scan each pixel of the souce bitmap and create the masks
246 COLORREF main_bit_pixel;
247 for (int x = 0; x < bm.bmWidth; ++x) {
248 for (int y = 0; y < bm.bmHeight; ++y) {
249 main_bit_pixel = ::GetPixel(h_main_dc, x, y);
250 if (main_bit_pixel == RGB(0, 0, 0)) {
251 ::SetPixel(h_and_mask_dc, x, y, RGB(255, 255, 255));
252 } else {
253 ::SetPixel(h_and_mask_dc, x, y, RGB(0, 0, 0));
254 }
255 }
256 }
257 ::SelectObject(h_main_dc, h_old_main_bitmap);
258 ::SelectObject(h_and_mask_dc, h_old_and_mask_bitmap);
259
260 ::DeleteDC(h_and_mask_dc);
261 ::DeleteDC(h_main_dc);
262
263 ::ReleaseDC(NULL, h_dc);
264}

References x, and y.

Referenced by GetCursorFromBuffer().

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

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

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

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

◆ 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)
LanguageInfo ParseLanguageName(std::wstring language_name)

References GetPreferredLanguages(), and ParseLanguageName().

◆ 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)
const size_t start

References buffer, GetPreferredLanguagesFromMUI(), and start.

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

◆ GetPreferredLanguagesFromMUI()

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

Definition at line 28 of file system_utils.cc.

29 {
30 ULONG buffer_size = 0;
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}
virtual LRESULT GetThreadPreferredUILanguages(DWORD flags, PULONG count, PZZWSTR languages, PULONG length) const
DWORD ULONG
unsigned long DWORD

References buffer, and flutter::WindowsProcTable::GetThreadPreferredUILanguages().

Referenced by GetPreferredLanguages().

◆ 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(nullptr);
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}

References FML_LOG.

Referenced by flutter::OffscreenSurface::GetRasterData().

◆ 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) {
34 return IOSRenderingAPI::kSoftware;
35 }
36#else
37 if (force_software) {
38 [FlutterLogger logWarning:@"The --enable-software-rendering is only supported on simulator "
39 "targets and will be ignored."];
40 }
41#endif // TARGET_OS_SIMULATOR
42
43 static bool should_use_metal = ShouldUseMetalRenderer();
44 if (should_use_metal) {
45 return IOSRenderingAPI::kMetal;
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
52 return IOSRenderingAPI::kSoftware;
53#else
54 FML_CHECK(false) << "Metal may only be unavailable on simulators";
55 return IOSRenderingAPI::kSoftware;
56#endif // TARGET_OS_SIMULATOR
57}
bool ShouldUseMetalRenderer()

References FML_CHECK, kMetal, kSoftware, and ShouldUseMetalRenderer().

◆ GetSkiaVersion()

const char * flutter::GetSkiaVersion ( )

Definition at line 19 of file version.cc.

19 {
20 return SKIA_VERSION;
21}

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

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

References i.

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

◆ GetSwitchValue()

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

Definition at line 183 of file switches.cc.

185 {
186 std::string switch_string;
187
188 if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) {
189 return false;
190 }
191
192 std::stringstream stream(switch_string);
193 T value = 0;
194 if (stream >> value) {
195 *result = value;
196 return true;
197 }
198
199 return false;
200}
bool GetOptionValue(std::string_view name, std::string *value) const
const std::string_view FlagForSwitch(Switch swtch)
Definition switches.cc:146

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

Referenced by SettingsFromCommandLine().

◆ GetSymbolMapping()

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

Definition at line 202 of file switches.cc.

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

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

Referenced by SettingsFromCommandLine().

◆ 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
1628 sk_sp<SkFontMgr> font_mgr = txt::GetDefaultFontManager();
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< SkFontMgr > GetDefaultFontManager(uint32_t font_initialization_data)
Definition platform.cc:17

References txt::GetDefaultFontManager().

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

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

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

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

References kNotNecessary.

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

References buffer.

Referenced by flutter::SettingsPlugin::GetAlwaysUse24HourFormat(), and flutter::testing::TEST().

◆ 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 = {
127 Dart_NewDouble(glyphInfo.fGraphemeLayoutBounds.fLeft),
128 Dart_NewDouble(glyphInfo.fGraphemeLayoutBounds.fTop),
129 Dart_NewDouble(glyphInfo.fGraphemeLayoutBounds.fRight),
130 Dart_NewDouble(glyphInfo.fGraphemeLayoutBounds.fBottom),
131 Dart_NewInteger(glyphInfo.fGraphemeClusterTextRange.start),
132 Dart_NewInteger(glyphInfo.fGraphemeClusterTextRange.end),
133 Dart_NewBoolean(glyphInfo.fDirection ==
134 skia::textlayout::TextDirection::kLtr),
135 };
136 return Dart_InvokeClosure(constructor, arguments.size(), arguments.data());
137}

References glyphInfoFrom().

Referenced by flutter::Paragraph::getClosestGlyphInfo(), flutter::Paragraph::getGlyphInfoAt(), and glyphInfoFrom().

◆ HandleMessageOnHandler()

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

Definition at line 159 of file service_protocol.cc.

163 {
166 bool result = false;
168 handler->GetServiceProtocolHandlerTaskRunner(method),
169 [&latch, //
170 &result, //
171 &handler, //
172 &method, //
173 &params, //
174 &document //
175 ]() {
176 result =
177 handler->HandleServiceProtocolMessage(method, params, document);
178 latch.Signal();
179 });
180 latch.Wait();
181 return result;
182}
static void RunNowOrPostTask(const fml::RefPtr< fml::TaskRunner > &runner, const fml::closure &task)
const EmbeddedViewParams * params

References FML_DCHECK, handler, params, fml::TaskRunner::RunNowOrPostTask(), and fml::AutoResetWaitableEvent::Wait().

◆ 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__);
85 auto image = SkImages::RasterFromData(
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(nullptr);
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
static sk_sp< SkImage > ResizeRasterImage(const sk_sp< SkImage > &image, const SkISize &resized_dimensions, const fml::tracing::TraceFlow &flow)

References flutter::ImageDescriptor::data(), FML_LOG, image, flutter::ImageDescriptor::image_info(), ResizeRasterImage(), flutter::ImageDescriptor::row_bytes(), fml::tracing::TraceFlow::Step(), and TRACE_EVENT0.

◆ IMPLEMENT_WRAPPERTYPEINFO() [1/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Canvas   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [2/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Codec   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [3/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ColorFilter   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [4/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
EngineLayer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [5/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
FragmentProgram   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [6/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Gradient   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [7/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageDescriptor   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [8/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageFilter   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [9/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImageShader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [10/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ImmutableBuffer   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [11/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
NativeSemanticsFlags   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [12/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
NativeStringAttribute   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [13/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Paragraph   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [14/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ParagraphBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [15/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Path   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [16/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
PathMeasure   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [17/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Picture   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [18/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
PictureRecorder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [19/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
ReusableFragmentShader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [20/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
RSuperellipse   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [21/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Scene   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [22/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SceneBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [23/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SemanticsUpdate   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [24/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
SemanticsUpdateBuilder   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [25/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Shader   
)

◆ IMPLEMENT_WRAPPERTYPEINFO() [26/26]

flutter::IMPLEMENT_WRAPPERTYPEINFO ( ui  ,
Vertices   
)

◆ InitDartAsync()

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

Definition at line 86 of file dart_runtime_hooks.cc.

88 {
89 Dart_Handle schedule_microtask;
90 if (is_ui_isolate) {
91 schedule_microtask =
92 InvokeFunction(builtin_library, "_getScheduleMicrotaskClosure");
93 } else {
94 Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
95 Dart_Handle method_name =
96 Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure");
97 schedule_microtask = Dart_Invoke(isolate_lib, method_name, 0, NULL);
98 }
99 Dart_Handle async_library = Dart_LookupLibrary(ToDart("dart:async"));
100 Dart_Handle set_schedule_microtask = ToDart("_setScheduleImmediateClosure");
101 Dart_Handle result = Dart_Invoke(async_library, set_schedule_microtask, 1,
102 &schedule_microtask);
103 PropagateIfError(result);
104
105#if !FLUTTER_RELEASE
106 if (enable_microtask_profiling) {
107 Dart_Handle microtask_mirror_queue_type_name =
108 Dart_NewStringFromCString("_MicrotaskMirrorQueue");
109 PropagateIfError(microtask_mirror_queue_type_name);
110
111 Dart_Handle microtask_mirror_queue_type =
112 Dart_GetNonNullableType(async_library, microtask_mirror_queue_type_name,
113 /*number_of_type_arguments=*/0,
114 /*type_arguments=*/nullptr);
115 PropagateIfError(microtask_mirror_queue_type);
116
117 Dart_Handle should_profile_microtasks_field_name =
118 Dart_NewStringFromCString("_shouldProfileMicrotasks");
119 PropagateIfError(should_profile_microtasks_field_name);
120
121 Dart_Handle set_field_result =
122 Dart_SetField(microtask_mirror_queue_type,
123 should_profile_microtasks_field_name, Dart_True());
124 PropagateIfError(set_field_result);
125 }
126#endif // !FLUTTER_RELEASE
127}
static Dart_Handle InvokeFunction(Dart_Handle builtin_library, const char *name)

References InvokeFunction(), and PropagateIfError().

Referenced by flutter::DartRuntimeHooks::Install().

◆ 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"));
81 Dart_Handle result =
82 Dart_SetField(core_library, ToDart("_uriBaseClosure"), get_base_url);
83 PropagateIfError(result);
84}

References PropagateIfError().

Referenced by flutter::DartRuntimeHooks::Install().

◆ InitDartFFIForIsolateGroup()

static void flutter::InitDartFFIForIsolateGroup ( )
static

Definition at line 1256 of file dart_isolate.cc.

1256 {
1257 NativeAssetsApi native_assets;
1258 memset(&native_assets, 0, sizeof(native_assets));
1259 // TODO(dacoharkes): Remove after flutter_tools stops kernel embedding.
1260 native_assets.dlopen_absolute = &dart::bin::NativeAssets::DlopenAbsolute;
1261 native_assets.dlopen_relative = &NativeAssetsDlopenRelative;
1262 native_assets.dlopen_system = &dart::bin::NativeAssets::DlopenSystem;
1263 native_assets.dlopen_executable = &dart::bin::NativeAssets::DlopenExecutable;
1264 native_assets.dlopen_process = &dart::bin::NativeAssets::DlopenProcess;
1265 // TODO(dacoharkes): End todo.
1266 native_assets.dlsym = &dart::bin::NativeAssets::Dlsym;
1267 native_assets.dlopen = &NativeAssetsDlopen;
1268 native_assets.available_assets = &NativeAssetsAvailableAssets;
1269 Dart_InitializeNativeAssetsResolver(&native_assets);
1270};
static void * NativeAssetsDlopenRelative(const char *path, char **error)
static void * NativeAssetsDlopen(const char *asset_id, char **error)
static char * NativeAssetsAvailableAssets()

References NativeAssetsAvailableAssets(), NativeAssetsDlopen(), and NativeAssetsDlopenRelative().

◆ 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
54 Dart_Handle result =
55 Dart_SetField(internal_library, ToDart("_printClosure"), print);
56 PropagateIfError(result);
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);
62 PropagateIfError(result);
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);
69 PropagateIfError(result);
70
71 Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate"));
72 result = Dart_Invoke(isolate_lib, setup_hooks, 0, NULL);
73 PropagateIfError(result);
74}

References InvokeFunction(), and PropagateIfError().

Referenced by flutter::DartRuntimeHooks::Install().

◆ InitDartIO()

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

Definition at line 129 of file dart_runtime_hooks.cc.

130 {
131 Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
132 Dart_Handle platform_type =
133 Dart_GetNonNullableType(io_lib, ToDart("_Platform"), 0, nullptr);
134 if (!script_uri.empty()) {
135 Dart_Handle result = Dart_SetField(platform_type, ToDart("_nativeScript"),
136 ToDart(script_uri));
137 PropagateIfError(result);
138 }
139 // typedef _LocaleClosure = String Function();
140 Dart_Handle /* _LocaleClosure? */ locale_closure =
141 InvokeFunction(builtin_library, "_getLocaleClosure");
142 PropagateIfError(locale_closure);
143 // static String Function()? _localeClosure;
144 Dart_Handle result =
145 Dart_SetField(platform_type, ToDart("_localeClosure"), locale_closure);
146 PropagateIfError(result);
147
148#if !FLUTTER_RELEASE
149 // Register dart:io service extensions used for network profiling.
150 Dart_Handle network_profiling_type =
151 Dart_GetNonNullableType(io_lib, ToDart("_NetworkProfiling"), 0, nullptr);
152 PropagateIfError(network_profiling_type);
153 result = Dart_Invoke(network_profiling_type,
154 ToDart("_registerServiceExtension"), 0, nullptr);
155 PropagateIfError(result);
156#endif // !FLUTTER_RELEASE
157}

References InvokeFunction(), and PropagateIfError().

Referenced by flutter::DartRuntimeHooks::Install().

◆ 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.
334 SkEventTracer::SetInstance(tracer);
335}

◆ InvalidateApiState()

static void flutter::InvalidateApiState ( SkSurface &  skia_surface)
static

Definition at line 96 of file embedder_external_view.cc.

96 {
97 auto recording_context = skia_surface.recordingContext();
98
99 // Should never happen.
100 FML_DCHECK(recording_context) << "Recording context was null.";
101
102 auto direct_context = recording_context->asDirectContext();
103 if (direct_context == nullptr) {
104 // Can happen when using software rendering.
105 // Print an error but otherwise continue in that case.
106 FML_LOG(ERROR) << "Embedder asked to invalidate cached graphics API state "
107 "but Flutter is not using a graphics API.";
108 } else {
109 direct_context->resetContext(kAll_GrBackendState);
110 }
111}

References FML_DCHECK, and FML_LOG.

Referenced by flutter::EmbedderExternalView::Render().

◆ 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_Handle DartInvokeField(Dart_Handle target, const char *name, std::initializer_list< Dart_Handle > args)

References tonic::CheckAndHandleError(), tonic::DartInvokeField(), tonic::ToDart(), and TRACE_EVENT0.

Referenced by FindAndInvokeDartPluginRegistrant(), and flutter::DartIsolate::RunFromLibrary().

◆ 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}
const char * name
Definition fuchsia.cc:49

References name.

Referenced by InitDartAsync(), InitDartInternal(), and InitDartIO().

◆ InvokeMainEntrypoint()

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

Definition at line 882 of file dart_isolate.cc.

884 {
885 if (tonic::CheckAndHandleError(user_entrypoint_function)) {
886 FML_LOG(ERROR) << "Could not resolve main entrypoint function.";
887 return false;
888 }
889
890 Dart_Handle start_main_isolate_function =
891 tonic::DartInvokeField(Dart_LookupLibrary(tonic::ToDart("dart:isolate")),
892 "_getStartMainIsolateFunction", {});
893
894 if (tonic::CheckAndHandleError(start_main_isolate_function)) {
895 FML_LOG(ERROR) << "Could not resolve main entrypoint trampoline.";
896 return false;
897 }
898
900 Dart_LookupLibrary(tonic::ToDart("dart:ui")), "_runMain",
901 {start_main_isolate_function, user_entrypoint_function, args}))) {
902 FML_LOG(ERROR) << "Could not invoke the main entrypoint.";
903 return false;
904 }
905
906 return true;
907}

References args, tonic::CheckAndHandleError(), tonic::DartInvokeField(), FML_LOG, and tonic::ToDart().

Referenced by flutter::DartIsolate::RunFromLibrary().

◆ 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 40 of file multi_frame_codec.cc.

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

References callback, tonic::DartInvoke(), and FML_DLOG.

Referenced by flutter::MultiFrameCodec::getNextFrame().

◆ InvokePlatformMessageEmptyResponseCallback()

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

Definition at line 599 of file platform_view_android_jni_impl.cc.

602 {
603 ANDROID_SHELL_HOLDER->GetPlatformMessageHandler()
604 ->InvokePlatformMessageEmptyResponseCallback(responseId);
605}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ InvokePlatformMessageResponseCallback()

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

Definition at line 584 of file platform_view_android_jni_impl.cc.

589 {
590 uint8_t* response_data =
591 static_cast<uint8_t*>(env->GetDirectBufferAddress(message));
592 FML_DCHECK(response_data != nullptr);
593 auto mapping = std::make_unique<fml::MallocMapping>(
594 fml::MallocMapping::Copy(response_data, response_data + position));
595 ANDROID_SHELL_HOLDER->GetPlatformMessageHandler()
596 ->InvokePlatformMessageResponseCallback(responseId, std::move(mapping));
597}

References ANDROID_SHELL_HOLDER, fml::MallocMapping::Copy(), FML_DCHECK, and message.

Referenced by RegisterApi().

◆ is_power_of_two()

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

Definition at line 9 of file dl_storage.cc.

9 {
10 return (value & (value - 1)) == 0;
11}

References value.

Referenced by flutter::DisplayListStorage::allocate().

◆ IsAllowedDartVMFlag()

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

Definition at line 165 of file switches.cc.

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

References i, and kAllowedDartFlags.

Referenced by SettingsFromCommandLine().

◆ IsDisplayListWorthRasterizing()

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

Definition at line 24 of file display_list_raster_cache_item.cc.

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

References flutter::RasterCacheUtil::CanRasterizeRect(), flutter::DisplayListComplexityCalculator::Compute(), flutter::DisplayList::GetBounds(), flutter::DisplayListComplexityCalculator::ShouldBeCached(), and ToSkRect().

Referenced by flutter::DisplayListRasterCacheItem::PrerollSetup().

◆ 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

Referenced by TEST().

◆ IsProcResolverOpenGLES()

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

Definition at line 57 of file gpu_surface_gl_delegate.cc.

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

References FML_CHECK, and GPU_GL_VERSION.

Referenced by CreateGLInterface().

◆ IsSurfaceControlEnabled()

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

Definition at line 417 of file platform_view_android_jni_impl.cc.

419 {
420 return ANDROID_SHELL_HOLDER->IsSurfaceControlEnabled();
421}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

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

References path, x, and y.

◆ LoadDartDeferredLibrary()

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

Definition at line 659 of file platform_view_android_jni_impl.cc.

663 {
664 // Convert java->c++
665 intptr_t loading_unit_id = static_cast<intptr_t>(jLoadingUnitId);
666 std::vector<std::string> search_paths =
667 fml::jni::StringArrayToVector(env, jSearchPaths);
668
669 // Use dlopen here to directly check if handle is nullptr before creating a
670 // NativeLibrary.
671 void* handle = nullptr;
672 while (handle == nullptr && !search_paths.empty()) {
673 std::string path = search_paths.back();
674 handle = ::dlopen(path.c_str(), RTLD_NOW);
675 search_paths.pop_back();
676 }
677 if (handle == nullptr) {
678 LoadLoadingUnitFailure(loading_unit_id,
679 "No lib .so found for provided search paths.", true);
680 return;
681 }
684
685 // Resolve symbols.
686 std::unique_ptr<const fml::SymbolMapping> data_mapping =
687 std::make_unique<const fml::SymbolMapping>(
688 native_lib, DartSnapshot::kIsolateDataSymbol);
689 std::unique_ptr<const fml::SymbolMapping> instructions_mapping =
690 std::make_unique<const fml::SymbolMapping>(
691 native_lib, DartSnapshot::kIsolateInstructionsSymbol);
692
693 ANDROID_SHELL_HOLDER->GetPlatformView()->LoadDartDeferredLibrary(
694 loading_unit_id, std::move(data_mapping),
695 std::move(instructions_mapping));
696}
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

References ANDROID_SHELL_HOLDER, fml::NativeLibrary::CreateWithHandle(), flutter::DartSnapshot::kIsolateDataSymbol, flutter::DartSnapshot::kIsolateInstructionsSymbol, LoadLoadingUnitFailure(), path, and fml::jni::StringArrayToVector().

Referenced by RegisterApi().

◆ LoadLibraryFromKernel()

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

Definition at line 535 of file tester_main.cc.

535 {
536 std::shared_ptr<fml::FileMapping> mapping =
538 if (!mapping) {
539 return Dart_Null();
540 }
541 return DartIsolate::LoadLibraryFromKernel(mapping);
542}

References fml::FileMapping::CreateReadOnly(), flutter::DartIsolate::LoadLibraryFromKernel(), and path.

◆ LoadLoadingUnitFailure()

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

Definition at line 643 of file platform_view_android_jni_impl.cc.

645 {
646 // TODO(garyq): Implement
647}

Referenced by DeferredComponentInstallFailure(), and LoadDartDeferredLibrary().

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

References _EGL_ERROR_DESC, FML_LOG, i, and name.

Referenced by flutter::AndroidContextGLSkia::AndroidContextGLSkia(), flutter::AndroidContextGLSkia::ClearCurrent(), flutter::AndroidEGLSurface::GetSize(), and flutter::AndroidEGLSurface::MakeCurrent().

◆ LookupCallbackInformation()

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

Definition at line 319 of file platform_view_android_jni_impl.cc.

321 {
323 if (cbInfo == nullptr) {
324 return nullptr;
325 }
326 return env->NewObject(g_flutter_callback_info_class->obj(),
327 g_flutter_callback_info_constructor,
328 env->NewStringUTF(cbInfo->name.c_str()),
329 env->NewStringUTF(cbInfo->class_name.c_str()),
330 env->NewStringUTF(cbInfo->library_path.c_str()));
331}
static std::unique_ptr< DartCallbackRepresentation > GetCallbackInformation(int64_t handle)

References g_flutter_callback_info_class, g_flutter_callback_info_constructor, and flutter::DartCallbackCache::GetCallbackInformation().

Referenced by RegisterApi().

◆ LookupEntryPoint()

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

Definition at line 544 of file tester_main.cc.

544 {
545 if (!uri || !name) {
546 return Dart_Null();
547 }
548 Dart_Handle lib = Dart_LookupLibrary(Dart_NewStringFromCString(uri));
549 if (Dart_IsError(lib)) {
550 return lib;
551 }
552 return Dart_GetField(lib, Dart_NewStringFromCString(name));
553}

References name.

◆ MakeBackingStoreConfig()

static FlutterBackingStoreConfig flutter::MakeBackingStoreConfig ( int64_t  view_id,
const DlISize 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}
G_BEGIN_DECLS FlutterViewId view_id
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStoreConfig).
Definition embedder.h:2091
FlutterSize size
The size of the render target the engine expects to render into.
Definition embedder.h:2093
double height
Definition embedder.h:629
double width
Definition embedder.h:628

References impeller::TSize< T >::height, FlutterSize::height, FlutterBackingStoreConfig::size, FlutterBackingStoreConfig::struct_size, FlutterBackingStoreConfig::view_id, view_id, impeller::TSize< T >::width, and FlutterSize::width.

◆ 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 {
15 GrContextOptions options;
16
17 if (PersistentCache::cache_sksl()) {
18 options.fShaderCacheStrategy = GrContextOptions::ShaderCacheStrategy::kSkSL;
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};

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

Referenced by flutter::ShellIOManager::CreateCompatibleResourceLoadingContext(), flutter::GPUSurfaceGLSkia::MakeGLContext(), flutter::testing::TEST(), flutter_runner::testing::TEST_F(), and flutter::testing::TestVulkanContext::TestVulkanContext().

◆ MakeThreadConfig()

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

Definition at line 128 of file embedder_thread_host.cc.

130 {
133 kFlutterThreadName),
134 priority);
135}
static std::string MakeThreadName(Type type, const std::string &prefix)
Use the prefix and thread type to generator a thread name.
The ThreadConfig is the thread info include thread name, thread priority.
Definition thread.h:35

References kFlutterThreadName, flutter::ThreadHost::ThreadHostConfig::MakeThreadName(), and type.

◆ MarkTextureFrameAvailable()

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

Definition at line 572 of file platform_view_android_jni_impl.cc.

575 {
576 ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable(
577 static_cast<int64_t>(texture_id));
578}
int64_t texture_id

References ANDROID_SHELL_HOLDER, and texture_id.

Referenced by RegisterApi().

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

References path, x, and y.

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

◆ NativeAssetsAvailableAssets()

static char * flutter::NativeAssetsAvailableAssets ( )
static

Definition at line 1245 of file dart_isolate.cc.

1245 {
1246 auto* isolate_group_data =
1247 static_cast<std::shared_ptr<DartIsolateGroupData>*>(
1248 Dart_CurrentIsolateGroupData());
1249 auto native_assets_manager = (*isolate_group_data)->GetNativeAssetsManager();
1250 FML_DCHECK(native_assets_manager != nullptr);
1251 auto available_assets = native_assets_manager->AvailableNativeAssets();
1252 auto* result = fml::strdup(available_assets.c_str());
1253 return result;
1254}
char * strdup(const char *str1)

References FML_DCHECK, and fml::strdup().

Referenced by InitDartFFIForIsolateGroup().

◆ NativeAssetsDlopen()

static void * flutter::NativeAssetsDlopen ( const char *  asset_id,
char **  error 
)
static

Definition at line 1202 of file dart_isolate.cc.

1202 {
1203 auto* isolate_group_data =
1204 static_cast<std::shared_ptr<DartIsolateGroupData>*>(
1205 Dart_CurrentIsolateGroupData());
1206 auto native_assets_manager = (*isolate_group_data)->GetNativeAssetsManager();
1207 if (native_assets_manager == nullptr) {
1208 return nullptr;
1209 }
1210
1211 std::vector<std::string> asset_path =
1212 native_assets_manager->LookupNativeAsset(asset_id);
1213 if (asset_path.size() == 0) {
1214 // The asset id was not in the mapping.
1215 return nullptr;
1216 }
1217
1218 auto& path_type = asset_path[0];
1219 std::string path;
1220 static constexpr const char* kAbsolute = "absolute";
1221 static constexpr const char* kExecutable = "executable";
1222 static constexpr const char* kProcess = "process";
1223 static constexpr const char* kRelative = "relative";
1224 static constexpr const char* kSystem = "system";
1225 if (path_type == kAbsolute || path_type == kRelative ||
1226 path_type == kSystem) {
1227 path = asset_path[1];
1228 }
1229
1230 if (path_type == kAbsolute) {
1231 return dart::bin::NativeAssets::DlopenAbsolute(path.c_str(), error);
1232 } else if (path_type == kRelative) {
1233 return NativeAssetsDlopenRelative(path.c_str(), error);
1234 } else if (path_type == kSystem) {
1235 return dart::bin::NativeAssets::DlopenSystem(path.c_str(), error);
1236 } else if (path_type == kProcess) {
1237 return dart::bin::NativeAssets::DlopenProcess(error);
1238 } else if (path_type == kExecutable) {
1239 return dart::bin::NativeAssets::DlopenExecutable(error);
1240 }
1241
1242 return nullptr;
1243}
const uint8_t uint32_t uint32_t GError ** error

References error, NativeAssetsDlopenRelative(), and path.

Referenced by InitDartFFIForIsolateGroup().

◆ NativeAssetsDlopenRelative()

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

Definition at line 1193 of file dart_isolate.cc.

1193 {
1194 auto* isolate_group_data =
1195 static_cast<std::shared_ptr<DartIsolateGroupData>*>(
1196 Dart_CurrentIsolateGroupData());
1197 const std::string& script_uri = (*isolate_group_data)->GetAdvisoryScriptURI();
1198 return dart::bin::NativeAssets::DlopenRelative(path, script_uri.data(),
1199 error);
1200}

References error, and path.

Referenced by InitDartFFIForIsolateGroup(), and NativeAssetsDlopen().

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

References extended.

◆ NotEquals() [1/9]

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

Definition at line 96 of file dl_comparable.h.

97 {
98 return !Equals(a.get(), b.get());
99}

References Equals().

◆ NotEquals() [2/9]

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

Definition at line 107 of file dl_comparable.h.

107 {
108 return !Equals(a.get(), b.get());
109}

References Equals().

◆ NotEquals() [3/9]

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

Definition at line 76 of file dl_comparable.h.

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

References Equals().

◆ NotEquals() [4/9]

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

Definition at line 102 of file dl_comparable.h.

102 {
103 return !Equals(a.get(), b.get());
104}

References Equals().

◆ NotEquals() [5/9]

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

Definition at line 112 of file dl_comparable.h.

112 {
113 return !Equals(a.get(), b.get());
114}

References Equals().

◆ NotEquals() [6/9]

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

Definition at line 81 of file dl_comparable.h.

81 {
82 return !Equals(a.get(), b);
83}

References Equals().

◆ NotEquals() [7/9]

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

Definition at line 86 of file dl_comparable.h.

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

References Equals().

◆ NotEquals() [8/9]

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

Definition at line 91 of file dl_comparable.h.

91 {
92 return !Equals(a, b.get());
93}

References Equals().

◆ NotEquals() [9/9]

◆ NotifyLowMemoryWarning()

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

Definition at line 607 of file platform_view_android_jni_impl.cc.

609 {
610 ANDROID_SHELL_HOLDER->NotifyLowMemoryWarning();
611}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ 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 TRUE
LONG_PTR LPARAM

References TRUE.

Referenced by flutter::WindowsLifecycleManager::IsLastWindowOfProcess().

◆ 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

References Op().

Referenced by flutter::CanvasPath::op(), and Op().

◆ operator<<()

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

Definition at line 112 of file viewport_metrics.cc.

112 {
113 os << "DPR: " << a.device_pixel_ratio << " " << "Size: [" << a.physical_width
114 << "W " << a.physical_height << "H] " << "Padding: ["
115 << a.physical_padding_top << "T " << a.physical_padding_right << "R "
116 << a.physical_padding_bottom << "B " << a.physical_padding_left << "L] "
117 << "View Constraints: [" << a.physical_min_width_constraint << "-"
121 << "Insets: [" << a.physical_view_inset_top << "T "
123 << "B " << a.physical_view_inset_left << "L] " << "Gesture Insets: ["
128 << "Display Features: " << a.physical_display_features_type.size() << " "
129 << "Display ID: " << a.display_id;
130 return os;
131}
std::vector< int > physical_display_features_type

References flutter::ViewportMetrics::device_pixel_ratio, flutter::ViewportMetrics::display_id, flutter::ViewportMetrics::physical_display_features_type, flutter::ViewportMetrics::physical_height, flutter::ViewportMetrics::physical_max_height_constraint, flutter::ViewportMetrics::physical_max_width_constraint, flutter::ViewportMetrics::physical_min_height_constraint, flutter::ViewportMetrics::physical_min_width_constraint, flutter::ViewportMetrics::physical_padding_bottom, flutter::ViewportMetrics::physical_padding_left, flutter::ViewportMetrics::physical_padding_right, flutter::ViewportMetrics::physical_padding_top, flutter::ViewportMetrics::physical_system_gesture_inset_bottom, flutter::ViewportMetrics::physical_system_gesture_inset_left, flutter::ViewportMetrics::physical_system_gesture_inset_right, flutter::ViewportMetrics::physical_system_gesture_inset_top, flutter::ViewportMetrics::physical_view_inset_bottom, flutter::ViewportMetrics::physical_view_inset_left, flutter::ViewportMetrics::physical_view_inset_right, flutter::ViewportMetrics::physical_view_inset_top, and flutter::ViewportMetrics::physical_width.

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

References flutter::LayoutGoal::keyChar, flutter::LayoutGoal::keyCode, and flutter::LayoutGoal::mandatory.

◆ operator==() [2/2]

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

Definition at line 79 of file viewport_metrics.cc.

79 {
80 return a.device_pixel_ratio == b.device_pixel_ratio &&
81 a.physical_width == b.physical_width &&
82 a.physical_height == b.physical_height &&
83 a.physical_min_width_constraint == b.physical_min_width_constraint &&
84 a.physical_max_width_constraint == b.physical_max_width_constraint &&
85 a.physical_min_height_constraint == b.physical_min_height_constraint &&
86 a.physical_max_height_constraint == b.physical_max_height_constraint &&
87 a.physical_padding_top == b.physical_padding_top &&
88 a.physical_padding_right == b.physical_padding_right &&
89 a.physical_padding_bottom == b.physical_padding_bottom &&
90 a.physical_padding_left == b.physical_padding_left &&
91 a.physical_view_inset_top == b.physical_view_inset_top &&
92 a.physical_view_inset_right == b.physical_view_inset_right &&
93 a.physical_view_inset_bottom == b.physical_view_inset_bottom &&
94 a.physical_view_inset_left == b.physical_view_inset_left &&
96 b.physical_system_gesture_inset_top &&
98 b.physical_system_gesture_inset_right &&
100 b.physical_system_gesture_inset_bottom &&
102 b.physical_system_gesture_inset_left &&
103 a.physical_touch_slop == b.physical_touch_slop &&
105 b.physical_display_features_bounds &&
106 a.physical_display_features_type == b.physical_display_features_type &&
108 b.physical_display_features_state &&
109 a.display_id == b.display_id;
110}
std::vector< double > physical_display_features_bounds
std::vector< int > physical_display_features_state

References flutter::ViewportMetrics::device_pixel_ratio, flutter::ViewportMetrics::display_id, flutter::ViewportMetrics::physical_display_features_bounds, flutter::ViewportMetrics::physical_display_features_state, flutter::ViewportMetrics::physical_display_features_type, flutter::ViewportMetrics::physical_height, flutter::ViewportMetrics::physical_max_height_constraint, flutter::ViewportMetrics::physical_max_width_constraint, flutter::ViewportMetrics::physical_min_height_constraint, flutter::ViewportMetrics::physical_min_width_constraint, flutter::ViewportMetrics::physical_padding_bottom, flutter::ViewportMetrics::physical_padding_left, flutter::ViewportMetrics::physical_padding_right, flutter::ViewportMetrics::physical_padding_top, flutter::ViewportMetrics::physical_system_gesture_inset_bottom, flutter::ViewportMetrics::physical_system_gesture_inset_left, flutter::ViewportMetrics::physical_system_gesture_inset_right, flutter::ViewportMetrics::physical_system_gesture_inset_top, flutter::ViewportMetrics::physical_touch_slop, flutter::ViewportMetrics::physical_view_inset_bottom, flutter::ViewportMetrics::physical_view_inset_left, flutter::ViewportMetrics::physical_view_inset_right, flutter::ViewportMetrics::physical_view_inset_top, and flutter::ViewportMetrics::physical_width.

◆ 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}
static int input(yyscan_t yyscanner)
std::pair< bool, std::string > Base32Decode(const std::string &input)
Definition base32.cc:55

References fml::Base32Decode(), FML_LOG, input(), and ParseBase32().

Referenced by flutter::PersistentCache::LoadSkSLs(), and ParseBase32().

◆ 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);
178 if (error != Base64::Error::kNone) {
179 FML_LOG(ERROR) << "Base64 decode error: " << static_cast<int>(error);
180 FML_LOG(ERROR) << "Base64 can't decode: " << input;
181 return nullptr;
182 }
183
184 sk_sp<SkData> data = SkData::MakeUninitialized(output_len);
185 void* output = data->writable_data();
186 error = Base64::Decode(input.c_str(), input.length(), output, &output_len);
187 if (error != Base64::Error::kNone) {
188 FML_LOG(ERROR) << "Base64 decode error: " << static_cast<int>(error);
189 FML_LOG(ERROR) << "Base64 can't decode: " << input;
190 return nullptr;
191 }
192
193 return data;
194}

References data, error, FML_LOG, input(), and ParseBase64().

Referenced by flutter::PersistentCache::LoadSkSLs(), and ParseBase64().

◆ ParseCommaDelimited()

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

Definition at line 155 of file switches.cc.

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

References input().

Referenced by SettingsFromCommandLine().

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

References FML_DCHECK.

Referenced by flutter::IsolateConfiguration::InferFromSettings().

◆ ParseLanguageName()

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

Definition at line 71 of file system_utils.cc.

71 {
72 LanguageInfo info;
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)

References flutter::LanguageInfo::language, flutter::LanguageInfo::region, flutter::LanguageInfo::script, size, and fml::WideStringToUtf8().

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

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

References FML_LOG, key, fml::MakeCopyable(), TRACE_EVENT0, value, and fml::WriteAtomically().

Referenced by flutter::PersistentCache::DumpSkp().

◆ platforms()

it will be possible to load the file into Perfetto s trace viewer use test 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 flutter::platforms ( See https:"This option is only available on the desktop test shells."  )

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

Referenced by flutter::SettingsPlugin::GetAlwaysUse24HourFormat(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().

◆ PrefetchDefaultFontManager()

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

Definition at line 238 of file flutter_main.cc.

238 {
239 // Initialize a singleton owned by Skia.
241}

References txt::GetDefaultFontManager(), and PrefetchDefaultFontManager().

Referenced by PrefetchDefaultFontManager(), and flutter::FlutterMain::Register().

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

References FML_DCHECK, and fml::MakeCopyable().

Referenced by flutter::IsolateConfiguration::InferFromSettings().

◆ PrintUsage()

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

Definition at line 89 of file switches.cc.

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

References GetDartVersion(), GetFlutterContentHash(), GetFlutterEngineVersion(), GetSkiaVersion(), and i.

Referenced by main().

◆ 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

References CF_PROPERTY_LIST_IMMUTABLE, fml::FileMapping::CreateReadOnly(), and FML_DLOG.

Referenced by TEST().

◆ ProfilingFlags()

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

Definition at line 180 of file dart_vm.cc.

181 {
182// Disable Dart's built in profiler when building a debug build. This
183// works around a race condition that would sometimes stop a crash's
184// stack trace from being printed on Android.
185#ifndef NDEBUG
186 enable_profiling = false;
187#endif
188
189 // We want to disable profiling by default because it overwhelms LLDB. But
190 // the VM enables the same by default. In either case, we have some profiling
191 // flags.
192 if (enable_profiling) {
193 std::vector<const char*> flags = {
194 // This is the default. But just be explicit.
195 "--profiler",
196 // This instructs the profiler to walk C++ frames, and to include
197 // them in the profile.
198 "--profile-vm",
199#if FML_OS_IOS && FML_ARCH_CPU_ARM_FAMILY && FML_ARCH_CPU_ARMEL
200 // Set the profiler interrupt period to 500Hz instead of the
201 // default 1000Hz on 32-bit iOS devices to reduce average and worst
202 // case frame build times.
203 //
204 // Note: profile_period is time in microseconds between sampling
205 // events, not frequency. Frequency is calculated 1/period (or
206 // 1,000,000 / 2,000 -> 500Hz in this case).
207 "--profile_period=2000",
208#else
209 "--profile_period=1000",
210#endif // FML_OS_IOS && FML_ARCH_CPU_ARM_FAMILY && FML_ARCH_CPU_ARMEL
211 };
212
213 if (profile_startup) {
214 // This instructs the profiler to discard new samples once the profiler
215 // sample buffer is full. When this flag is not set, the profiler sample
216 // buffer is used as a ring buffer, meaning that once it is full, new
217 // samples start overwriting the oldest ones."
218 flags.push_back("--profile_startup");
219 }
220
221 return flags;
222 } else {
223 return {"--no-profiler"};
224 }
225}

◆ 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);
39 Dart_PropagateError(result);
40 }
41}

References FML_LOG.

Referenced by flutter::DartRuntimeHooks::GetCallbackFromHandle(), GetFunctionClassName(), GetFunctionLibraryUrl(), GetFunctionName(), InitDartAsync(), InitDartCore(), InitDartInternal(), and InitDartIO().

◆ ProtectEmpty() [1/2]

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

Definition at line 124 of file dl_builder.cc.

124 {
125 // isEmpty protects us against NaN while we normalize any empty cull rects
126 return rect.IsEmpty() ? kEmpty : rect;
127}
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
Definition rect.h:297

References impeller::TRect< T >::IsEmpty(), and kEmpty.

◆ ProtectEmpty() [2/2]

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

Definition at line 15 of file dl_matrix_clip_tracker.cc.

15 {
16 // isEmpty protects us against NaN while we normalize any empty cull rects
17 return rect.IsEmpty() ? kEmpty : rect;
18}

References impeller::TRect< T >::IsEmpty(), and kEmpty.

◆ PushBackAll()

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

Definition at line 227 of file dart_vm.cc.

229 {
230 for (size_t i = 0; i < argc; ++i) {
231 args->push_back(argv[i]);
232 }
233}
char ** argv
Definition library.h:9

References args, argv, and i.

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

Referenced by flutter::SemanticsUpdateBuilder::updateNode().

◆ 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 {
108 FML_DCHECK(cache_state != RasterCacheItem::CacheState::kNone);
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;
133 case RasterCacheItem::CacheState::kNone:
134 FML_DCHECK(cache_state != RasterCacheItem::CacheState::kNone);
135 return false;
136 }
137 return true;
138}
virtual void PaintChildren(PaintContext &context) const
Definition layer.h:185
bool needs_painting(PaintContext &context) const
Definition layer.h:218
virtual void Paint(PaintContext &context) const =0
void set_delegate(DlCanvas *canvas)
ExternalViewEmbedder * view_embedder
Definition layer.h:101
sk_sp< SkColorSpace > dst_color_space
Definition layer.h:100
const Stopwatch & raster_time
Definition layer.h:102
const Stopwatch & ui_time
Definition layer.h:103
std::shared_ptr< TextureRegistry > texture_registry
Definition layer.h:104
GrDirectContext * gr_context
Definition layer.h:99
LayerStateStack & state_stack
Definition layer.h:91

References flutter::PaintContext::dst_color_space, FML_DCHECK, flutter::PaintContext::gr_context, flutter::RasterCacheItem::kChildren, flutter::RasterCacheItem::kCurrent, flutter::RasterCacheItem::kNone, flutter::Layer::needs_painting(), flutter::Layer::Paint(), flutter::Layer::PaintChildren(), flutter::PaintContext::raster_time, flutter::LayerStateStack::set_delegate(), flutter::PaintContext::state_stack, flutter::PaintContext::texture_registry, flutter::PaintContext::ui_time, and flutter::PaintContext::view_embedder.

Referenced by flutter::LayerRasterCacheItem::TryToPrepareRasterCache().

◆ RectHeight()

LONG flutter::RectHeight ( const RECT &  r)

Definition at line 15 of file rect_helper.h.

15 {
16 return r.bottom - r.top;
17}

Referenced by flutter::HostWindow::SetFullscreen().

◆ RectWidth()

LONG flutter::RectWidth ( const RECT &  r)

Definition at line 11 of file rect_helper.h.

11 {
12 return r.right - r.left;
13}

Referenced by flutter::HostWindow::SetFullscreen().

◆ RegisterApi()

bool flutter::RegisterApi ( JNIEnv *  env)

Definition at line 713 of file platform_view_android_jni_impl.cc.

713 {
714 static const JNINativeMethod flutter_jni_methods[] = {
715 // Start of methods from FlutterJNI
716 {
717 .name = "nativeAttach",
718 .signature = "(Lio/flutter/embedding/engine/FlutterJNI;)J",
719 .fnPtr = reinterpret_cast<void*>(&AttachJNI),
720 },
721 {
722 .name = "nativeDestroy",
723 .signature = "(J)V",
724 .fnPtr = reinterpret_cast<void*>(&DestroyJNI),
725 },
726 {
727 .name = "nativeSpawn",
728 .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/"
729 "String;Ljava/util/List;J)Lio/flutter/"
730 "embedding/engine/FlutterJNI;",
731 .fnPtr = reinterpret_cast<void*>(&SpawnJNI),
732 },
733 {
734 .name = "nativeRunBundleAndSnapshotFromLibrary",
735 .signature = "(JLjava/lang/String;Ljava/lang/String;"
736 "Ljava/lang/String;Landroid/content/res/"
737 "AssetManager;Ljava/util/List;J)V",
738 .fnPtr = reinterpret_cast<void*>(&RunBundleAndSnapshotFromLibrary),
739 },
740 {
741 .name = "nativeDispatchEmptyPlatformMessage",
742 .signature = "(JLjava/lang/String;I)V",
743 .fnPtr = reinterpret_cast<void*>(&DispatchEmptyPlatformMessage),
744 },
745 {
746 .name = "nativeCleanupMessageData",
747 .signature = "(J)V",
748 .fnPtr = reinterpret_cast<void*>(&CleanupMessageData),
749 },
750 {
751 .name = "nativeDispatchPlatformMessage",
752 .signature = "(JLjava/lang/String;Ljava/nio/ByteBuffer;II)V",
753 .fnPtr = reinterpret_cast<void*>(&DispatchPlatformMessage),
754 },
755 {
756 .name = "nativeInvokePlatformMessageResponseCallback",
757 .signature = "(JILjava/nio/ByteBuffer;I)V",
758 .fnPtr =
759 reinterpret_cast<void*>(&InvokePlatformMessageResponseCallback),
760 },
761 {
762 .name = "nativeInvokePlatformMessageEmptyResponseCallback",
763 .signature = "(JI)V",
764 .fnPtr = reinterpret_cast<void*>(
766 },
767 {
768 .name = "nativeNotifyLowMemoryWarning",
769 .signature = "(J)V",
770 .fnPtr = reinterpret_cast<void*>(&NotifyLowMemoryWarning),
771 },
772
773 // Start of methods from FlutterView
774 {
775 .name = "nativeGetBitmap",
776 .signature = "(J)Landroid/graphics/Bitmap;",
777 .fnPtr = reinterpret_cast<void*>(&GetBitmap),
778 },
779 {
780 .name = "nativeSurfaceCreated",
781 .signature = "(JLandroid/view/Surface;)V",
782 .fnPtr = reinterpret_cast<void*>(&SurfaceCreated),
783 },
784 {
785 .name = "nativeSurfaceWindowChanged",
786 .signature = "(JLandroid/view/Surface;)V",
787 .fnPtr = reinterpret_cast<void*>(&SurfaceWindowChanged),
788 },
789 {
790 .name = "nativeSurfaceChanged",
791 .signature = "(JII)V",
792 .fnPtr = reinterpret_cast<void*>(&SurfaceChanged),
793 },
794 {
795 .name = "nativeSurfaceDestroyed",
796 .signature = "(J)V",
797 .fnPtr = reinterpret_cast<void*>(&SurfaceDestroyed),
798 },
799 {
800 .name = "nativeSetViewportMetrics",
801 .signature = "(JFIIIIIIIIIIIIIII[I[I[I)V",
802 .fnPtr = reinterpret_cast<void*>(&SetViewportMetrics),
803 },
804 {
805 .name = "nativeDispatchPointerDataPacket",
806 .signature = "(JLjava/nio/ByteBuffer;I)V",
807 .fnPtr = reinterpret_cast<void*>(&DispatchPointerDataPacket),
808 },
809 {
810 .name = "nativeDispatchSemanticsAction",
811 .signature = "(JIILjava/nio/ByteBuffer;I)V",
812 .fnPtr = reinterpret_cast<void*>(&DispatchSemanticsAction),
813 },
814 {
815 .name = "nativeSetSemanticsEnabled",
816 .signature = "(JZ)V",
817 .fnPtr = reinterpret_cast<void*>(&SetSemanticsEnabled),
818 },
819 {
820 .name = "nativeSetAccessibilityFeatures",
821 .signature = "(JI)V",
822 .fnPtr = reinterpret_cast<void*>(&SetAccessibilityFeatures),
823 },
824 {
825 .name = "nativeGetIsSoftwareRenderingEnabled",
826 .signature = "()Z",
827 .fnPtr = reinterpret_cast<void*>(&GetIsSoftwareRendering),
828 },
829 {
830 .name = "nativeRegisterTexture",
831 .signature = "(JJLjava/lang/ref/"
832 "WeakReference;)V",
833 .fnPtr = reinterpret_cast<void*>(&RegisterTexture),
834 },
835 {
836 .name = "nativeRegisterImageTexture",
837 .signature = "(JJLjava/lang/ref/"
838 "WeakReference;Z)V",
839 .fnPtr = reinterpret_cast<void*>(&RegisterImageTexture),
840 },
841 {
842 .name = "nativeMarkTextureFrameAvailable",
843 .signature = "(JJ)V",
844 .fnPtr = reinterpret_cast<void*>(&MarkTextureFrameAvailable),
845 },
846 {
847 .name = "nativeScheduleFrame",
848 .signature = "(J)V",
849 .fnPtr = reinterpret_cast<void*>(&ScheduleFrame),
850 },
851 {
852 .name = "nativeUnregisterTexture",
853 .signature = "(JJ)V",
854 .fnPtr = reinterpret_cast<void*>(&UnregisterTexture),
855 },
856 // Methods for Dart callback functionality.
857 {
858 .name = "nativeLookupCallbackInformation",
859 .signature = "(J)Lio/flutter/view/FlutterCallbackInformation;",
860 .fnPtr = reinterpret_cast<void*>(&LookupCallbackInformation),
861 },
862
863 // Start of methods for FlutterTextUtils
864 {
865 .name = "nativeFlutterTextUtilsIsEmoji",
866 .signature = "(I)Z",
867 .fnPtr = reinterpret_cast<void*>(&FlutterTextUtilsIsEmoji),
868 },
869 {
870 .name = "nativeFlutterTextUtilsIsEmojiModifier",
871 .signature = "(I)Z",
872 .fnPtr = reinterpret_cast<void*>(&FlutterTextUtilsIsEmojiModifier),
873 },
874 {
875 .name = "nativeFlutterTextUtilsIsEmojiModifierBase",
876 .signature = "(I)Z",
877 .fnPtr =
878 reinterpret_cast<void*>(&FlutterTextUtilsIsEmojiModifierBase),
879 },
880 {
881 .name = "nativeFlutterTextUtilsIsVariationSelector",
882 .signature = "(I)Z",
883 .fnPtr =
884 reinterpret_cast<void*>(&FlutterTextUtilsIsVariationSelector),
885 },
886 {
887 .name = "nativeFlutterTextUtilsIsRegionalIndicator",
888 .signature = "(I)Z",
889 .fnPtr =
890 reinterpret_cast<void*>(&FlutterTextUtilsIsRegionalIndicator),
891 },
892 {
893 .name = "nativeLoadDartDeferredLibrary",
894 .signature = "(JI[Ljava/lang/String;)V",
895 .fnPtr = reinterpret_cast<void*>(&LoadDartDeferredLibrary),
896 },
897 {
898 .name = "nativeUpdateJavaAssetManager",
899 .signature =
900 "(JLandroid/content/res/AssetManager;Ljava/lang/String;)V",
901 .fnPtr = reinterpret_cast<void*>(&UpdateJavaAssetManager),
902 },
903 {
904 .name = "nativeDeferredComponentInstallFailure",
905 .signature = "(ILjava/lang/String;Z)V",
906 .fnPtr = reinterpret_cast<void*>(&DeferredComponentInstallFailure),
907 },
908 {
909 .name = "nativeUpdateDisplayMetrics",
910 .signature = "(J)V",
911 .fnPtr = reinterpret_cast<void*>(&UpdateDisplayMetrics),
912 },
913 {
914 .name = "nativeIsSurfaceControlEnabled",
915 .signature = "(J)Z",
916 .fnPtr = reinterpret_cast<void*>(&IsSurfaceControlEnabled),
917 }};
918
919 if (env->RegisterNatives(g_flutter_jni_class->obj(), flutter_jni_methods,
920 std::size(flutter_jni_methods)) != 0) {
921 FML_LOG(ERROR) << "Failed to RegisterNatives with FlutterJNI";
922 return false;
923 }
924
925 g_jni_shell_holder_field = env->GetFieldID(
926 g_flutter_jni_class->obj(), "nativeShellHolderId", "Ljava/lang/Long;");
927
928 if (g_jni_shell_holder_field == nullptr) {
929 FML_LOG(ERROR) << "Could not locate FlutterJNI's nativeShellHolderId field";
930 return false;
931 }
932
934 env->GetMethodID(g_flutter_jni_class->obj(), "<init>", "()V");
935
936 if (g_jni_constructor == nullptr) {
937 FML_LOG(ERROR) << "Could not locate FlutterJNI's constructor";
938 return false;
939 }
940
941 g_long_constructor = env->GetStaticMethodID(g_java_long_class->obj(),
942 "valueOf", "(J)Ljava/lang/Long;");
943 if (g_long_constructor == nullptr) {
944 FML_LOG(ERROR) << "Could not locate Long's constructor";
945 return false;
946 }
947
949
950 fml::jni::ScopedJavaLocalRef<jclass> overlay_surface_class(
951 env, env->FindClass("io/flutter/embedding/engine/FlutterOverlaySurface"));
952 if (overlay_surface_class.is_null()) {
953 FML_LOG(ERROR) << "Could not locate FlutterOverlaySurface class";
954 return false;
955 }
957 env->GetMethodID(overlay_surface_class.obj(), "getId", "()I");
958 if (g_overlay_surface_id_method == nullptr) {
959 FML_LOG(ERROR) << "Could not locate FlutterOverlaySurface#getId() method";
960 return false;
961 }
962 g_overlay_surface_surface_method = env->GetMethodID(
963 overlay_surface_class.obj(), "getSurface", "()Landroid/view/Surface;");
964 if (g_overlay_surface_surface_method == nullptr) {
965 FML_LOG(ERROR)
966 << "Could not locate FlutterOverlaySurface#getSurface() method";
967 return false;
968 }
969
971 env, env->FindClass("android/graphics/Bitmap"));
972 if (g_bitmap_class->is_null()) {
973 FML_LOG(ERROR) << "Could not locate Bitmap Class";
974 return false;
975 }
976
977 g_bitmap_create_bitmap_method = env->GetStaticMethodID(
978 g_bitmap_class->obj(), "createBitmap",
979 "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;");
980 if (g_bitmap_create_bitmap_method == nullptr) {
981 FML_LOG(ERROR) << "Could not locate Bitmap.createBitmap method";
982 return false;
983 }
984
986 g_bitmap_class->obj(), "copyPixelsFromBuffer", "(Ljava/nio/Buffer;)V");
987 if (g_bitmap_copy_pixels_from_buffer_method == nullptr) {
988 FML_LOG(ERROR) << "Could not locate Bitmap.copyPixelsFromBuffer method";
989 return false;
990 }
991
993 env, env->FindClass("android/graphics/Bitmap$Config"));
994 if (g_bitmap_config_class->is_null()) {
995 FML_LOG(ERROR) << "Could not locate Bitmap.Config Class";
996 return false;
997 }
998
999 g_bitmap_config_value_of = env->GetStaticMethodID(
1000 g_bitmap_config_class->obj(), "valueOf",
1001 "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;");
1002 if (g_bitmap_config_value_of == nullptr) {
1003 FML_LOG(ERROR) << "Could not locate Bitmap.Config.valueOf method";
1004 return false;
1005 }
1006
1007 return true;
1008}
static void RunBundleAndSnapshotFromLibrary(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jBundlePath, jstring jEntrypoint, jstring jLibraryUrl, jobject jAssetManager, jobject jEntrypointArgs, jlong engineId)
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 bool IsSurfaceControlEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder)
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 void InvokePlatformMessageEmptyResponseCallback(JNIEnv *env, jobject jcaller, jlong shell_holder, jint responseId)
static void SurfaceDestroyed(JNIEnv *env, jobject jcaller, jlong shell_holder)
static jmethodID g_long_constructor
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 SetSemanticsEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder, jboolean enabled)
static void DeferredComponentInstallFailure(JNIEnv *env, jobject obj, jint jLoadingUnitId, jstring jError, jboolean jTransient)
static jobject SpawnJNI(JNIEnv *env, jobject jcaller, jlong shell_holder, jstring jEntrypoint, jstring jLibraryUrl, jstring jInitialRoute, jobject jEntrypointArgs, jlong engineId)
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 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 jmethodID g_bitmap_copy_pixels_from_buffer_method
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 RegisterImageTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject image_texture_entry, jboolean reset_on_background)
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_bitmap_config_value_of
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_bitmap_create_bitmap_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 jboolean FlutterTextUtilsIsEmoji(JNIEnv *env, jobject obj, jint codePoint)
static void RegisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject surface_texture)
#define FLUTTER_BIND_JNI(global_field, jni_name, jni_arg)
#define FLUTTER_FOR_EACH_JNI_METHOD(V)

References AttachJNI(), CleanupMessageData(), DeferredComponentInstallFailure(), DestroyJNI(), DispatchEmptyPlatformMessage(), DispatchPlatformMessage(), DispatchPointerDataPacket(), DispatchSemanticsAction(), FLUTTER_BIND_JNI, FLUTTER_FOR_EACH_JNI_METHOD, FlutterTextUtilsIsEmoji(), FlutterTextUtilsIsEmojiModifier(), FlutterTextUtilsIsEmojiModifierBase(), FlutterTextUtilsIsRegionalIndicator(), FlutterTextUtilsIsVariationSelector(), FML_LOG, g_bitmap_class, g_bitmap_config_class, g_bitmap_config_value_of, g_bitmap_copy_pixels_from_buffer_method, g_bitmap_create_bitmap_method, g_flutter_jni_class, g_java_long_class, g_jni_constructor, g_jni_shell_holder_field, g_long_constructor, g_overlay_surface_id_method, g_overlay_surface_surface_method, GetBitmap(), GetIsSoftwareRendering(), InvokePlatformMessageEmptyResponseCallback(), InvokePlatformMessageResponseCallback(), IsSurfaceControlEnabled(), LoadDartDeferredLibrary(), LookupCallbackInformation(), MarkTextureFrameAvailable(), NotifyLowMemoryWarning(), fml::jni::JavaRef< T >::obj(), RegisterImageTexture(), RegisterTexture(), RunBundleAndSnapshotFromLibrary(), ScheduleFrame(), SetAccessibilityFeatures(), SetSemanticsEnabled(), SetViewportMetrics(), SpawnJNI(), SurfaceChanged(), SurfaceCreated(), SurfaceDestroyed(), SurfaceWindowChanged(), UnregisterTexture(), UpdateDisplayMetrics(), and UpdateJavaAssetManager().

Referenced by flutter::PlatformViewAndroid::Register().

◆ RegisterImageTexture()

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

Definition at line 547 of file platform_view_android_jni_impl.cc.

552 {
554 reset_on_background ? ImageExternalTexture::ImageLifecycle::kReset
555 : ImageExternalTexture::ImageLifecycle::kKeepAlive;
556
557 ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterImageTexture(
558 static_cast<int64_t>(texture_id), //
559 fml::jni::ScopedJavaGlobalRef<jobject>(env, image_texture_entry), //
560 lifecycle //
561 );
562}
ImageLifecycle
Whether the last image should be reset when the context is destroyed.

References ANDROID_SHELL_HOLDER, flutter::ImageExternalTexture::kKeepAlive, flutter::ImageExternalTexture::kReset, and texture_id.

Referenced by RegisterApi().

◆ RegisterTexture()

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

Definition at line 536 of file platform_view_android_jni_impl.cc.

540 {
541 ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture(
542 static_cast<int64_t>(texture_id), //
543 fml::jni::ScopedJavaGlobalRef<jobject>(env, surface_texture) //
544 );
545}

References ANDROID_SHELL_HOLDER, and texture_id.

Referenced by RegisterApi().

◆ 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 866 of file rasterizer.cc.

871 {
872 // There is no root surface transformation for the screenshot layer. Reset
873 // the matrix to identity.
874 DlMatrix root_surface_transformation;
875
876 auto frame = compositor_context.AcquireFrame(
877 /*gr_context=*/surface_context,
878 /*canvas=*/canvas,
879 /*view_embedder=*/nullptr,
880 /*root_surface_transformation=*/root_surface_transformation,
881 /*instrumentation_enabled=*/false,
882 /*surface_supports_readback=*/true,
883 /*raster_thread_merger=*/nullptr,
884 /*aiks_context=*/aiks_context.get());
885 canvas->Clear(DlColor::kTransparent());
886 frame->Raster(*tree, true, nullptr);
887 canvas->Flush();
888}
virtual std::unique_ptr< ScopedFrame > AcquireFrame(GrDirectContext *gr_context, DlCanvas *canvas, ExternalViewEmbedder *view_embedder, const DlMatrix &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:104
virtual void Flush()=0
A 4x4 matrix using column-major storage.
Definition matrix.h:37

References flutter::CompositorContext::AcquireFrame(), flutter::DlCanvas::Clear(), flutter::DlCanvas::Flush(), and RenderFrameForScreenshot().

Referenced by RenderFrameForScreenshot().

◆ Reset()

API void flutter::Reset ( SkPath *  path)

Definition at line 40 of file path_ops.cc.

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

References path.

◆ 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 {
33 FML_DCHECK(!image->isTextureBacked());
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(nullptr);
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(),
59 SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kNone),
60 SkImage::kDisallow_CachingHint)) {
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}

References FML_DCHECK, FML_LOG, image, fml::tracing::TraceFlow::Step(), and TRACE_EVENT0.

Referenced by flutter::ImageDecoderSkia::ImageFromCompressedData(), and ImageFromDecompressedData().

◆ 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_paths, // native_library_paths
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_paths, const char *native_library_symbol_name, bool is_executable)
MappingCallback isolate_snapshot_data
Definition settings.h:121
std::string isolate_snapshot_data_path
Definition settings.h:120
std::vector< std::string > application_library_paths
Definition settings.h:134

References flutter::Settings::application_library_paths, flutter::Settings::isolate_snapshot_data, flutter::Settings::isolate_snapshot_data_path, kDartIsolateSnapshotData, flutter::DartSnapshot::kIsolateDataSymbol, and SearchMapping().

Referenced by flutter::DartSnapshot::IsolateSnapshotFromSettings().

◆ 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_paths, // native_library_paths
173 DartSnapshot::kIsolateInstructionsSymbol, // native_library_symbol_name
174 true // is_executable
175 );
176#endif // DART_SNAPSHOT_STATIC_LINK
177}
const uint8_t kDartIsolateSnapshotInstructions[]
MappingCallback isolate_snapshot_instr
Definition settings.h:123
std::string isolate_snapshot_instr_path
Definition settings.h:122

References flutter::Settings::application_library_paths, flutter::Settings::isolate_snapshot_instr, flutter::Settings::isolate_snapshot_instr_path, kDartIsolateSnapshotInstructions, flutter::DartSnapshot::kIsolateInstructionsSymbol, and SearchMapping().

Referenced by flutter::DartSnapshot::IsolateSnapshotFromSettings().

◆ 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_paths, // native_library_paths
115 DartSnapshot::kVMDataSymbol, // native_library_symbol_name
116 false // is_executable
117 );
118#endif // DART_SNAPSHOT_STATIC_LINK
119}
const uint8_t kDartVmSnapshotData[]
MappingCallback vm_snapshot_data
Definition settings.h:116
std::string vm_snapshot_data_path
Definition settings.h:115

References flutter::Settings::application_library_paths, kDartVmSnapshotData, flutter::DartSnapshot::kVMDataSymbol, SearchMapping(), flutter::Settings::vm_snapshot_data, and flutter::Settings::vm_snapshot_data_path.

Referenced by flutter::DartSnapshot::VMSnapshotFromSettings().

◆ 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_paths, // native_library_paths
134 DartSnapshot::kVMInstructionsSymbol, // native_library_symbol_name
135 true // is_executable
136 );
137#endif // DART_SNAPSHOT_STATIC_LINK
138}
const uint8_t kDartVmSnapshotInstructions[]
std::string vm_snapshot_instr_path
Definition settings.h:117
MappingCallback vm_snapshot_instr
Definition settings.h:118

References flutter::Settings::application_library_paths, kDartVmSnapshotInstructions, flutter::DartSnapshot::kVMInstructionsSymbol, SearchMapping(), flutter::Settings::vm_snapshot_instr, and flutter::Settings::vm_snapshot_instr_path.

Referenced by flutter::DartSnapshot::VMSnapshotFromSettings().

◆ RunBundleAndSnapshotFromLibrary()

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

Definition at line 297 of file platform_view_android_jni_impl.cc.

305 {
306 auto apk_asset_provider = std::make_unique<flutter::APKAssetProvider>(
307 env, // jni environment
308 jAssetManager, // asset manager
309 fml::jni::JavaStringToString(env, jBundlePath) // apk asset dir
310 );
311 auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint);
312 auto libraryUrl = fml::jni::JavaStringToString(env, jLibraryUrl);
313 auto entrypoint_args = fml::jni::StringListToVector(env, jEntrypointArgs);
314
315 ANDROID_SHELL_HOLDER->Launch(std::move(apk_asset_provider), entrypoint,
316 libraryUrl, entrypoint_args, engineId);
317}
std::vector< std::string > StringListToVector(JNIEnv *env, jobject list)
Definition jni_util.cc:118

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

Referenced by RegisterApi().

◆ RunTester()

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

Definition at line 344 of file tester_main.cc.

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

References fml::paths::AbsolutePath(), fml::MessageLoop::AddTaskObserver(), flutter::Settings::application_kernel_asset, flutter::Settings::assets_dir, flutter::Settings::assets_path, ConfigureShell(), fml::MallocMapping::Copy(), flutter::Shell::Create(), flutter::IsolateConfiguration::CreateForKernel(), flutter::ScriptCompletionTaskObserver::DidProcessTask(), fml::Duplicate(), flutter::Settings::enable_impeller, flutter::Settings::enable_vulkan_validation, fml::MessageLoop::EnsureInitializedForCurrentThread(), flutter::Engine::Failure, FML_LOG, g_shell, fml::MessageLoop::GetCurrent(), flutter::ScriptCompletionTaskObserver::GetExitCodeForLastError(), flutter::Shell::GetPlatformView(), fml::MessageLoop::GetTaskRunner(), flutter::Shell::GetTaskRunners(), flutter::Shell::IsSetup(), flutter::Rasterizer::kBitmap, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, fml::kRead, fml::FileMapping::kRead, flutter::ThreadHost::kUi, fml::MakeCopyable(), fml::OpenDirectory(), fml::OpenFile(), fml::MessageLoop::RemoveTaskObserver(), fml::MessageLoop::Run(), flutter::Shell::RunEngine(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), UnblockSIGPROF(), and fml::AutoResetWaitableEvent::Wait().

Referenced by main().

◆ RuntimeStageBackendToString()

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

◆ 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(),
22 std::numeric_limits<float>::max());
23 }
24}

References value.

Referenced by flutter::CanvasPath::addArc(), flutter::CanvasPath::addOval(), flutter::CanvasPath::addPath(), flutter::CanvasPath::addPathWithMatrix(), flutter::SceneBuilder::addPerformanceOverlay(), flutter::SceneBuilder::addPicture(), flutter::SceneBuilder::addPlatformView(), flutter::CanvasPath::addRect(), flutter::SceneBuilder::addTexture(), flutter::CanvasPath::arcTo(), flutter::CanvasPath::arcToPoint(), flutter::CanvasPath::conicTo(), flutter::CanvasPath::contains(), flutter::RSuperellipse::contains(), flutter::RSuperellipse::Create(), flutter::CanvasPath::cubicTo(), flutter::CanvasPath::extendWithPath(), flutter::CanvasPath::extendWithPathAndMatrix(), flutter::CanvasPathMeasure::getPosTan(), flutter::CanvasPathMeasure::getSegment(), flutter::ImageFilter::initBlur(), flutter::ImageFilter::initDilate(), flutter::ImageFilter::initErode(), flutter::CanvasGradient::initRadial(), flutter::CanvasGradient::initSweep(), flutter::CanvasGradient::initTwoPointConical(), flutter::CanvasPath::lineTo(), flutter::CanvasPath::moveTo(), flutter::SceneBuilder::pushClipRect(), flutter::SceneBuilder::pushImageFilter(), flutter::SceneBuilder::pushOffset(), flutter::SceneBuilder::pushOpacity(), flutter::SceneBuilder::pushShaderMask(), flutter::CanvasPath::quadraticBezierTo(), flutter::CanvasPath::relativeArcToPoint(), flutter::CanvasPath::relativeConicTo(), flutter::CanvasPath::relativeCubicTo(), flutter::CanvasPath::relativeLineTo(), flutter::CanvasPath::relativeMoveTo(), flutter::CanvasPath::relativeQuadraticBezierTo(), flutter::CanvasPath::shift(), ToDlMatrix(), ToSkM44(), ToSkMatrix(), and flutter::SemanticsUpdateBuilder::updateNode().

◆ ScheduleFrame()

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

Definition at line 580 of file platform_view_android_jni_impl.cc.

580 {
581 ANDROID_SHELL_HOLDER->GetPlatformView()->ScheduleFrame();
582}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi(), flutter::testing::TEST(), and flutter::testing::TEST_F().

◆ ScreenshotLayerTreeAsPicture()

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

Definition at line 829 of file rasterizer.cc.

831 {
832#if SLIMPELLER
833 return nullptr;
834#else // SLIMPELLER
835 FML_DCHECK(tree != nullptr);
836 SkPictureRecorder recorder;
837 recorder.beginRecording(
838 SkRect::MakeWH(tree->frame_size().width, tree->frame_size().height));
839
840 DlMatrix root_surface_transformation;
841 DlSkCanvasAdapter canvas(recorder.getRecordingCanvas());
842
843 // TODO(amirh): figure out how to take a screenshot with embedded UIView.
844 // https://github.com/flutter/flutter/issues/23435
845 auto frame = compositor_context.AcquireFrame(nullptr, &canvas, nullptr,
846 root_surface_transformation,
847 false, true, nullptr, nullptr);
848 frame->Raster(*tree, true, nullptr);
849
850#if defined(OS_FUCHSIA)
851 SkSerialProcs procs = {0};
852 procs.fImageProc = SerializeImageWithoutData;
853 procs.fTypefaceProc = SerializeTypefaceWithoutData;
854#else
855 SkSerialProcs procs = {0};
856 procs.fTypefaceProc = SerializeTypefaceWithData;
857 procs.fImageProc = [](SkImage* img, void*) -> sk_sp<SkData> {
858 return SkPngEncoder::Encode(nullptr, img, SkPngEncoder::Options{});
859 };
860#endif
861
862 return recorder.finishRecordingAsPicture()->serialize(&procs);
863#endif // SLIMPELLER
864}
Backend implementation of |DlCanvas| for |SkCanvas|.
const DlISize & frame_size() const
Definition layer_tree.h:54
sk_sp< SkData > SerializeTypefaceWithData(SkTypeface *typeface, void *ctx)

References flutter::CompositorContext::AcquireFrame(), FML_DCHECK, flutter::LayerTree::frame_size(), impeller::TSize< T >::height, ScreenshotLayerTreeAsPicture(), SerializeImageWithoutData(), SerializeTypefaceWithData(), SerializeTypefaceWithoutData(), and impeller::TSize< T >::width.

Referenced by flutter::Rasterizer::ScreenshotLastLayerTree(), and ScreenshotLayerTreeAsPicture().

◆ 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_paths,
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_paths) {
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)

References fml::NativeLibrary::Create(), fml::NativeLibrary::CreateForCurrentProcess(), GetFileMapping(), and path.

Referenced by ResolveIsolateData(), ResolveIsolateInstructions(), ResolveVMData(), ResolveVMInstructions(), and flutter::DartSnapshot::VMServiceIsolateSnapshotFromSettings().

◆ SemanticsFlagsToInt()

FlutterSemanticsFlag flutter::SemanticsFlagsToInt ( const SemanticsFlags flags)

Definition at line 89 of file embedder_semantics_update.cc.

89 {
90 int result = 0;
91
92 if (flags.isChecked != SemanticsCheckState::kNone) {
93 result |= (1 << 0);
94 }
95 if (flags.isChecked == SemanticsCheckState::kTrue) {
96 result |= (1 << 1);
97 }
98 if (flags.isSelected == SemanticsTristate::kTrue) {
99 result |= (1 << 2);
100 }
101 if (flags.isButton) {
102 result |= (1 << 3);
103 }
104 if (flags.isTextField) {
105 result |= (1 << 4);
106 }
107 if (flags.isFocused == SemanticsTristate::kTrue) {
108 result |= (1 << 5);
109 }
110 if (flags.isEnabled != SemanticsTristate::kNone) {
111 result |= (1 << 6);
112 }
113 if (flags.isEnabled == SemanticsTristate::kTrue) {
114 result |= (1 << 7);
115 }
116 if (flags.isInMutuallyExclusiveGroup) {
117 result |= (1 << 8);
118 }
119 if (flags.isHeader) {
120 result |= (1 << 9);
121 }
122 if (flags.isObscured) {
123 result |= (1 << 10);
124 }
125 if (flags.scopesRoute) {
126 result |= (1 << 11);
127 }
128 if (flags.namesRoute) {
129 result |= (1 << 12);
130 }
131 if (flags.isHidden) {
132 result |= (1 << 13);
133 }
134 if (flags.isImage) {
135 result |= (1 << 14);
136 }
137 if (flags.isLiveRegion) {
138 result |= (1 << 15);
139 }
140 if (flags.isToggled != SemanticsTristate::kNone) {
141 result |= (1 << 16);
142 }
143 if (flags.isToggled == SemanticsTristate::kTrue) {
144 result |= (1 << 17);
145 }
146 if (flags.hasImplicitScrolling) {
147 result |= (1 << 18);
148 }
149 if (flags.isMultiline) {
150 result |= (1 << 19);
151 }
152 if (flags.isReadOnly) {
153 result |= (1 << 20);
154 }
155 if (flags.isFocused != SemanticsTristate::kNone) {
156 result |= (1 << 21);
157 }
158 if (flags.isLink) {
159 result |= (1 << 22);
160 }
161 if (flags.isSlider) {
162 result |= (1 << 23);
163 }
164 if (flags.isKeyboardKey) {
165 result |= (1 << 24);
166 }
167 if (flags.isChecked == SemanticsCheckState::kMixed) {
168 result |= (1 << 25);
169 }
170 if (flags.isExpanded != SemanticsTristate::kNone) {
171 result |= (1 << 26);
172 }
173 if (flags.isExpanded == SemanticsTristate::kTrue) {
174 result |= (1 << 27);
175 }
176 if (flags.isSelected != SemanticsTristate::kNone) {
177 result |= (1 << 28);
178 }
179 if (flags.isRequired != SemanticsTristate::kNone) {
180 result |= (1 << 29);
181 }
182 if (flags.isRequired == SemanticsTristate::kTrue) {
183 result |= (1 << 30);
184 }
185
186 return static_cast<FlutterSemanticsFlag>(result);
187}
FlutterSemanticsFlag
Definition embedder.h:185
SemanticsTristate isExpanded
SemanticsCheckState isChecked
SemanticsTristate isRequired
SemanticsTristate isFocused
SemanticsTristate isSelected
SemanticsTristate isToggled
SemanticsTristate isEnabled

References flutter::SemanticsFlags::hasImplicitScrolling, flutter::SemanticsFlags::isButton, flutter::SemanticsFlags::isChecked, flutter::SemanticsFlags::isEnabled, flutter::SemanticsFlags::isExpanded, flutter::SemanticsFlags::isFocused, flutter::SemanticsFlags::isHeader, flutter::SemanticsFlags::isHidden, flutter::SemanticsFlags::isImage, flutter::SemanticsFlags::isInMutuallyExclusiveGroup, flutter::SemanticsFlags::isKeyboardKey, flutter::SemanticsFlags::isLink, flutter::SemanticsFlags::isLiveRegion, flutter::SemanticsFlags::isMultiline, flutter::SemanticsFlags::isObscured, flutter::SemanticsFlags::isReadOnly, flutter::SemanticsFlags::isRequired, flutter::SemanticsFlags::isSelected, flutter::SemanticsFlags::isSlider, flutter::SemanticsFlags::isTextField, flutter::SemanticsFlags::isToggled, kMixed, kNone, kTrue, flutter::SemanticsFlags::namesRoute, and flutter::SemanticsFlags::scopesRoute.

◆ 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();
38 SkDynamicMemoryWStream stream;
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};

References FML_CHECK, image, and flutter::ImageMetaData::width.

Referenced by ScreenshotLayerTreeAsPicture().

◆ SerializeTypefaceWithData()

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

Definition at line 18 of file serialization_callbacks.cc.

18 {
19 return typeface->serialize(SkTypeface::SerializeBehavior::kDoIncludeData);
20}

Referenced by ScreenshotLayerTreeAsPicture().

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

Referenced by ScreenshotLayerTreeAsPicture().

◆ ServiceProtocolFailureError()

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

Definition at line 1874 of file shell.cc.

1876 {
1877 rapidjson::Value details(rapidjson::kObjectType);
1878 details.AddMember("details", std::move(error_details), allocator);
1879 response->AddMember("data", details, allocator);
1880 }
1881}

◆ ServiceProtocolParameterError()

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

Definition at line 1860 of file shell.cc.

1863 {
1864 weak_engine_->GetUIIsolateMainPort(),
1865 weak_engine_->GetUIIsolateName(),
1866 };
1867}
1868
1869static void ServiceProtocolParameterError(rapidjson::Document* response,
1870 std::string error_details) {
1871 auto& allocator = response->GetAllocator();
1872 response->SetObject();
static void ServiceProtocolParameterError(rapidjson::Document *response, std::string error_details)
Definition shell.cc:1860

◆ ServiceStreamCancelCallback()

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

Definition at line 168 of file dart_vm.cc.

168 {
169 if (strcmp(stream_id, kStdoutStreamId) == 0) {
170 dart::bin::SetCaptureStdout(false);
171 } else if (strcmp(stream_id, kStderrStreamId) == 0) {
172 dart::bin::SetCaptureStderr(false);
173 }
174}

References kStderrStreamId, and kStdoutStreamId.

◆ ServiceStreamListenCallback()

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

Definition at line 157 of file dart_vm.cc.

157 {
158 if (strcmp(stream_id, kStdoutStreamId) == 0) {
159 dart::bin::SetCaptureStdout(true);
160 return true;
161 } else if (strcmp(stream_id, kStderrStreamId) == 0) {
162 dart::bin::SetCaptureStderr(true);
163 return true;
164 }
165 return false;
166}

References kStderrStreamId, and kStdoutStreamId.

◆ SetAccessibilityFeatures()

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

Definition at line 525 of file platform_view_android_jni_impl.cc.

528 {
529 ANDROID_SHELL_HOLDER->GetPlatformView()->SetAccessibilityFeatures(flags);
530}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ SetFontFile()

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

Definition at line 24 of file flow_test_utils.cc.

24 {
25 gFontFile = file;
26}

References gFontFile.

Referenced by main().

◆ SetGoldenDir()

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

Definition at line 16 of file flow_test_utils.cc.

16 {
17 gGoldenDir = dir;
18}

References gGoldenDir.

Referenced by main().

◆ SetSemanticsEnabled()

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

Definition at line 518 of file platform_view_android_jni_impl.cc.

521 {
522 ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled);
523}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ SetTextureLayout()

static bool flutter::SetTextureLayout ( const ContextVK context,
const TextureSourceVK texture,
vk::ImageLayout  layout,
LayoutUpdateMode  mode 
)
static

Definition at line 44 of file surface_texture_external_texture_vk_impeller.cc.

47 {
48 TRACE_EVENT0("flutter", __FUNCTION__);
49 if (!texture) {
50 return true;
51 }
52 auto command_buffer = context.CreateCommandBuffer();
53 if (!command_buffer) {
55 << "Could not create command buffer for texture layout update.";
56 return false;
57 }
58 command_buffer->SetLabel("GLVKTextureLayoutUpdateCB");
59 const CommandBufferVK& encoder = CommandBufferVK::Cast(*command_buffer);
60 const auto command_buffer_vk = encoder.GetCommandBuffer();
61
62 BarrierVK barrier;
63 barrier.cmd_buffer = command_buffer_vk;
64 barrier.new_layout = layout;
65 barrier.src_stage = vk::PipelineStageFlagBits::eColorAttachmentOutput |
66 impeller::vk::PipelineStageFlagBits::eFragmentShader;
67 barrier.src_access = vk::AccessFlagBits::eColorAttachmentWrite |
68 vk::AccessFlagBits::eShaderRead;
69 barrier.dst_stage = impeller::vk::PipelineStageFlagBits::eFragmentShader;
70 barrier.dst_access = vk::AccessFlagBits::eShaderRead;
71
72 if (!texture->SetLayout(barrier).ok()) {
73 VALIDATION_LOG << "Could not encoder layout transition.";
74 return false;
75 }
76
77 encoder.EndCommandBuffer();
78
79 vk::SubmitInfo submit_info;
80 submit_info.setCommandBuffers(command_buffer_vk);
81
82 // There is no need to track the fence in the encoder since we are going to do
83 // a sync wait for completion.
84 vk::UniqueFence fence;
85
86 if (mode == LayoutUpdateMode::kSync) {
87 auto fence_pair =
88 context.GetDevice().createFenceUnique(vk::FenceCreateFlags{});
89 if (fence_pair.result != impeller::vk::Result::eSuccess) {
90 VALIDATION_LOG << "Could not create fence.";
91 return false;
92 }
93 fence = std::move(fence_pair.value);
94 }
95
96 if (context.GetGraphicsQueue()->Submit(submit_info, fence.get()) !=
97 impeller::vk::Result::eSuccess) {
98 VALIDATION_LOG << "Could not submit layout transition fence.";
99 return false;
100 }
101
102 using namespace std::chrono_literals;
103
104 if (fence &&
105 context.GetDevice().waitForFences(
106 fence.get(), //
107 VK_TRUE, //
108 std::chrono::duration_cast<std::chrono::nanoseconds>(1s).count() //
109 ) != impeller::vk::Result::eSuccess) {
110 VALIDATION_LOG << "Could not perform sync wait on fence.";
111 return false;
112 }
113
114 return true;
115}
const vk::Device & GetDevice() const
std::shared_ptr< CommandBuffer > CreateCommandBuffer() const override
Create a new command buffer. Command buffers can be used to encode graphics, blit,...
const std::shared_ptr< QueueVK > & GetGraphicsQueue() const
FlTexture * texture

References impeller::BarrierVK::cmd_buffer, impeller::ContextVK::CreateCommandBuffer(), impeller::BarrierVK::dst_access, impeller::BarrierVK::dst_stage, impeller::CommandBufferVK::EndCommandBuffer(), impeller::CommandBufferVK::GetCommandBuffer(), impeller::ContextVK::GetDevice(), impeller::ContextVK::GetGraphicsQueue(), kSync, mode, impeller::BarrierVK::new_layout, impeller::BarrierVK::src_access, impeller::BarrierVK::src_stage, texture, TRACE_EVENT0, and VALIDATION_LOG.

◆ SettingsFromCommandLine()

Settings flutter::SettingsFromCommandLine ( const fml::CommandLine command_line,
bool  require_merged_platform_ui_thread 
)

Definition at line 230 of file switches.cc.

231 {
232 Settings settings = {};
233
234 // Set executable name.
235 if (command_line.has_argv0()) {
236 settings.executable_name = command_line.argv0();
237 }
238
239 // Enable the VM Service
240 settings.enable_vm_service =
241 !command_line.HasOption(FlagForSwitch(Switch::DisableVMService));
242
243 // Enable mDNS VM Service Publication
244 settings.enable_vm_service_publication = !command_line.HasOption(
245 FlagForSwitch(Switch::DisableVMServicePublication));
246
247 // Set VM Service Host
248 if (command_line.HasOption(FlagForSwitch(Switch::DeviceVMServiceHost))) {
249 command_line.GetOptionValue(FlagForSwitch(Switch::DeviceVMServiceHost),
250 &settings.vm_service_host);
251 }
252 // Default the VM Service port based on --ipv6 if not set.
253 if (settings.vm_service_host.empty()) {
254 settings.vm_service_host =
255 command_line.HasOption(FlagForSwitch(Switch::IPv6)) ? "::1"
256 : "127.0.0.1";
257 }
258
259 // Set VM Service Port
260 if (command_line.HasOption(FlagForSwitch(Switch::DeviceVMServicePort))) {
261 if (!GetSwitchValue(command_line, Switch::DeviceVMServicePort,
262 &settings.vm_service_port)) {
263 FML_LOG(INFO)
264 << "VM Service port specified was malformed. Will default to "
265 << settings.vm_service_port;
266 }
267 }
268
269 settings.may_insecurely_connect_to_all_domains = !command_line.HasOption(
270 FlagForSwitch(Switch::DisallowInsecureConnections));
271
272 command_line.GetOptionValue(FlagForSwitch(Switch::DomainNetworkPolicy),
273 &settings.domain_network_policy);
274
275 // Disable need for authentication codes for VM service communication, if
276 // specified.
278 command_line.HasOption(FlagForSwitch(Switch::DisableServiceAuthCodes));
279
280 // Allow fallback to automatic port selection if binding to a specified port
281 // fails.
283 command_line.HasOption(FlagForSwitch(Switch::EnableServicePortFallback));
284
285 // Checked mode overrides.
286 settings.disable_dart_asserts =
287 command_line.HasOption(FlagForSwitch(Switch::DisableDartAsserts));
288
289 settings.start_paused =
290 command_line.HasOption(FlagForSwitch(Switch::StartPaused));
291
292 settings.enable_checked_mode =
293 command_line.HasOption(FlagForSwitch(Switch::EnableCheckedMode));
294
295 settings.enable_dart_profiling =
296 command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling));
297
298 settings.profile_startup =
299 command_line.HasOption(FlagForSwitch(Switch::ProfileStartup));
300
302 command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering));
303
304 settings.endless_trace_buffer =
305 command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer));
306
307 settings.trace_startup =
308 command_line.HasOption(FlagForSwitch(Switch::TraceStartup));
309
310 settings.enable_serial_gc =
311 command_line.HasOption(FlagForSwitch(Switch::EnableSerialGC));
312
313#if !FLUTTER_RELEASE
314 settings.trace_skia = true;
315
316 if (command_line.HasOption(FlagForSwitch(Switch::TraceSkia))) {
317 // If --trace-skia is specified, then log all Skia events.
318 settings.trace_skia_allowlist.reset();
319 } else {
320 std::string trace_skia_allowlist;
321 command_line.GetOptionValue(FlagForSwitch(Switch::TraceSkiaAllowlist),
322 &trace_skia_allowlist);
323 if (trace_skia_allowlist.size()) {
324 settings.trace_skia_allowlist = ParseCommaDelimited(trace_skia_allowlist);
325 } else {
326 settings.trace_skia_allowlist = {"skia.shaders"};
327 }
328 }
329#endif // !FLUTTER_RELEASE
330
331 std::string trace_allowlist;
332 command_line.GetOptionValue(FlagForSwitch(Switch::TraceAllowlist),
333 &trace_allowlist);
334 settings.trace_allowlist = ParseCommaDelimited(trace_allowlist);
335
336 settings.trace_systrace =
337 command_line.HasOption(FlagForSwitch(Switch::TraceSystrace));
338
339 command_line.GetOptionValue(FlagForSwitch(Switch::TraceToFile),
340 &settings.trace_to_file);
341
342 settings.profile_microtasks =
343 command_line.HasOption(FlagForSwitch(Switch::ProfileMicrotasks));
344
346 command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering));
347
348 settings.verbose_logging =
349 command_line.HasOption(FlagForSwitch(Switch::VerboseLogging));
350
351 command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir),
352 &settings.assets_path);
353
354 std::vector<std::string_view> aot_shared_library_name =
355 command_line.GetOptionValues(FlagForSwitch(Switch::AotSharedLibraryName));
356
357 std::vector<std::string_view> vmservice_shared_library_name =
358 command_line.GetOptionValues(
359 FlagForSwitch(Switch::AotVMServiceSharedLibraryName));
360 for (auto path : vmservice_shared_library_name) {
361 settings.vmservice_snapshot_library_path.emplace_back(path);
362 }
363
364 std::string snapshot_asset_path;
365 command_line.GetOptionValue(FlagForSwitch(Switch::SnapshotAssetPath),
366 &snapshot_asset_path);
367
368 std::string vm_snapshot_data_filename;
369 command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotData),
370 &vm_snapshot_data_filename);
371
372 command_line.GetOptionValue(FlagForSwitch(Switch::Route), &settings.route);
373
374 std::string vm_snapshot_instr_filename;
375 command_line.GetOptionValue(FlagForSwitch(Switch::VmSnapshotInstructions),
376 &vm_snapshot_instr_filename);
377
378 std::string isolate_snapshot_data_filename;
379 command_line.GetOptionValue(FlagForSwitch(Switch::IsolateSnapshotData),
380 &isolate_snapshot_data_filename);
381
382 std::string isolate_snapshot_instr_filename;
383 command_line.GetOptionValue(
384 FlagForSwitch(Switch::IsolateSnapshotInstructions),
385 &isolate_snapshot_instr_filename);
386
387 if (!aot_shared_library_name.empty()) {
388 for (std::string_view name : aot_shared_library_name) {
389 settings.application_library_paths.emplace_back(name);
390 }
391 } else if (!snapshot_asset_path.empty()) {
392 settings.vm_snapshot_data_path =
393 fml::paths::JoinPaths({snapshot_asset_path, vm_snapshot_data_filename});
395 {snapshot_asset_path, vm_snapshot_instr_filename});
397 {snapshot_asset_path, isolate_snapshot_data_filename});
399 {snapshot_asset_path, isolate_snapshot_instr_filename});
400 }
401
402 command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath),
403 &settings.temp_directory_path);
404
405 bool leak_vm = "true" == command_line.GetOptionValueWithDefault(
406 FlagForSwitch(Switch::LeakVM), "true");
407 settings.leak_vm = leak_vm;
408
409 if (settings.icu_initialization_required) {
410 command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath),
411 &settings.icu_data_path);
412 if (command_line.HasOption(FlagForSwitch(Switch::ICUSymbolPrefix))) {
413 std::string icu_symbol_prefix, native_lib_path;
414 command_line.GetOptionValue(FlagForSwitch(Switch::ICUSymbolPrefix),
415 &icu_symbol_prefix);
416 command_line.GetOptionValue(FlagForSwitch(Switch::ICUNativeLibPath),
417 &native_lib_path);
418
419#if FML_OS_ANDROID
420 settings.icu_mapper = GetICUStaticMapping;
421#else
422 settings.icu_mapper = [icu_symbol_prefix, native_lib_path] {
423 return GetSymbolMapping(icu_symbol_prefix, native_lib_path);
424 };
425#endif
426 }
427 }
428
429 settings.use_test_fonts =
430 command_line.HasOption(FlagForSwitch(Switch::UseTestFonts));
431 settings.use_asset_fonts =
432 !command_line.HasOption(FlagForSwitch(Switch::DisableAssetFonts));
433
434#if FML_OS_IOS || FML_OS_IOS_SIMULATOR || SLIMPELLER
435// On these configurations, the Impeller flags are completely ignored with the
436// default taking hold.
437#else // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
438 {
439 std::string enable_impeller_value;
440 if (command_line.GetOptionValue(FlagForSwitch(Switch::EnableImpeller),
441 &enable_impeller_value)) {
442 settings.enable_impeller =
443 enable_impeller_value.empty() || "true" == enable_impeller_value;
444 }
445 }
446#endif // FML_OS_IOS && !FML_OS_IOS_SIMULATOR
447
448 {
449 std::string impeller_backend_value;
450 if (command_line.GetOptionValue(FlagForSwitch(Switch::ImpellerBackend),
451 &impeller_backend_value)) {
452 if (!impeller_backend_value.empty()) {
453 settings.requested_rendering_backend = impeller_backend_value;
454 }
455 }
456 }
457
458 settings.enable_vulkan_validation =
459 command_line.HasOption(FlagForSwitch(Switch::EnableVulkanValidation));
461 command_line.HasOption(FlagForSwitch(Switch::EnableOpenGLGPUTracing));
463 command_line.HasOption(FlagForSwitch(Switch::EnableVulkanGPUTracing));
464
465 settings.enable_embedder_api =
466 command_line.HasOption(FlagForSwitch(Switch::EnableEmbedderAPI));
467
468 settings.prefetched_default_font_manager = command_line.HasOption(
469 FlagForSwitch(Switch::PrefetchedDefaultFontManager));
470
471 std::string all_dart_flags;
472 if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags),
473 &all_dart_flags)) {
474 // Assume that individual flags are comma separated.
475 std::vector<std::string> flags = ParseCommaDelimited(all_dart_flags);
476 for (const auto& flag : flags) {
477 if (!IsAllowedDartVMFlag(flag)) {
478 FML_LOG(FATAL) << "Encountered disallowed Dart VM flag: " << flag;
479 }
480 settings.dart_flags.push_back(flag);
481 }
482 }
483
484#if !FLUTTER_RELEASE
485 command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag);
486#endif
487
489 command_line.HasOption(FlagForSwitch(Switch::DumpSkpOnShaderCompilation));
490
491 settings.cache_sksl =
492 command_line.HasOption(FlagForSwitch(Switch::CacheSkSL));
493
494 settings.purge_persistent_cache =
495 command_line.HasOption(FlagForSwitch(Switch::PurgePersistentCache));
496
497 if (command_line.HasOption(FlagForSwitch(Switch::OldGenHeapSize))) {
498 std::string old_gen_heap_size;
499 command_line.GetOptionValue(FlagForSwitch(Switch::OldGenHeapSize),
500 &old_gen_heap_size);
501 settings.old_gen_heap_size = std::stoi(old_gen_heap_size);
502 }
503
504 if (command_line.HasOption(
505 FlagForSwitch(Switch::ResourceCacheMaxBytesThreshold))) {
506 std::string resource_cache_max_bytes_threshold;
507 command_line.GetOptionValue(
508 FlagForSwitch(Switch::ResourceCacheMaxBytesThreshold),
509 &resource_cache_max_bytes_threshold);
511 std::stoi(resource_cache_max_bytes_threshold);
512 }
513
514 settings.enable_platform_isolates =
515 command_line.HasOption(FlagForSwitch(Switch::EnablePlatformIsolates));
516
517 settings.enable_surface_control = command_line.HasOption(
518 FlagForSwitch(Switch::EnableAndroidSurfaceControl));
519
520 constexpr std::string_view kMergedThreadEnabled = "enabled";
521 constexpr std::string_view kMergedThreadDisabled = "disabled";
522 constexpr std::string_view kMergedThreadMergeAfterLaunch = "mergeAfterLaunch";
523 if (command_line.HasOption(
524 FlagForSwitch(Switch::DisableMergedPlatformUIThread))) {
525 FML_CHECK(!require_merged_platform_ui_thread)
526 << "This platform does not support the "
527 << FlagForSwitch(Switch::DisableMergedPlatformUIThread) << " flag";
528
530 Settings::MergedPlatformUIThread::kDisabled;
531 } else if (command_line.HasOption(
532 FlagForSwitch(Switch::MergedPlatformUIThread))) {
533 std::string merged_platform_ui;
534 command_line.GetOptionValue(FlagForSwitch(Switch::MergedPlatformUIThread),
535 &merged_platform_ui);
536 if (merged_platform_ui == kMergedThreadEnabled) {
538 Settings::MergedPlatformUIThread::kEnabled;
539 } else if (merged_platform_ui == kMergedThreadDisabled) {
540 FML_CHECK(!require_merged_platform_ui_thread)
541 << "This platform does not support the "
542 << FlagForSwitch(Switch::MergedPlatformUIThread) << "="
543 << kMergedThreadDisabled << " flag";
544
546 Settings::MergedPlatformUIThread::kDisabled;
547 } else if (merged_platform_ui == kMergedThreadMergeAfterLaunch) {
549 Settings::MergedPlatformUIThread::kMergeAfterLaunch;
550 }
551 }
552
553 settings.enable_flutter_gpu =
554 command_line.HasOption(FlagForSwitch(Switch::EnableFlutterGPU));
556 command_line.HasOption(FlagForSwitch(Switch::ImpellerLazyShaderMode));
558 command_line.HasOption(FlagForSwitch(Switch::ImpellerAntialiasLines));
559
560 return settings;
561}
const std::string & argv0() const
std::vector< std::string_view > GetOptionValues(std::string_view name) const
std::string GetOptionValueWithDefault(std::string_view name, std::string_view default_value) const
bool HasOption(std::string_view name, size_t *index=nullptr) const
bool has_argv0() const
static bool IsAllowedDartVMFlag(const std::string &flag)
Definition switches.cc:165
static bool GetSwitchValue(const fml::CommandLine &command_line, Switch sw, T *result)
Definition switches.cc:183
static std::vector< std::string > ParseCommaDelimited(const std::string &input)
Definition switches.cc:155
std::unique_ptr< fml::Mapping > GetSymbolMapping(const std::string &symbol_prefix, const std::string &native_lib_path)
Definition switches.cc:202
std::string JoinPaths(std::initializer_list< std::string > components)
Definition paths.cc:14
bool prefetched_default_font_manager
Definition settings.h:215
bool enable_embedder_api
Definition settings.h:360
std::vector< std::string > vmservice_snapshot_library_path
Definition settings.h:138
bool enable_software_rendering
Definition settings.h:317
bool icu_initialization_required
Definition settings.h:326
bool endless_trace_buffer
Definition settings.h:159
bool impeller_enable_lazy_shader_mode
Definition settings.h:239
bool disable_service_auth_codes
Definition settings.h:202
std::string temp_directory_path
Definition settings.h:144
bool enable_opengl_gpu_tracing
Definition settings.h:256
bool enable_dart_profiling
Definition settings.h:160
MergedPlatformUIThread merged_platform_ui_thread
Definition settings.h:379
bool skia_deterministic_rendering_on_cpu
Definition settings.h:318
bool purge_persistent_cache
Definition settings.h:158
bool enable_vulkan_gpu_tracing
Definition settings.h:259
std::vector< std::string > trace_allowlist
Definition settings.h:150
bool enable_flutter_gpu
Definition settings.h:233
bool enable_surface_control
Definition settings.h:236
std::string vm_service_host
Definition settings.h:193
MappingCallback icu_mapper
Definition settings.h:328
bool dump_skp_on_shader_compilation
Definition settings.h:156
std::string log_tag
Definition settings.h:320
bool profile_microtasks
Definition settings.h:164
uint32_t vm_service_port
Definition settings.h:198
std::vector< std::string > dart_flags
Definition settings.h:145
bool impeller_antialiased_lines
Definition settings.h:242
bool may_insecurely_connect_to_all_domains
Definition settings.h:167
std::string route
Definition settings.h:125
bool enable_checked_mode
Definition settings.h:147
std::string executable_name
Definition settings.h:180
bool enable_service_port_fallback
Definition settings.h:206
bool enable_vm_service_publication
Definition settings.h:190
std::optional< std::vector< std::string > > trace_skia_allowlist
Definition settings.h:151
std::optional< std::string > requested_rendering_backend
Definition settings.h:248
std::string icu_data_path
Definition settings.h:327
bool enable_platform_isolates
Definition settings.h:365
std::string trace_to_file
Definition settings.h:154
bool disable_dart_asserts
Definition settings.h:162
int64_t old_gen_heap_size
Definition settings.h:352
size_t resource_cache_max_bytes_threshold
Definition settings.h:355
std::string domain_network_policy
Definition settings.h:169

References flutter::Settings::application_library_paths, fml::CommandLine::argv0(), flutter::Settings::assets_path, flutter::Settings::cache_sksl, flutter::Settings::dart_flags, flutter::Settings::disable_dart_asserts, flutter::Settings::disable_service_auth_codes, flutter::Settings::domain_network_policy, flutter::Settings::dump_skp_on_shader_compilation, flutter::Settings::enable_checked_mode, flutter::Settings::enable_dart_profiling, flutter::Settings::enable_embedder_api, flutter::Settings::enable_flutter_gpu, flutter::Settings::enable_impeller, flutter::Settings::enable_opengl_gpu_tracing, flutter::Settings::enable_platform_isolates, flutter::Settings::enable_serial_gc, flutter::Settings::enable_service_port_fallback, flutter::Settings::enable_software_rendering, flutter::Settings::enable_surface_control, flutter::Settings::enable_vm_service, flutter::Settings::enable_vm_service_publication, flutter::Settings::enable_vulkan_gpu_tracing, flutter::Settings::enable_vulkan_validation, flutter::Settings::endless_trace_buffer, flutter::Settings::executable_name, FlagForSwitch(), FML_CHECK, FML_LOG, fml::CommandLine::GetOptionValue(), fml::CommandLine::GetOptionValues(), fml::CommandLine::GetOptionValueWithDefault(), GetSwitchValue(), GetSymbolMapping(), fml::CommandLine::has_argv0(), fml::CommandLine::HasOption(), flutter::Settings::icu_data_path, flutter::Settings::icu_initialization_required, flutter::Settings::icu_mapper, flutter::Settings::impeller_antialiased_lines, flutter::Settings::impeller_enable_lazy_shader_mode, IsAllowedDartVMFlag(), flutter::Settings::isolate_snapshot_data_path, flutter::Settings::isolate_snapshot_instr_path, fml::paths::JoinPaths(), flutter::Settings::kDisabled, flutter::Settings::kEnabled, flutter::Settings::kMergeAfterLaunch, flutter::Settings::leak_vm, flutter::Settings::log_tag, flutter::Settings::may_insecurely_connect_to_all_domains, flutter::Settings::merged_platform_ui_thread, name, flutter::Settings::old_gen_heap_size, ParseCommaDelimited(), path, flutter::Settings::prefetched_default_font_manager, flutter::Settings::profile_microtasks, flutter::Settings::profile_startup, flutter::Settings::purge_persistent_cache, flutter::Settings::requested_rendering_backend, flutter::Settings::resource_cache_max_bytes_threshold, flutter::Settings::route, flutter::Settings::skia_deterministic_rendering_on_cpu, flutter::Settings::start_paused, flutter::Settings::temp_directory_path, flutter::Settings::trace_allowlist, flutter::Settings::trace_skia, flutter::Settings::trace_skia_allowlist, flutter::Settings::trace_startup, flutter::Settings::trace_systrace, flutter::Settings::trace_to_file, flutter::Settings::use_asset_fonts, flutter::Settings::use_test_fonts, flutter::Settings::verbose_logging, flutter::Settings::vm_service_host, flutter::Settings::vm_service_port, flutter::Settings::vm_snapshot_data_path, flutter::Settings::vm_snapshot_instr_path, and flutter::Settings::vmservice_snapshot_library_path.

Referenced by FlutterDartProject::defaultBundleIdentifier, FlutterEngineInitialize(), main(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), and flutter::testing::TestDartVmFlags().

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

354 {
355 // Convert java->c++. javaDisplayFeaturesBounds, javaDisplayFeaturesType and
356 // javaDisplayFeaturesState cannot be null
357 jsize rectSize = env->GetArrayLength(javaDisplayFeaturesBounds);
358 std::vector<int> boundsIntVector(rectSize);
359 env->GetIntArrayRegion(javaDisplayFeaturesBounds, 0, rectSize,
360 &boundsIntVector[0]);
361 std::vector<double> displayFeaturesBounds(boundsIntVector.begin(),
362 boundsIntVector.end());
363 jsize typeSize = env->GetArrayLength(javaDisplayFeaturesType);
364 std::vector<int> displayFeaturesType(typeSize);
365 env->GetIntArrayRegion(javaDisplayFeaturesType, 0, typeSize,
366 &displayFeaturesType[0]);
367
368 jsize stateSize = env->GetArrayLength(javaDisplayFeaturesState);
369 std::vector<int> displayFeaturesState(stateSize);
370 env->GetIntArrayRegion(javaDisplayFeaturesState, 0, stateSize,
371 &displayFeaturesState[0]);
372
373 // TODO(boetger): update for https://github.com/flutter/flutter/issues/149033
374 const flutter::ViewportMetrics metrics{
375 static_cast<double>(devicePixelRatio), // p_device_pixel_ratio
376 static_cast<double>(physicalWidth), // p_physical_width
377 static_cast<double>(physicalHeight), // p_physical_height
378 static_cast<double>(physicalWidth), // p_physical_min_width_constraint
379 static_cast<double>(physicalWidth), // p_physical_max_width_constraint
380 static_cast<double>(physicalHeight), // p_physical_min_height_constraint
381 static_cast<double>(physicalHeight), // p_physical_max_height_constraint
382 static_cast<double>(physicalPaddingTop), // p_physical_padding_top
383 static_cast<double>(physicalPaddingRight), // p_physical_padding_right
384 static_cast<double>(physicalPaddingBottom), // p_physical_padding_bottom
385 static_cast<double>(physicalPaddingLeft), // p_physical_padding_left
386 static_cast<double>(physicalViewInsetTop), // p_physical_view_inset_top
387 static_cast<double>(
388 physicalViewInsetRight), // p_physical_view_inset_right
389 static_cast<double>(
390 physicalViewInsetBottom), // p_physical_view_inset_bottom
391 static_cast<double>(physicalViewInsetLeft), // p_physical_view_inset_left
392 static_cast<double>(
393 systemGestureInsetTop), // p_physical_system_gesture_inset_top
394 static_cast<double>(
395 systemGestureInsetRight), // p_physical_system_gesture_inset_right
396 static_cast<double>(
397 systemGestureInsetBottom), // p_physical_system_gesture_inset_bottom
398 static_cast<double>(
399 systemGestureInsetLeft), // p_physical_system_gesture_inset_left
400 static_cast<double>(physicalTouchSlop), // p_physical_touch_slop
401 displayFeaturesBounds, // p_physical_display_features_bounds
402 displayFeaturesType, // p_physical_display_features_type
403 displayFeaturesState, // p_physical_display_features_state
404 0, // p_display_id
405 };
406
407 ANDROID_SHELL_HOLDER->GetPlatformView()->SetViewportMetrics(
408 kFlutterImplicitViewId, metrics);
409}

References ANDROID_SHELL_HOLDER, and kFlutterImplicitViewId.

Referenced by RegisterApi(), and flutter::testing::TEST_F().

◆ 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:69

References device, and METAL_IOS_VERSION_BASELINE.

Referenced by GetRenderingAPIForProcess().

◆ SliceViews()

std::unordered_map< int64_t, DlRect > flutter::SliceViews ( DlCanvas background_canvas,
const std::vector< int64_t > &  composition_order,
const std::unordered_map< int64_t, std::unique_ptr< EmbedderViewSlice > > &  slices,
const std::unordered_map< int64_t, DlRect > &  view_rects 
)

Compute the required overlay layers and clip the view slices according to the size and position of the platform views.

Definition at line 13 of file view_slicer.cc.

18 {
19 std::unordered_map<int64_t, DlRect> overlay_layers;
20
21 auto current_frame_view_count = composition_order.size();
22
23 // Restore the clip context after exiting this method since it's changed
24 // below.
25 DlAutoCanvasRestore save(background_canvas, /*do_save=*/true);
26
27 for (size_t i = 0; i < current_frame_view_count; i++) {
28 int64_t view_id = composition_order[i];
29 EmbedderViewSlice* slice = slices.at(view_id).get();
30 if (slice->canvas() == nullptr) {
31 continue;
32 }
33
34 slice->end_recording();
35
36 DlRect full_joined_rect;
37
38 // Determinate if Flutter UI intersects with any of the previous
39 // platform views stacked by z position.
40 //
41 // This is done by querying the r-tree that holds the records for the
42 // picture recorder corresponding to the flow layers added after a platform
43 // view layer.
44 for (int j = i; j >= 0; j--) {
45 int64_t current_view_id = composition_order[j];
46 auto maybe_rect = view_rects.find(current_view_id);
47 FML_DCHECK(maybe_rect != view_rects.end());
48 if (maybe_rect == view_rects.end()) {
49 continue;
50 }
51
52 const DlRect current_view_rect = maybe_rect->second;
53 const DlIRect rounded_in_platform_view_rect =
54 DlIRect::RoundIn(current_view_rect);
55 const DlRect rounded_out_platform_view_rect =
56 DlRect::RoundOut(current_view_rect);
57
58 // Each rect corresponds to a native view that renders Flutter UI.
59 std::vector<DlIRect> intersection_rects =
60 slice->region(current_view_rect).getRects();
61
62 // Ignore intersections of single width/height on the edge of the platform
63 // view.
64 // This is to address the following performance issue when interleaving
65 // adjacent platform views and layers: Since we `roundOut` both platform
66 // view rects and the layer rects, as long as the coordinate is
67 // fractional, there will be an intersection of a single pixel width (or
68 // height) after rounding out, even if they do not intersect before
69 // rounding out. We have to round out both platform view rect and the
70 // layer rect. Rounding in platform view rect will result in missing pixel
71 // on the intersection edge. Rounding in layer rect will result in missing
72 // pixel on the edge of the layer on top of the platform view.
73 for (auto it = intersection_rects.begin(); it != intersection_rects.end();
74 /*no-op*/) {
75 // If intersection_rect does not intersect with the *rounded in*
76 // platform view rect, then the intersection must be a single pixel
77 // width (or height) on edge.
78 if (!it->IntersectsWithRect(rounded_in_platform_view_rect)) {
79 it = intersection_rects.erase(it);
80 } else {
81 ++it;
82 }
83 }
84
85 // Limit the number of native views, so it doesn't grow forever.
86 //
87 // In this case, the rects are merged into a single one that is the union
88 // of all the rects.
89 DlRect partial_joined_rect;
90 for (const DlIRect& rect : intersection_rects) {
91 partial_joined_rect = partial_joined_rect.Union(DlRect::Make(rect));
92 }
93
94 // Get the intersection rect with the `current_view_rect`,
95 if (partial_joined_rect.IntersectsWithRect(
96 rounded_out_platform_view_rect)) {
97 // Join the `partial_joined_rect` into `full_joined_rect` to get the
98 // rect above the current `slice`, only if it intersects the indicated
99 // view. This should always be the case because we just deleted any
100 // rects that don't intersect the "rounded-in" view, so they must
101 // all intersect the "rounded-out" view (or the partial join could
102 // be empty in which case this would be a NOP). Either way, the
103 // penalty for not checking the return value of the intersect method
104 // would be to join a non-overlapping rectangle into the overlay
105 // bounds - if the above implementation ever changes - so we check it.
106 full_joined_rect = full_joined_rect.Union(partial_joined_rect);
107 }
108 }
109
110 if (!full_joined_rect.IsEmpty()) {
111 overlay_layers.insert({view_id, full_joined_rect});
112
113 // Clip the background canvas, so it doesn't contain any of the pixels
114 // drawn on the overlay layer.
115 background_canvas->ClipRect(full_joined_rect, DlClipOp::kDifference);
116 }
117 slice->render_into(background_canvas);
118 }
119
120 // Manually trigger the DlAutoCanvasRestore before we submit the frame
121 save.Restore();
122
123 return overlay_layers;
124}
std::vector< DlIRect > getRects(bool deband=true) const
Definition dl_region.cc:560
DlRegion region(const DlRect &query) const
virtual void render_into(DlCanvas *canvas)=0
virtual DlCanvas * canvas()=0
virtual void end_recording()=0
impeller::Rect DlRect
impeller::IRect32 DlIRect
constexpr TRect Union(const TRect &o) const
Definition rect.h:513

References flutter::EmbedderViewSlice::canvas(), flutter::DlCanvas::ClipRect(), flutter::EmbedderViewSlice::end_recording(), FML_DCHECK, flutter::DlRegion::getRects(), i, impeller::TRect< T >::IntersectsWithRect(), impeller::TRect< T >::IsEmpty(), kDifference, impeller::TRect< Scalar >::Make(), flutter::EmbedderViewSlice::region(), flutter::EmbedderViewSlice::render_into(), flutter::DlAutoCanvasRestore::Restore(), impeller::TRect< T >::RoundIn(), impeller::TRect< Scalar >::RoundOut(), impeller::TRect< T >::Union(), and view_id.

Referenced by flutter::AndroidExternalViewEmbedder::SubmitFlutterView(), flutter::AndroidExternalViewEmbedder2::SubmitFlutterView(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().

◆ Spawn()

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

Definition at line 555 of file tester_main.cc.

555 {
556 auto shell = g_shell->get();
557 auto isolate = Dart_CurrentIsolate();
558 auto spawn_task = [shell, entrypoint = std::string(entrypoint),
559 route = std::string(route)]() {
560 auto configuration = RunConfiguration::InferFromSettings(
561 shell->GetSettings(), /*io_worker=*/nullptr,
562 /*launch_type=*/IsolateLaunchType::kExistingGroup);
563 configuration.SetEntrypoint(entrypoint);
564
565 Shell::CreateCallback<PlatformView> on_create_platform_view =
566 fml::MakeCopyable([](Shell& shell) mutable {
567 ImpellerVulkanContextHolder impeller_context_holder;
568 return std::make_unique<TesterPlatformView>(
569 shell, shell.GetTaskRunners(),
570 std::move(impeller_context_holder));
571 });
572
573 Shell::CreateCallback<Rasterizer> on_create_rasterizer = [](Shell& shell) {
574 return std::make_unique<Rasterizer>(
575 shell, Rasterizer::MakeGpuImageBehavior::kBitmap);
576 };
577
578 // Spawn a shell, and keep it running until it has no live ports, then
579 // delete it on the platform thread.
580 auto spawned_shell =
581 shell
582 ->Spawn(std::move(configuration), route, on_create_platform_view,
583 on_create_rasterizer)
584 .release();
585
586 ConfigureShell(spawned_shell);
587
589 spawned_shell->GetTaskRunners().GetUITaskRunner(), [spawned_shell]() {
590 fml::MessageLoop::GetCurrent().AddTaskObserver(
591 reinterpret_cast<intptr_t>(spawned_shell), [spawned_shell]() {
592 if (spawned_shell->EngineHasLivePorts()) {
593 return;
594 }
595
596 fml::MessageLoop::GetCurrent().RemoveTaskObserver(
597 reinterpret_cast<intptr_t>(spawned_shell));
598 // Shell must be deleted on the platform task runner.
599 fml::TaskRunner::RunNowOrPostTask(
600 spawned_shell->GetTaskRunners().GetPlatformTaskRunner(),
601 [spawned_shell]() { delete spawned_shell; });
602 });
603 });
604 };
605 Dart_ExitIsolate();
606 // The global shell pointer is never deleted, short of application exit.
607 // This UI task runner cannot be latched because it will block spawning a new
608 // shell in the case where flutter_tester is running multithreaded.
610 shell->GetTaskRunners().GetPlatformTaskRunner(), spawn_task);
611
612 Dart_EnterIsolate(isolate);
613}
std::unique_ptr< Shell > Spawn(RunConfiguration run_configuration, const std::string &initial_route, const CreateCallback< PlatformView > &on_create_platform_view, const CreateCallback< Rasterizer > &on_create_rasterizer) const
Creates one Shell from another Shell where the created Shell takes the opportunity to share any inter...
Definition shell.cc:672
const TaskRunners & GetTaskRunners() const override
If callers wish to interact directly with any shell subcomponents, they must (on the platform thread)...
Definition shell.cc:911
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
Definition shell.h:121
fml::RefPtr< fml::TaskRunner > GetPlatformTaskRunner() const

References ConfigureShell(), g_shell, flutter::Shell::GetTaskRunners(), flutter::RunConfiguration::InferFromSettings(), flutter::Rasterizer::kBitmap, kExistingGroup, fml::MakeCopyable(), fml::TaskRunner::RunNowOrPostTask(), and flutter::Shell::Spawn().

◆ SpawnJNI()

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

Definition at line 212 of file platform_view_android_jni_impl.cc.

219 {
220 jobject jni = env->NewObject(g_flutter_jni_class->obj(), g_jni_constructor);
221 if (jni == nullptr) {
222 FML_LOG(ERROR) << "Could not create a FlutterJNI instance";
223 return nullptr;
224 }
225
226 fml::jni::JavaObjectWeakGlobalRef java_jni(env, jni);
227 std::shared_ptr<PlatformViewAndroidJNI> jni_facade =
228 std::make_shared<PlatformViewAndroidJNIImpl>(java_jni);
229
230 auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint);
231 auto libraryUrl = fml::jni::JavaStringToString(env, jLibraryUrl);
232 auto initial_route = fml::jni::JavaStringToString(env, jInitialRoute);
233 auto entrypoint_args = fml::jni::StringListToVector(env, jEntrypointArgs);
234
235 auto spawned_shell_holder =
236 ANDROID_SHELL_HOLDER->Spawn(jni_facade, entrypoint, libraryUrl,
237 initial_route, entrypoint_args, engineId);
238
239 if (spawned_shell_holder == nullptr || !spawned_shell_holder->IsValid()) {
240 FML_LOG(ERROR) << "Could not spawn Shell";
241 return nullptr;
242 }
243
244 jobject javaLong = env->CallStaticObjectMethod(
245 g_java_long_class->obj(), g_long_constructor,
246 reinterpret_cast<jlong>(spawned_shell_holder.release()));
247 if (javaLong == nullptr) {
248 FML_LOG(ERROR) << "Could not create a Long instance";
249 return nullptr;
250 }
251
252 env->SetObjectField(jni, g_jni_shell_holder_field, javaLong);
253
254 return jni;
255}

References ANDROID_SHELL_HOLDER, FML_LOG, g_flutter_jni_class, g_java_long_class, g_jni_constructor, g_jni_shell_holder_field, g_long_constructor, fml::jni::JavaStringToString(), and fml::jni::StringListToVector().

Referenced by RegisterApi().

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

References FML_CHECK, and fml::TimeDelta::FromSeconds().

Referenced by flutter::GTestActivity::OnNativeWindowCreated().

◆ 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&) {
30 };
31 settings.task_observer_remove = [](fml::TaskQueueId, intptr_t) {};
32
33 if (DartVM::IsRunningPrecompiledCode()) {
34 aot_symbols = testing::LoadELFSymbolFromFixturesIfNeccessary(
35 testing::kDefaultAOTAppELFFileName);
37 testing::PrepareSettingsForAOTWithSymbols(settings, aot_symbols))
38 << "Could not set up settings with AOT symbols.";
39 } else {
40 settings.application_kernels = [&]() {
41 std::vector<std::unique_ptr<const fml::Mapping>> kernel_mappings;
42 kernel_mappings.emplace_back(
43 fml::FileMapping::CreateReadOnly(assets_dir, "kernel_blob.bin"));
44 return kernel_mappings;
45 };
46 }
47
48 thread_host = std::make_unique<ThreadHost>(ThreadHost::ThreadHostConfig(
49 "io.flutter.bench.",
50 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
51 ThreadHost::Type::kIo | ThreadHost::Type::kUi));
52
53 TaskRunners task_runners("test",
54 thread_host->platform_thread->GetTaskRunner(),
55 thread_host->raster_thread->GetTaskRunner(),
56 thread_host->ui_thread->GetTaskRunner(),
57 thread_host->io_thread->GetTaskRunner());
58
59 shell = Shell::Create(
60 flutter::PlatformData(), task_runners, settings,
61 [](Shell& shell) {
62 return std::make_unique<PlatformView>(shell, shell.GetTaskRunners());
63 },
64 [](Shell& shell) { return std::make_unique<Rasterizer>(shell); });
65 }
66
67 FML_CHECK(shell);
68
69 {
70 // The ui thread could be busy processing tasks after shell created, e.g.,
71 // default font manager setup. The measurement of shell shutdown should be
72 // considered after those ui tasks have been done.
73 //
74 // However, if we're measuring the complete time from startup to shutdown,
75 // this time should still be included.
77 state, !measure_shutdown || !measure_startup);
79 fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
80 [&latch]() { latch.Signal(); });
81 latch.Wait();
82 }
83
84 {
85 benchmarking::ScopedPauseTiming pause(state, !measure_shutdown);
86 // Shutdown must occur synchronously on the platform thread.
89 thread_host->platform_thread->GetTaskRunner(),
90 [&shell, &latch]() mutable {
91 shell.reset();
92 latch.Signal();
93 });
94 latch.Wait();
95 thread_host.reset();
96 }
97
98 FML_CHECK(!shell);
99}
static TaskQueueId Invalid()
TaskObserverRemove task_observer_remove
Definition settings.h:282
MappingsCallback application_kernels
Definition settings.h:142
TaskObserverAdd task_observer_add
Definition settings.h:281

References flutter::Settings::application_kernels, flutter::Shell::Create(), fml::FileMapping::CreateReadOnly(), FML_CHECK, flutter::testing::GetFixturesPath(), flutter::Shell::GetTaskRunners(), fml::TaskQueueId::Invalid(), flutter::DartVM::IsRunningPrecompiledCode(), flutter::testing::kDefaultAOTAppELFFileName, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, fml::kRead, flutter::ThreadHost::kUi, flutter::testing::LoadELFSymbolFromFixturesIfNeccessary(), fml::OpenDirectory(), flutter::testing::PrepareSettingsForAOTWithSymbols(), fml::TaskRunner::RunNowOrPostTask(), flutter::Settings::task_observer_add, flutter::Settings::task_observer_remove, and fml::AutoResetWaitableEvent::Wait().

Referenced by BM_ShellInitialization(), BM_ShellInitializationAndShutdown(), and BM_ShellShutdown().

◆ store_points()

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

Definition at line 223 of file dl_vertices.cc.

223 {
224 DlPoint* points = reinterpret_cast<DlPoint*>(dst + offset);
225 for (int i = 0; i < count; i++) {
226 points[i] = DlPoint(src[i * 2], src[i * 2 + 1]);
227 }
228}

References i, and points.

Referenced by flutter::DlVertices::Builder::store_texture_coordinates(), and flutter::DlVertices::Builder::store_vertices().

◆ StringToAppExitType()

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

Definition at line 214 of file platform_handler.cc.

214 {
215 if (string.compare(PlatformHandler::kExitTypeRequired) == 0) {
216 return AppExitType::required;
217 } else if (string.compare(PlatformHandler::kExitTypeCancelable) == 0) {
218 return AppExitType::cancelable;
219 }
220 FML_LOG(ERROR) << string << " is not recognized as a valid exit type.";
221 return AppExitType::required;
222}

References cancelable, FML_LOG, flutter::PlatformHandler::kExitTypeCancelable, flutter::PlatformHandler::kExitTypeRequired, and required.

◆ SurfaceChanged()

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

Definition at line 284 of file platform_view_android_jni_impl.cc.

288 {
289 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged(
291}

References ANDROID_SHELL_HOLDER, height, and width.

Referenced by RegisterApi().

◆ SurfaceCreated()

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

Definition at line 257 of file platform_view_android_jni_impl.cc.

260 {
261 // Note: This frame ensures that any local references used by
262 // ANativeWindow_fromSurface are released immediately. This is needed as a
263 // workaround for https://code.google.com/p/android/issues/detail?id=68174
264 fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env);
265 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
266 ANativeWindow_fromSurface(env, jsurface));
267 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window));
268}
GLFWwindow * window
Definition main.cc:60

References ANDROID_SHELL_HOLDER, and window.

Referenced by RegisterApi().

◆ SurfaceDestroyed()

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

Definition at line 293 of file platform_view_android_jni_impl.cc.

293 {
294 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed();
295}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ SurfaceWindowChanged()

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

Definition at line 270 of file platform_view_android_jni_impl.cc.

273 {
274 // Note: This frame ensures that any local references used by
275 // ANativeWindow_fromSurface are released immediately. This is needed as a
276 // workaround for https://code.google.com/p/android/issues/detail?id=68174
277 fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env);
278 auto window = fml::MakeRefCounted<AndroidNativeWindow>(
279 ANativeWindow_fromSurface(env, jsurface));
280 ANDROID_SHELL_HOLDER->GetPlatformView()->NotifySurfaceWindowChanged(
281 std::move(window));
282}

References ANDROID_SHELL_HOLDER, and window.

Referenced by RegisterApi().

◆ 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)) {
24 FML_LOG(ERROR)
25 << "Input template path not specified. Use --templater-input.";
26 return false;
27 }
28 if (!command_line.GetOptionValue("templater-output", &output_path)) {
29 FML_LOG(ERROR)
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);
49 auto output = fml::NonOwnedMapping{
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().string().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}

References fml::FileMapping::CreateReadOnly(), FML_LOG, fml::CommandLine::GetOptionValue(), input(), fml::kReadWrite, fml::OpenDirectory(), fml::CommandLine::options(), and fml::WriteAtomically().

Referenced by main().

◆ 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([&callback_called, message_value](
67 const auto& message, const 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}

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

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

References channel, flutter::StandardMessageCodec::GetInstance(), and i.

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

References channel, flutter::StandardMessageCodec::GetInstance(), and i.

◆ 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, const 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}

References channel, flutter::StandardMessageCodec::GetInstance(), and message.

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

References flutter::DartServiceIsolate::AddServerStatusCallback(), and flutter::DartServiceIsolate::RemoveServerStatusCallback().

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

References value.

◆ TEST() [7/363]

flutter::TEST ( EncodableValueTest  ,
Comparison   
)

Definition at line 177 of file encodable_value_unittests.cc.

177 {
178 EncodableList values = {
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}
std::vector< EncodableValue > EncodableList

References i.

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

References value.

◆ 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}
std::map< EncodableValue, EncodableValue > EncodableMap

◆ 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);
54 value = std::numeric_limits<double>::max();
55 EXPECT_EQ(std::get<double>(value), std::numeric_limits<double>::max());
56}

References value.

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

References data, and value.

◆ 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);
30 value = std::numeric_limits<int32_t>::max();
31 EXPECT_EQ(std::get<int32_t>(value), std::numeric_limits<int32_t>::max());
32}

References value.

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

References data, and value.

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

References data, and value.

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

References value.

◆ 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);
46 value = std::numeric_limits<int64_t>::max();
47 EXPECT_EQ(std::get<int64_t>(value), std::numeric_limits<int64_t>::max());
48}

References value.

◆ TEST() [17/363]

flutter::TEST ( EncodableValueTest  ,
LongValue   
)

Definition at line 35 of file encodable_value_unittests.cc.

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

References flutter::EncodableValue::LongValue().

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

References value.

◆ TEST() [19/363]

flutter::TEST ( EncodableValueTest  ,
Null   
)

Definition at line 13 of file encodable_value_unittests.cc.

13 {
15 value.IsNull();
16}

References value.

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

References value.

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

References data, and value.

◆ 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

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), handler, and message.

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

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), handler, and message.

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

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), handler, and message.

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

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), handler, and message.

◆ 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;
221 message = codec.EncodeMethodCall(call);
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}

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), handler, and message.

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

References error.

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

References error.

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

References channel, flutter::StandardMethodCodec::GetInstance(), and handler.

◆ TEST() [31/363]

flutter::TEST ( FlowTest  ,
SurfaceFrameDoesNotHaveEmptyCanvas   
)

Definition at line 32 of file surface_frame_unittests.cc.

32 {
33 SurfaceFrame::FramebufferInfo framebuffer_info;
34 auto callback = [](const SurfaceFrame&, DlCanvas*) { return true; };
35 auto submit_callback = [](const SurfaceFrame&) { return true; };
36 SurfaceFrame frame(
37 /*surface=*/nullptr,
38 /*framebuffer_info=*/framebuffer_info,
39 /*encode_callback=*/callback,
40 /*submit_callback=*/submit_callback,
41 /*frame_size=*/DlISize(800, 600),
42 /*context_result=*/nullptr,
43 /*display_list_fallback=*/true);
44
45 EXPECT_FALSE(frame.Canvas()->GetLocalClipCoverage().IsEmpty());
46 EXPECT_FALSE(frame.Canvas()->QuickReject(DlRect::MakeLTRB(10, 10, 50, 50)));
47}
Developer-facing API for rendering anything within the engine.
Definition dl_canvas.h:32
impeller::ISize32 DlISize

References callback, flutter::SurfaceFrame::Canvas(), flutter::DlCanvas::GetLocalClipCoverage(), impeller::TRect< T >::IsEmpty(), impeller::TRect< Scalar >::MakeLTRB(), and flutter::DlCanvas::QuickReject().

◆ TEST() [32/363]

flutter::TEST ( FlowTest  ,
SurfaceFrameDoesNotPrepareRtree   
)

Definition at line 49 of file surface_frame_unittests.cc.

49 {
50 SurfaceFrame::FramebufferInfo framebuffer_info;
51 auto callback = [](const SurfaceFrame&, DlCanvas*) { return true; };
52 auto submit_callback = [](const SurfaceFrame&) { return true; };
53 auto surface_frame = std::make_unique<SurfaceFrame>(
54 /*surface=*/nullptr,
55 /*framebuffer_info=*/framebuffer_info,
56 /*encode_callback=*/callback,
57 /*submit_callback=*/submit_callback,
58 /*frame_size=*/DlISize(800, 600),
59 /*context_result=*/nullptr,
60 /*display_list_fallback=*/true);
61 surface_frame->Canvas()->DrawRect(DlRect::MakeWH(100, 100), DlPaint());
62 EXPECT_FALSE(surface_frame->BuildDisplayList()->has_rtree());
63}
flutter::DlPaint DlPaint

References callback, and impeller::TRect< Scalar >::MakeWH().

◆ 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&) {
15 EXPECT_FALSE(true);
16 return true;
17 };
18 auto encode_callback = [](const SurfaceFrame&, DlCanvas*) {
19 EXPECT_FALSE(true);
20 return true;
21 };
22
23 auto surface_frame = std::make_unique<SurfaceFrame>(
24 /*surface=*/nullptr,
25 /*framebuffer_info=*/framebuffer_info,
26 /*encode_callback=*/encode_callback,
27 /*submit_callback=*/callback,
28 /*frame_size=*/DlISize(800, 600));
29 surface_frame.reset();
30}

References callback.

◆ 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:84

References engine, flutter::FlutterEngine::Start(), and flutter::testing::ScopedStubFlutterGlfwApi::stub().

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

References engine, flutter::FlutterEngine::Run(), flutter::DartProject::set_dart_entrypoint(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References engine, flutter::DartProject::set_dart_entrypoint_arguments(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References engine, flutter::FlutterEngine::ShutDown(), flutter::FlutterEngine::Start(), and flutter::testing::ScopedStubFlutterGlfwApi::stub().

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

References engine, flutter::FlutterEngine::messenger(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References engine, flutter::FlutterEngine::ProcessExternalWindowMessage(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References engine, flutter::FlutterEngine::ProcessMessages(), flutter::FlutterEngine::Run(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References engine, flutter::FlutterEngine::ReloadSystemFonts(), flutter::FlutterEngine::Run(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

◆ 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}
#define UINT32_MAX
Definition comments.cc:87

References engine, flutter::FlutterEngine::RunEventLoopWithTimeout(), flutter::FlutterEngine::Start(), flutter::testing::ScopedStubFlutterGlfwApi::stub(), and UINT32_MAX.

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

References engine, flutter::FlutterEngine::SetNextFrameCallback(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

◆ 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()

References 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}

References GetSwitchesFromEnvironment(), and size.

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

References GetSwitchesFromEnvironment().

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

References GetSwitchesFromEnvironment().

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

References flutter::testing::ScopedStubFlutterGlfwApi::stub().

◆ TEST() [49/363]

flutter::TEST ( FlutterViewControllerTest  ,
ForceRedraw   
)

Definition at line 102 of file flutter_view_controller_unittests.cc.

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

References flutter::FlutterViewController::ForceRedraw(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

◆ TEST() [50/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetEngine   
)

Definition at line 84 of file flutter_view_controller_unittests.cc.

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

References flutter::FlutterViewController::engine(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

◆ TEST() [51/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetView   
)

Definition at line 93 of file flutter_view_controller_unittests.cc.

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

References flutter::testing::ScopedStubFlutterWindowsApi::stub(), and flutter::FlutterViewController::view().

◆ TEST() [52/363]

flutter::TEST ( FlutterViewControllerTest  ,
GetViewId   
)

Definition at line 75 of file flutter_view_controller_unittests.cc.

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

References flutter::testing::ScopedStubFlutterWindowsApi::stub(), and flutter::FlutterViewController::view_id().

◆ 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}
FlView * view
struct FlutterDesktopView * FlutterDesktopViewRef

References flutter::testing::ScopedStubFlutterWindowsApi::stub(), and view.

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

References flutter::testing::ScopedStubFlutterWindowsApi::stub(), and view.

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

References FlutterDesktopSize::height, flutter::testing::ScopedStubFlutterGlfwApi::stub(), FlutterDesktopSize::width, and window.

◆ TEST() [56/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameBuildEnd   
)

Definition at line 195 of file frame_timings_recorder_unittests.cc.

195 {
196 auto recorder = std::make_unique<FrameTimingsRecorder>();
197
198 const auto now = fml::TimePoint::Now();
199 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
200 recorder->RecordBuildStart(fml::TimePoint::Now());
201 recorder->RecordBuildEnd(fml::TimePoint::Now());
202
203 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kBuildEnd);
204 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
205 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
206 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
207 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
208 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
209}

References fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kBuildEnd, and fml::TimePoint::Now().

◆ TEST() [57/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameBuildStart   
)

Definition at line 181 of file frame_timings_recorder_unittests.cc.

181 {
182 auto recorder = std::make_unique<FrameTimingsRecorder>();
183
184 const auto now = fml::TimePoint::Now();
185 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
186 recorder->RecordBuildStart(fml::TimePoint::Now());
187
188 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kBuildStart);
189 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
190 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
191 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
192 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
193}

References fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kBuildStart, and fml::TimePoint::Now().

◆ TEST() [58/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameFrameNumber   
)

Definition at line 161 of file frame_timings_recorder_unittests.cc.

161 {
162 auto recorder = std::make_unique<FrameTimingsRecorder>();
163
164 auto cloned =
165 recorder->CloneUntil(FrameTimingsRecorder::State::kUninitialized);
166 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
167}

References flutter::FrameTimingsRecorder::kUninitialized.

◆ TEST() [59/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterEnd   
)

Definition at line 229 of file frame_timings_recorder_unittests.cc.

229 {
230 auto recorder = std::make_unique<FrameTimingsRecorder>();
231
232 const auto now = fml::TimePoint::Now();
233 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
234 recorder->RecordBuildStart(fml::TimePoint::Now());
235 recorder->RecordBuildEnd(fml::TimePoint::Now());
236 recorder->RecordRasterStart(fml::TimePoint::Now());
237 recorder->RecordRasterEnd();
238
239 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterEnd);
240 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
241 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
242 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
243 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
244 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
245 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
246 ASSERT_EQ(recorder->GetRasterEndTime(), cloned->GetRasterEndTime());
247 ASSERT_EQ(recorder->GetRasterEndWallTime(), cloned->GetRasterEndWallTime());
248 ASSERT_EQ(recorder->GetLayerCacheCount(), cloned->GetLayerCacheCount());
249 ASSERT_EQ(recorder->GetLayerCacheBytes(), cloned->GetLayerCacheBytes());
250 ASSERT_EQ(recorder->GetPictureCacheCount(), cloned->GetPictureCacheCount());
251 ASSERT_EQ(recorder->GetPictureCacheBytes(), cloned->GetPictureCacheBytes());
252}

References fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kRasterEnd, and fml::TimePoint::Now().

◆ TEST() [60/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterEndWithCache   
)

Definition at line 254 of file frame_timings_recorder_unittests.cc.

254 {
255 auto recorder = std::make_unique<FrameTimingsRecorder>();
256 MockRasterCache cache(1, 10);
257 cache.BeginFrame();
258
259 const auto now = fml::TimePoint::Now();
260 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
261 recorder->RecordBuildStart(fml::TimePoint::Now());
262 recorder->RecordBuildEnd(fml::TimePoint::Now());
263 recorder->RecordRasterStart(fml::TimePoint::Now());
264
265 cache.AddMockLayer(100, 100);
266 size_t layer_bytes = cache.EstimateLayerCacheByteSize();
267 EXPECT_GT(layer_bytes, 0u);
268 cache.AddMockPicture(100, 100);
269 size_t picture_bytes = cache.EstimatePictureCacheByteSize();
270 EXPECT_GT(picture_bytes, 0u);
271 cache.EvictUnusedCacheEntries();
272 cache.EndFrame();
273 recorder->RecordRasterEnd(&cache);
274
275 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterEnd);
276 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
277 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
278 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
279 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
280 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
281 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
282 ASSERT_EQ(recorder->GetRasterEndTime(), cloned->GetRasterEndTime());
283 ASSERT_EQ(recorder->GetRasterEndWallTime(), cloned->GetRasterEndWallTime());
284 ASSERT_EQ(recorder->GetLayerCacheCount(), cloned->GetLayerCacheCount());
285 ASSERT_EQ(recorder->GetLayerCacheBytes(), cloned->GetLayerCacheBytes());
286 ASSERT_EQ(recorder->GetPictureCacheCount(), cloned->GetPictureCacheCount());
287 ASSERT_EQ(recorder->GetPictureCacheBytes(), cloned->GetPictureCacheBytes());
288}
A RasterCache implementation that simulates the act of rendering a Layer or DisplayList without the o...

References flutter::testing::MockRasterCache::AddMockLayer(), flutter::testing::MockRasterCache::AddMockPicture(), flutter::RasterCache::BeginFrame(), flutter::RasterCache::EndFrame(), flutter::RasterCache::EstimateLayerCacheByteSize(), flutter::RasterCache::EstimatePictureCacheByteSize(), flutter::RasterCache::EvictUnusedCacheEntries(), fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kRasterEnd, and fml::TimePoint::Now().

◆ TEST() [61/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameRasterStart   
)

Definition at line 211 of file frame_timings_recorder_unittests.cc.

211 {
212 auto recorder = std::make_unique<FrameTimingsRecorder>();
213
214 const auto now = fml::TimePoint::Now();
215 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
216 recorder->RecordBuildStart(fml::TimePoint::Now());
217 recorder->RecordBuildEnd(fml::TimePoint::Now());
218 recorder->RecordRasterStart(fml::TimePoint::Now());
219
220 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kRasterStart);
221 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
222 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
223 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
224 ASSERT_EQ(recorder->GetBuildStartTime(), cloned->GetBuildStartTime());
225 ASSERT_EQ(recorder->GetBuildEndTime(), cloned->GetBuildEndTime());
226 ASSERT_EQ(recorder->GetRasterStartTime(), cloned->GetRasterStartTime());
227}

References fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kRasterStart, and fml::TimePoint::Now().

◆ TEST() [62/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ClonedHasSameVsyncStartAndTarget   
)

Definition at line 169 of file frame_timings_recorder_unittests.cc.

169 {
170 auto recorder = std::make_unique<FrameTimingsRecorder>();
171
172 const auto now = fml::TimePoint::Now();
173 recorder->RecordVsync(now, now + fml::TimeDelta::FromMilliseconds(16));
174
175 auto cloned = recorder->CloneUntil(FrameTimingsRecorder::State::kVsync);
176 ASSERT_EQ(recorder->GetFrameNumber(), cloned->GetFrameNumber());
177 ASSERT_EQ(recorder->GetVsyncStartTime(), cloned->GetVsyncStartTime());
178 ASSERT_EQ(recorder->GetVsyncTargetTime(), cloned->GetVsyncTargetTime());
179}

References fml::TimeDelta::FromMilliseconds(), flutter::FrameTimingsRecorder::kVsync, and fml::TimePoint::Now().

◆ TEST() [63/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
FrameNumberTraceArgIsValid   
)

Definition at line 290 of file frame_timings_recorder_unittests.cc.

290 {
291 auto recorder = std::make_unique<FrameTimingsRecorder>();
292
293 std::string actual_arg =
294 std::format("{}", static_cast<int>(recorder->GetFrameNumber()));
295 std::string expected_arg = recorder->GetFrameNumberTraceArg();
296
297 ASSERT_EQ(actual_arg, expected_arg);
298}

◆ TEST() [64/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordBuildTimes   
)

Definition at line 32 of file frame_timings_recorder_unittests.cc.

32 {
33 auto recorder = std::make_unique<FrameTimingsRecorder>();
34
35 const auto st = fml::TimePoint::Now();
36 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
37 recorder->RecordVsync(st, en);
38
39 const auto build_start = fml::TimePoint::Now();
40 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
41 recorder->RecordBuildStart(build_start);
42 recorder->RecordBuildEnd(build_end);
43
44 ASSERT_EQ(build_start, recorder->GetBuildStartTime());
45 ASSERT_EQ(build_end, recorder->GetBuildEndTime());
46}
static constexpr TimeDelta FromMillisecondsF(double millis)
Definition time_delta.h:57

References fml::TimeDelta::FromMillisecondsF(), and fml::TimePoint::Now().

◆ TEST() [65/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordersHaveUniqueFrameNumbers   
)

Definition at line 154 of file frame_timings_recorder_unittests.cc.

154 {
155 auto recorder1 = std::make_unique<FrameTimingsRecorder>();
156 auto recorder2 = std::make_unique<FrameTimingsRecorder>();
157
158 ASSERT_TRUE(recorder2->GetFrameNumber() > recorder1->GetFrameNumber());
159}

◆ TEST() [66/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordRasterTimes   
)

Definition at line 48 of file frame_timings_recorder_unittests.cc.

48 {
49 auto recorder = std::make_unique<FrameTimingsRecorder>();
50
51 const auto st = fml::TimePoint::Now();
52 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
53 recorder->RecordVsync(st, en);
54
55 const auto build_start = fml::TimePoint::Now();
56 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
57 recorder->RecordBuildStart(build_start);
58 recorder->RecordBuildEnd(build_end);
59
60 using namespace std::chrono_literals;
61
62 const auto raster_start = fml::TimePoint::Now();
63 recorder->RecordRasterStart(raster_start);
64 const auto before_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
65 std::this_thread::sleep_for(1ms);
66 const auto timing = recorder->RecordRasterEnd();
67 std::this_thread::sleep_for(1ms);
68 const auto after_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
69
70 ASSERT_EQ(raster_start, recorder->GetRasterStartTime());
71 ASSERT_GT(recorder->GetRasterEndWallTime(), before_raster_end_wall_time);
72 ASSERT_LT(recorder->GetRasterEndWallTime(), after_raster_end_wall_time);
73 ASSERT_EQ(recorder->GetFrameNumber(), timing.GetFrameNumber());
74 ASSERT_EQ(recorder->GetLayerCacheCount(), 0u);
75 ASSERT_EQ(recorder->GetLayerCacheBytes(), 0u);
76 ASSERT_EQ(recorder->GetPictureCacheCount(), 0u);
77 ASSERT_EQ(recorder->GetPictureCacheBytes(), 0u);
78}
static TimePoint CurrentWallTime()
Definition time_point.cc:57

References fml::TimePoint::CurrentWallTime(), fml::TimeDelta::FromMillisecondsF(), and fml::TimePoint::Now().

◆ TEST() [67/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordRasterTimesWithCache   
)

Definition at line 80 of file frame_timings_recorder_unittests.cc.

80 {
81 auto recorder = std::make_unique<FrameTimingsRecorder>();
82
83 const auto st = fml::TimePoint::Now();
84 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
85 recorder->RecordVsync(st, en);
86
87 const auto build_start = fml::TimePoint::Now();
88 const auto build_end = build_start + fml::TimeDelta::FromMillisecondsF(16);
89 recorder->RecordBuildStart(build_start);
90 recorder->RecordBuildEnd(build_end);
91
92 using namespace std::chrono_literals;
93
94 MockRasterCache cache(1, 10);
95 cache.BeginFrame();
96
97 const auto raster_start = fml::TimePoint::Now();
98 recorder->RecordRasterStart(raster_start);
99
100 cache.AddMockLayer(100, 100);
101 size_t layer_bytes = cache.EstimateLayerCacheByteSize();
102 EXPECT_GT(layer_bytes, 0u);
103 cache.AddMockPicture(100, 100);
104 size_t picture_bytes = cache.EstimatePictureCacheByteSize();
105 EXPECT_GT(picture_bytes, 0u);
106 cache.EvictUnusedCacheEntries();
107
108 cache.EndFrame();
109
110 const auto before_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
111 std::this_thread::sleep_for(1ms);
112 const auto timing = recorder->RecordRasterEnd(&cache);
113 std::this_thread::sleep_for(1ms);
114 const auto after_raster_end_wall_time = fml::TimePoint::CurrentWallTime();
115
116 ASSERT_EQ(raster_start, recorder->GetRasterStartTime());
117 ASSERT_GT(recorder->GetRasterEndWallTime(), before_raster_end_wall_time);
118 ASSERT_LT(recorder->GetRasterEndWallTime(), after_raster_end_wall_time);
119 ASSERT_EQ(recorder->GetFrameNumber(), timing.GetFrameNumber());
120 ASSERT_EQ(recorder->GetLayerCacheCount(), 1u);
121 ASSERT_EQ(recorder->GetLayerCacheBytes(), layer_bytes);
122 ASSERT_EQ(recorder->GetPictureCacheCount(), 1u);
123 ASSERT_EQ(recorder->GetPictureCacheBytes(), picture_bytes);
124}

References flutter::testing::MockRasterCache::AddMockLayer(), flutter::testing::MockRasterCache::AddMockPicture(), flutter::RasterCache::BeginFrame(), fml::TimePoint::CurrentWallTime(), flutter::RasterCache::EndFrame(), flutter::RasterCache::EstimateLayerCacheByteSize(), flutter::RasterCache::EstimatePictureCacheByteSize(), flutter::RasterCache::EvictUnusedCacheEntries(), fml::TimeDelta::FromMillisecondsF(), and fml::TimePoint::Now().

◆ TEST() [68/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
RecordVsync   
)

Definition at line 22 of file frame_timings_recorder_unittests.cc.

22 {
23 auto recorder = std::make_unique<FrameTimingsRecorder>();
24 const auto st = fml::TimePoint::Now();
25 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
26 recorder->RecordVsync(st, en);
27
28 ASSERT_EQ(st, recorder->GetVsyncStartTime());
29 ASSERT_EQ(en, recorder->GetVsyncTargetTime());
30}

References fml::TimeDelta::FromMillisecondsF(), and fml::TimePoint::Now().

◆ TEST() [69/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ThrowWhenRecordBuildBeforeVsync   
)

Definition at line 130 of file frame_timings_recorder_unittests.cc.

130 {
131 auto recorder = std::make_unique<FrameTimingsRecorder>();
132
133 const auto build_start = fml::TimePoint::Now();
134 fml::Status status = recorder->RecordBuildStartImpl(build_start);
135 EXPECT_FALSE(status.ok());
136 EXPECT_EQ(status.message(), "Check failed: state_ == State::kVsync.");
137}
bool ok() const
Definition status.h:71
std::string_view message() const
Definition status.h:75

References fml::Status::message(), fml::TimePoint::Now(), and fml::Status::ok().

◆ TEST() [70/363]

flutter::TEST ( FrameTimingsRecorderTest  ,
ThrowWhenRecordRasterBeforeBuildEnd   
)

Definition at line 139 of file frame_timings_recorder_unittests.cc.

139 {
140 auto recorder = std::make_unique<FrameTimingsRecorder>();
141
142 const auto st = fml::TimePoint::Now();
143 const auto en = st + fml::TimeDelta::FromMillisecondsF(16);
144 recorder->RecordVsync(st, en);
145
146 const auto raster_start = fml::TimePoint::Now();
147 fml::Status status = recorder->RecordRasterStartImpl(raster_start);
148 EXPECT_FALSE(status.ok());
149 EXPECT_EQ(status.message(), "Check failed: state_ == State::kBuildEnd.");
150}

References fml::TimeDelta::FromMillisecondsF(), fml::Status::message(), fml::TimePoint::Now(), and fml::Status::ok().

◆ 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);
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}

References channel, message, FlutterDesktopMessage::struct_size, and user_data.

◆ 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);
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}

References channel, message, FlutterDesktopMessage::struct_size, and user_data.

◆ 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);
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}

References channel, message, FlutterDesktopMessage::struct_size, and user_data.

◆ 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(id value, NSData *expectedEncoding)

References CheckEncodeDecode().

◆ 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
std::unique_ptr< std::vector< uint8_t > > EncodeErrorEnvelope(const std::string &error_code, const std::string &error_message="", const T *error_details=nullptr) const

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeErrorEnvelope(), flutter::JsonMethodCodec::GetInstance(), and message.

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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeErrorEnvelope(), flutter::JsonMethodCodec::GetInstance(), and message.

◆ 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

References flutter::MethodCodec< T >::DecodeMethodCall(), flutter::MethodCodec< T >::EncodeMethodCall(), and flutter::JsonMethodCodec::GetInstance().

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

References flutter::MethodCodec< T >::DecodeMethodCall(), flutter::MethodCodec< T >::EncodeMethodCall(), and flutter::JsonMethodCodec::GetInstance().

◆ 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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeSuccessEnvelope(), and flutter::JsonMethodCodec::GetInstance().

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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeSuccessEnvelope(), and flutter::JsonMethodCodec::GetInstance().

◆ 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

References 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}
void Error(const std::string &error_code, const std::string &error_message, const T &error_details)

References flutter::MethodResult< T >::Error(), and message.

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

References channel, and flutter::StandardMethodCodec::GetInstance().

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

References channel, and flutter::StandardMethodCodec::GetInstance().

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

References channel, flutter::MethodCodec< T >::EncodeSuccessEnvelope(), and flutter::StandardMethodCodec::GetInstance().

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

References flutter::MethodResult< T >::Error(), flutter::MethodResult< T >::NotImplemented(), and flutter::MethodResult< T >::Success().

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

References flutter::MethodResult< T >::NotImplemented().

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

References channel, flutter::MethodCodec< T >::EncodeMethodCall(), flutter::StandardMethodCodec::GetInstance(), and message.

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

References channel, flutter::StandardMethodCodec::GetInstance(), and i.

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

References channel, flutter::StandardMethodCodec::GetInstance(), and i.

◆ 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}
void Success(const T &result)

References i, flutter::MethodResult< T >::Success(), and value.

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

References channel, and flutter::StandardMethodCodec::GetInstance().

◆ TEST() [93/363]

flutter::TEST ( PathUtilsTest  ,
ExecutableDirector   
)

Definition at line 12 of file path_utils_unittests.cc.

12 {
13 std::filesystem::path exe_directory = GetExecutableDirectory();
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

References GetExecutableDirectory().

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

References flutter::PluginRegistrarGlfw::window().

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

References flutter::PluginRegistrar::AddPlugin().

◆ 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 use test 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 disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager

References flutter::PluginRegistrarManager::GetInstance(), and manager.

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

References flutter::PluginRegistrarManager::GetInstance(), manager, and flutter::testing::ScopedStubFlutterApi::stub().

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

References flutter::PluginRegistrarManager::GetInstance(), and manager.

◆ 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

References message, flutter::PluginRegistrar::messenger(), flutter::BinaryMessenger::Send(), and flutter::testing::ScopedStubFlutterApi::stub().

◆ 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

References message, flutter::PluginRegistrar::messenger(), flutter::BinaryMessenger::SetMessageHandler(), and flutter::testing::ScopedStubFlutterApi::stub().

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

References flutter::PluginRegistrar::AddPlugin().

◆ 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

References flutter::PluginRegistrar::texture_registrar(), and 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
unsigned int UINT
UINT_PTR WPARAM

References message, flutter::PluginRegistrarWindows::RegisterTopLevelWindowProcDelegate(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References flutter::PluginRegistrarWindows::GetView(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References flutter::PluginRegistrarWindows::GetView(), flutter::PluginRegistrarWindows::GetViewById(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References flutter::PluginRegistrar::AddPlugin(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References message, flutter::PluginRegistrarWindows::RegisterTopLevelWindowProcDelegate(), flutter::testing::ScopedStubFlutterWindowsApi::stub(), and flutter::PluginRegistrarWindows::UnregisterTopLevelWindowProcDelegate().

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

References message, flutter::PluginRegistrarWindows::RegisterTopLevelWindowProcDelegate(), and flutter::testing::ScopedStubFlutterWindowsApi::stub().

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

References flutter::Point::x(), and flutter::Point::y().

◆ TEST() [110/363]

flutter::TEST ( RasterizerTest  ,
create   
)

Definition at line 130 of file rasterizer_unittests.cc.

130 {
131 NiceMock<MockDelegate> delegate;
132 Settings settings;
133 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
134 auto rasterizer = std::make_unique<Rasterizer>(delegate);
135 EXPECT_TRUE(rasterizer != nullptr);
136}

◆ TEST() [111/363]

flutter::TEST ( RasterizerTest  ,
drawEmptyPipeline   
)

Definition at line 164 of file rasterizer_unittests.cc.

164 {
165 std::string test_name =
166 ::testing::UnitTest::GetInstance()->current_test_info()->name();
167 ThreadHost thread_host("io.flutter.test." + test_name + ".",
168 ThreadHost::Type::kPlatform |
169 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
170 ThreadHost::Type::kUi);
171 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
172 thread_host.raster_thread->GetTaskRunner(),
173 thread_host.ui_thread->GetTaskRunner(),
174 thread_host.io_thread->GetTaskRunner());
175 NiceMock<MockDelegate> delegate;
176 Settings settings;
177 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
178 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
179 auto rasterizer = std::make_unique<Rasterizer>(delegate);
180 auto surface = std::make_unique<NiceMock<MockSurface>>();
181 EXPECT_CALL(*surface, MakeRenderContextCurrent())
182 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
183 rasterizer->Setup(std::move(surface));
185 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
186 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
187 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
188 rasterizer->Draw(pipeline);
189 latch.Signal();
190 });
191 latch.Wait();
192}

References flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [112/363]

flutter::TEST ( RasterizerTest  ,
drawLastLayerTreeWithThreadsMergedExternalViewEmbedderAndEndFrameCalled   
)

Definition at line 424 of file rasterizer_unittests.cc.

425 {
426 std::string test_name =
427 ::testing::UnitTest::GetInstance()->current_test_info()->name();
428 ThreadHost thread_host("io.flutter.test." + test_name + ".",
429 ThreadHost::Type::kPlatform |
430 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
431 ThreadHost::Type::kUi);
433 TaskRunners task_runners("test",
434 fml::MessageLoop::GetCurrent().GetTaskRunner(),
435 fml::MessageLoop::GetCurrent().GetTaskRunner(),
436 thread_host.ui_thread->GetTaskRunner(),
437 thread_host.io_thread->GetTaskRunner());
438
439 NiceMock<MockDelegate> delegate;
440 Settings settings;
441 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
442 EXPECT_CALL(delegate, GetTaskRunners())
443 .WillRepeatedly(ReturnRef(task_runners));
444 EXPECT_CALL(delegate, OnFrameRasterized(_));
445
446 auto rasterizer = std::make_unique<Rasterizer>(delegate);
447 auto surface = std::make_unique<NiceMock<MockSurface>>();
448
449 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
450 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
451 rasterizer->SetExternalViewEmbedder(external_view_embedder);
452
453 SurfaceFrame::FramebufferInfo framebuffer_info;
454 framebuffer_info.supports_readback = true;
455
456 auto surface_frame1 = std::make_unique<SurfaceFrame>(
457 /*surface=*/
458 nullptr, framebuffer_info,
459 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
460 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
461 /*frame_size=*/DlISize(800, 600));
462 auto surface_frame2 = std::make_unique<SurfaceFrame>(
463 /*surface=*/
464 nullptr, framebuffer_info,
465 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
466 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
467 /*frame_size=*/DlISize(800, 600));
468 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled())
469 .WillRepeatedly(Return(true));
470 // Prepare two frames for Draw() and DrawLastLayerTrees().
471 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
472 .WillOnce(Return(ByMove(std::move(surface_frame1))))
473 .WillOnce(Return(ByMove(std::move(surface_frame2))));
474 EXPECT_CALL(*surface, MakeRenderContextCurrent())
475 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
476 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
477 .WillRepeatedly(Return(true));
478
479 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
480 /*raster_thread_merger=*/_))
481 .Times(2);
482 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
483 /*frame_size=*/DlISize(),
484 /*device_pixel_ratio=*/2.0))
485 .Times(2);
486 EXPECT_CALL(*external_view_embedder,
487 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
488 .Times(2);
489 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
490 /*raster_thread_merger=*/_))
491 .Times(2);
492
493 rasterizer->Setup(std::move(surface));
494
495 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
496 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
497 /*frame_size=*/DlISize());
498 auto layer_tree_item = std::make_unique<FrameItem>(
499 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
500 kDevicePixelRatio),
502 PipelineProduceResult result =
503 pipeline->Produce().Complete(std::move(layer_tree_item));
504 EXPECT_TRUE(result.success);
505
506 // The Draw() will respectively call BeginFrame(), SubmitFlutterView() and
507 // EndFrame() one time.
508 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
509 rasterizer->Draw(pipeline);
510
511 // The DrawLastLayerTrees() will respectively call BeginFrame(),
512 // SubmitFlutterView() and EndFrame() one more time, totally 2 times.
513 rasterizer->DrawLastLayerTrees(CreateFinishedBuildRecorder());
514}

References CreateFinishedBuildRecorder(), fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::MessageLoop::GetCurrent(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, and flutter::ThreadHost::ui_thread.

◆ TEST() [113/363]

flutter::TEST ( RasterizerTest  ,
drawLayerTreeWithCorrectFrameTimingWhenPipelineIsMoreAvailable   
)

Definition at line 1065 of file rasterizer_unittests.cc.

1066 {
1067 std::string test_name =
1068 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1069 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1070 ThreadHost::Type::kPlatform |
1071 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1072 ThreadHost::Type::kUi);
1073 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1074 thread_host.raster_thread->GetTaskRunner(),
1075 thread_host.ui_thread->GetTaskRunner(),
1076 thread_host.io_thread->GetTaskRunner());
1077 NiceMock<MockDelegate> delegate;
1078 Settings settings;
1079 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1080 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1081
1083 std::unique_ptr<Rasterizer> rasterizer;
1084 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1085 rasterizer = std::make_unique<Rasterizer>(delegate);
1086 latch.Signal();
1087 });
1088 latch.Wait();
1089
1090 auto surface = std::make_unique<NiceMock<MockSurface>>();
1091 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled())
1092 .WillRepeatedly(Return(true));
1093 ON_CALL(*surface, AcquireFrame(DlISize()))
1094 .WillByDefault(::testing::Invoke([] {
1095 SurfaceFrame::FramebufferInfo framebuffer_info;
1096 framebuffer_info.supports_readback = true;
1097 return std::make_unique<SurfaceFrame>(
1098 /*surface=*/
1099 nullptr, framebuffer_info,
1100 /*encode_callback=*/
1101 [](const SurfaceFrame&, DlCanvas*) { return true; },
1102 /*submit_callback=*/[](const SurfaceFrame& frame) { return true; },
1103 /*frame_size=*/DlISize(800, 600));
1104 }));
1105 ON_CALL(*surface, MakeRenderContextCurrent())
1106 .WillByDefault(::testing::Invoke(
1107 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1108
1109 fml::CountDownLatch count_down_latch(2);
1110 auto first_timestamp = fml::TimePoint::Now();
1111 auto second_timestamp = first_timestamp + fml::TimeDelta::FromMilliseconds(8);
1112 std::vector<fml::TimePoint> timestamps = {first_timestamp, second_timestamp};
1113 int frame_rasterized_count = 0;
1114 EXPECT_CALL(delegate, OnFrameRasterized(_))
1115 .Times(2)
1116 .WillRepeatedly([&](const FrameTiming& frame_timing) {
1117 EXPECT_EQ(timestamps[frame_rasterized_count],
1118 frame_timing.Get(FrameTiming::kVsyncStart));
1119 EXPECT_EQ(timestamps[frame_rasterized_count],
1120 frame_timing.Get(FrameTiming::kBuildStart));
1121 EXPECT_EQ(timestamps[frame_rasterized_count],
1122 frame_timing.Get(FrameTiming::kBuildFinish));
1123 frame_rasterized_count++;
1124 count_down_latch.CountDown();
1125 });
1126
1127 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1128 rasterizer->Setup(std::move(surface));
1129 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1130 for (int i = 0; i < 2; i++) {
1131 auto layer_tree = std::make_unique<LayerTree>(
1132 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
1133 auto layer_tree_item = std::make_unique<FrameItem>(
1134 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1135 kDevicePixelRatio),
1136 CreateFinishedBuildRecorder(timestamps[i]));
1137 PipelineProduceResult result =
1138 pipeline->Produce().Complete(std::move(layer_tree_item));
1139 EXPECT_TRUE(result.success);
1140 EXPECT_EQ(result.is_first_item, i == 0);
1141 }
1142 // Although we only call 'Rasterizer::Draw' once, it will be called twice
1143 // finally because there are two items in the pipeline.
1144 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1145 rasterizer->Draw(pipeline);
1146 });
1147 count_down_latch.Wait();
1148 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1149 rasterizer.reset();
1150 latch.Signal();
1151 });
1152 latch.Wait();
1153}

References fml::CountDownLatch::CountDown(), CreateFinishedBuildRecorder(), fml::TimeDelta::FromMilliseconds(), flutter::FrameTiming::Get(), i, flutter::ThreadHost::io_thread, flutter::PipelineProduceResult::is_first_item, flutter::FrameTiming::kBuildFinish, flutter::FrameTiming::kBuildStart, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::FrameTiming::kVsyncStart, fml::TimePoint::Now(), flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, fml::CountDownLatch::Wait(), and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [114/363]

flutter::TEST ( RasterizerTest  ,
drawMultipleViewsWithExternalViewEmbedder   
)

Definition at line 677 of file rasterizer_unittests.cc.

677 {
678 std::string test_name =
679 ::testing::UnitTest::GetInstance()->current_test_info()->name();
680 ThreadHost thread_host("io.flutter.test." + test_name + ".",
681 ThreadHost::Type::kPlatform |
682 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
683 ThreadHost::Type::kUi);
684 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
685 thread_host.raster_thread->GetTaskRunner(),
686 thread_host.ui_thread->GetTaskRunner(),
687 thread_host.io_thread->GetTaskRunner());
688 NiceMock<MockDelegate> delegate;
689 Settings settings;
690 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
691 EXPECT_CALL(delegate, GetTaskRunners())
692 .WillRepeatedly(ReturnRef(task_runners));
693 EXPECT_CALL(delegate, OnFrameRasterized(_));
694 auto rasterizer = std::make_unique<Rasterizer>(delegate);
695 auto surface = std::make_unique<NiceMock<MockSurface>>();
696 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
697 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
698 rasterizer->SetExternalViewEmbedder(external_view_embedder);
699 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
700 .WillRepeatedly(Return(false));
701 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
702 EXPECT_CALL(*surface, AcquireFrame(DlISize())).Times(2);
703 ON_CALL(*surface, AcquireFrame).WillByDefault([](const DlISize& size) {
704 SurfaceFrame::FramebufferInfo framebuffer_info;
705 framebuffer_info.supports_readback = true;
706 return std::make_unique<SurfaceFrame>(
707 /*surface=*/
708 nullptr, framebuffer_info,
709 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
710 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
711 /*frame_size=*/DlISize(800, 600));
712 });
713 EXPECT_CALL(*surface, MakeRenderContextCurrent())
714 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
715
716 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
717 /*raster_thread_merger=*/_))
718 .Times(1);
719 EXPECT_CALL(*external_view_embedder,
720 PrepareFlutterView(/*frame_size=*/DlISize(),
721 /*device_pixel_ratio=*/1.5))
722 .Times(1);
723 EXPECT_CALL(*external_view_embedder,
724 SubmitFlutterView(/*flutter_view_id=*/0, _, _, _))
725 .Times(1);
726 EXPECT_CALL(*external_view_embedder,
727 PrepareFlutterView(/*frame_size=*/DlISize(),
728 /*device_pixel_ratio=*/2.0))
729 .Times(1);
730 EXPECT_CALL(*external_view_embedder,
731 SubmitFlutterView(/*flutter_view_id=*/1, _, _, _))
732 .Times(1);
733 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
734 /*raster_thread_merger=*/_))
735 .Times(1);
736
737 rasterizer->Setup(std::move(surface));
739 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
740 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
741 std::vector<std::unique_ptr<LayerTreeTask>> tasks;
742 tasks.push_back(std::make_unique<LayerTreeTask>(
743 0, std::make_unique<LayerTree>(nullptr, DlISize()), 1.5));
744 tasks.push_back(std::make_unique<LayerTreeTask>(
745 1, std::make_unique<LayerTree>(nullptr, DlISize()), 2.0));
746 auto layer_tree_item = std::make_unique<FrameItem>(
747 std::move(tasks), CreateFinishedBuildRecorder());
748 PipelineProduceResult result =
749 pipeline->Produce().Complete(std::move(layer_tree_item));
750 EXPECT_TRUE(result.success);
751 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
752 rasterizer->Draw(pipeline);
753 latch.Signal();
754 });
755 latch.Wait();
756}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), size, flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [115/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderAndThreadMergerNotMergedExternalViewEmbedderSubmitFrameNotCalled   
)

Definition at line 273 of file rasterizer_unittests.cc.

275 {
276 std::string test_name =
277 ::testing::UnitTest::GetInstance()->current_test_info()->name();
278 ThreadHost thread_host("io.flutter.test." + test_name + ".",
279 ThreadHost::Type::kPlatform |
280 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
281 ThreadHost::Type::kUi);
282 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
283 thread_host.raster_thread->GetTaskRunner(),
284 thread_host.ui_thread->GetTaskRunner(),
285 thread_host.io_thread->GetTaskRunner());
286 NiceMock<MockDelegate> delegate;
287 Settings settings;
288 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
289 EXPECT_CALL(delegate, GetTaskRunners())
290 .WillRepeatedly(ReturnRef(task_runners));
291 EXPECT_CALL(delegate, OnFrameRasterized(_));
292 auto rasterizer = std::make_unique<Rasterizer>(delegate);
293 auto surface = std::make_unique<NiceMock<MockSurface>>();
294 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
295 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
296 rasterizer->SetExternalViewEmbedder(external_view_embedder);
297 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
298 .WillRepeatedly(Return(true));
299 SurfaceFrame::FramebufferInfo framebuffer_info;
300 framebuffer_info.supports_readback = true;
301 auto surface_frame = std::make_unique<SurfaceFrame>(
302 /*surface=*/
303 nullptr, framebuffer_info,
304 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
305 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
306 /*frame_size=*/DlISize(800, 600));
307 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
308 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
309 .WillOnce(Return(ByMove(std::move(surface_frame))));
310 EXPECT_CALL(*surface, MakeRenderContextCurrent())
311 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
312
313 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
314 /*raster_thread_merger=*/_))
315 .Times(1);
316 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
317 /*frame_size=*/DlISize(),
318 /*device_pixel_ratio=*/2.0))
319 .Times(1);
320 EXPECT_CALL(*external_view_embedder,
321 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
322 .Times(0);
323 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
324 /*raster_thread_merger=*/_))
325 .Times(1);
326
327 rasterizer->Setup(std::move(surface));
329 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
330 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
331 auto layer_tree = std::make_unique<LayerTree>(
332 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
333 auto layer_tree_item = std::make_unique<FrameItem>(
334 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
335 kDevicePixelRatio),
337 PipelineProduceResult result =
338 pipeline->Produce().Complete(std::move(layer_tree_item));
339 EXPECT_TRUE(result.success);
340 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
341 rasterizer->Draw(pipeline);
342 latch.Signal();
343 });
344 latch.Wait();
345}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [116/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderAndThreadsMergedExternalViewEmbedderSubmitFrameCalled   
)

Definition at line 347 of file rasterizer_unittests.cc.

349 {
350 std::string test_name =
351 ::testing::UnitTest::GetInstance()->current_test_info()->name();
352 ThreadHost thread_host("io.flutter.test." + test_name + ".",
353 ThreadHost::Type::kPlatform |
354 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
355 ThreadHost::Type::kUi);
357 TaskRunners task_runners("test",
358 fml::MessageLoop::GetCurrent().GetTaskRunner(),
359 fml::MessageLoop::GetCurrent().GetTaskRunner(),
360 thread_host.ui_thread->GetTaskRunner(),
361 thread_host.io_thread->GetTaskRunner());
362
363 NiceMock<MockDelegate> delegate;
364 Settings settings;
365 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
366 EXPECT_CALL(delegate, GetTaskRunners())
367 .WillRepeatedly(ReturnRef(task_runners));
368 EXPECT_CALL(delegate, OnFrameRasterized(_));
369
370 auto rasterizer = std::make_unique<Rasterizer>(delegate);
371 auto surface = std::make_unique<NiceMock<MockSurface>>();
372
373 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
374 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
375 rasterizer->SetExternalViewEmbedder(external_view_embedder);
376
377 SurfaceFrame::FramebufferInfo framebuffer_info;
378 framebuffer_info.supports_readback = true;
379
380 auto surface_frame = std::make_unique<SurfaceFrame>(
381 /*surface=*/
382 nullptr, framebuffer_info,
383 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
384 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
385 /*frame_size=*/DlISize(800, 600));
386 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
387 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
388 .WillOnce(Return(ByMove(std::move(surface_frame))));
389 EXPECT_CALL(*surface, MakeRenderContextCurrent())
390 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
391 EXPECT_CALL(*external_view_embedder, SupportsDynamicThreadMerging)
392 .WillRepeatedly(Return(true));
393
394 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
395 /*raster_thread_merger=*/_))
396 .Times(1);
397 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
398 /*frame_size=*/DlISize(),
399 /*device_pixel_ratio=*/2.0))
400 .Times(1);
401 EXPECT_CALL(*external_view_embedder,
402 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
403 .Times(1);
404 EXPECT_CALL(*external_view_embedder, EndFrame(/*should_resubmit_frame=*/false,
405 /*raster_thread_merger=*/_))
406 .Times(1);
407
408 rasterizer->Setup(std::move(surface));
409
410 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
411 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
412 /*frame_size=*/DlISize());
413 auto layer_tree_item = std::make_unique<FrameItem>(
414 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
415 kDevicePixelRatio),
417 PipelineProduceResult result =
418 pipeline->Produce().Complete(std::move(layer_tree_item));
419 EXPECT_TRUE(result.success);
420 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
421 rasterizer->Draw(pipeline);
422}

References CreateFinishedBuildRecorder(), fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::MessageLoop::GetCurrent(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, and flutter::ThreadHost::ui_thread.

◆ TEST() [117/363]

flutter::TEST ( RasterizerTest  ,
drawWithExternalViewEmbedderExternalViewEmbedderSubmitFrameCalled   
)

Definition at line 194 of file rasterizer_unittests.cc.

195 {
196 std::string test_name =
197 ::testing::UnitTest::GetInstance()->current_test_info()->name();
198 ThreadHost thread_host("io.flutter.test." + test_name + ".",
199 ThreadHost::Type::kPlatform |
200 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
201 ThreadHost::Type::kUi);
202 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
203 thread_host.raster_thread->GetTaskRunner(),
204 thread_host.ui_thread->GetTaskRunner(),
205 thread_host.io_thread->GetTaskRunner());
206 NiceMock<MockDelegate> delegate;
207 Settings settings;
208 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
209 EXPECT_CALL(delegate, GetTaskRunners())
210 .WillRepeatedly(ReturnRef(task_runners));
211 EXPECT_CALL(delegate, OnFrameRasterized(_));
212 auto rasterizer = std::make_unique<Rasterizer>(delegate);
213 auto surface = std::make_unique<NiceMock<MockSurface>>();
214
215 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
216 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
217 rasterizer->SetExternalViewEmbedder(external_view_embedder);
218
219 SurfaceFrame::FramebufferInfo framebuffer_info;
220 framebuffer_info.supports_readback = true;
221
222 auto surface_frame = std::make_unique<SurfaceFrame>(
223 /*surface=*/
224 nullptr, framebuffer_info,
225 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
226 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
227 /*frame_size=*/DlISize(800, 600));
228 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
229 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
230 .WillOnce(Return(ByMove(std::move(surface_frame))));
231 EXPECT_CALL(*surface, MakeRenderContextCurrent())
232 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
233
234 EXPECT_CALL(*external_view_embedder,
235 BeginFrame(/*context=*/nullptr,
236 /*raster_thread_merger=*/
238 .Times(1);
239 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
240 /*frame_size=*/DlISize(),
241 /*device_pixel_ratio=*/2.0))
242 .Times(1);
243 EXPECT_CALL(*external_view_embedder,
244 SubmitFlutterView(/*flutter_view_id=*/kImplicitViewId, _, _, _))
245 .Times(1);
246 EXPECT_CALL(
247 *external_view_embedder,
248 EndFrame(/*should_resubmit_frame=*/false,
249 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
250 nullptr)))
251 .Times(1);
252
253 rasterizer->Setup(std::move(surface));
255 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
256 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
257 auto layer_tree = std::make_unique<LayerTree>(/*root_layer=*/nullptr,
258 /*frame_size=*/DlISize());
259 auto layer_tree_item = std::make_unique<FrameItem>(
260 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
261 kDevicePixelRatio),
263 PipelineProduceResult result =
264 pipeline->Produce().Complete(std::move(layer_tree_item));
265 EXPECT_TRUE(result.success);
266 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
267 rasterizer->Draw(pipeline);
268 latch.Signal();
269 });
270 latch.Wait();
271}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [118/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuDisabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 819 of file rasterizer_unittests.cc.

821 {
822 std::string test_name =
823 ::testing::UnitTest::GetInstance()->current_test_info()->name();
824 ThreadHost thread_host("io.flutter.test." + test_name + ".",
825 ThreadHost::Type::kPlatform |
826 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
827 ThreadHost::Type::kUi);
828 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
829 thread_host.raster_thread->GetTaskRunner(),
830 thread_host.ui_thread->GetTaskRunner(),
831 thread_host.io_thread->GetTaskRunner());
832 NiceMock<MockDelegate> delegate;
833 Settings settings;
834 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
835 EXPECT_CALL(delegate, GetTaskRunners())
836 .WillRepeatedly(ReturnRef(task_runners));
837 EXPECT_CALL(delegate, OnFrameRasterized(_));
838 auto rasterizer = std::make_unique<Rasterizer>(delegate);
839 auto surface = std::make_unique<NiceMock<MockSurface>>();
840 auto is_gpu_disabled_sync_switch =
841 std::make_shared<const fml::SyncSwitch>(true);
842
843 SurfaceFrame::FramebufferInfo framebuffer_info;
844 framebuffer_info.supports_readback = true;
845
846 auto surface_frame = std::make_unique<SurfaceFrame>(
847 /*surface=*/
848 nullptr, /*framebuffer_info=*/framebuffer_info,
849 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
850 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
851 /*frame_size=*/DlISize(800, 600));
852 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
853 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
854 .WillByDefault(Return(is_gpu_disabled_sync_switch));
855 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()).Times(0);
856 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
857 .WillOnce(Return(ByMove(std::move(surface_frame))));
858 EXPECT_CALL(*surface, MakeRenderContextCurrent())
859 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
860
861 rasterizer->Setup(std::move(surface));
863 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
864 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
865 auto layer_tree = std::make_unique<LayerTree>(
866 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
867 auto layer_tree_item = std::make_unique<FrameItem>(
868 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
869 kDevicePixelRatio),
871 PipelineProduceResult result =
872 pipeline->Produce().Complete(std::move(layer_tree_item));
873 EXPECT_TRUE(result.success);
874 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
875 DrawStatus status = rasterizer->Draw(pipeline);
876 EXPECT_EQ(status, DrawStatus::kDone);
877 latch.Signal();
878 });
879 latch.Wait();
880}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kDone, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [119/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuDisabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesntAcquireFrame   
)

Definition at line 944 of file rasterizer_unittests.cc.

946 {
947 std::string test_name =
948 ::testing::UnitTest::GetInstance()->current_test_info()->name();
949 ThreadHost thread_host("io.flutter.test." + test_name + ".",
950 ThreadHost::Type::kPlatform |
951 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
952 ThreadHost::Type::kUi);
953 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
954 thread_host.raster_thread->GetTaskRunner(),
955 thread_host.ui_thread->GetTaskRunner(),
956 thread_host.io_thread->GetTaskRunner());
957 NiceMock<MockDelegate> delegate;
958 Settings settings;
959 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
960 EXPECT_CALL(delegate, GetTaskRunners())
961 .WillRepeatedly(ReturnRef(task_runners));
962 EXPECT_CALL(delegate, OnFrameRasterized(_)).Times(0);
963 auto rasterizer = std::make_unique<Rasterizer>(delegate);
964 auto surface = std::make_unique<NiceMock<MockSurface>>();
965 auto is_gpu_disabled_sync_switch =
966 std::make_shared<const fml::SyncSwitch>(true);
967
968 SurfaceFrame::FramebufferInfo framebuffer_info;
969 framebuffer_info.supports_readback = true;
970
971 auto surface_frame = std::make_unique<SurfaceFrame>(
972 /*surface=*/
973 nullptr, /*framebuffer_info=*/framebuffer_info,
974 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
975 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
976 /*frame_size=*/DlISize(800, 600));
977 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false));
978 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch())
979 .WillOnce(Return(is_gpu_disabled_sync_switch));
980 EXPECT_CALL(*surface, AcquireFrame(DlISize())).Times(0);
981 EXPECT_CALL(*surface, MakeRenderContextCurrent())
982 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
983
984 rasterizer->Setup(std::move(surface));
986 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
987 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
988 auto layer_tree = std::make_unique<LayerTree>(
989 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
990 auto layer_tree_item = std::make_unique<FrameItem>(
991 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
992 kDevicePixelRatio),
994 PipelineProduceResult result =
995 pipeline->Produce().Complete(std::move(layer_tree_item));
996 EXPECT_TRUE(result.success);
997 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
998 DrawStatus status = rasterizer->Draw(pipeline);
999 EXPECT_EQ(status, DrawStatus::kGpuUnavailable);
1000 latch.Signal();
1001 });
1002 latch.Wait();
1003}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kGpuUnavailable, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [120/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuEnabledAndSurfaceAllowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 758 of file rasterizer_unittests.cc.

759 {
760 std::string test_name =
761 ::testing::UnitTest::GetInstance()->current_test_info()->name();
762 ThreadHost thread_host("io.flutter.test." + test_name + ".",
763 ThreadHost::Type::kPlatform |
764 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
765 ThreadHost::Type::kUi);
766 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
767 thread_host.raster_thread->GetTaskRunner(),
768 thread_host.ui_thread->GetTaskRunner(),
769 thread_host.io_thread->GetTaskRunner());
770 NiceMock<MockDelegate> delegate;
771 Settings settings;
772 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
773 EXPECT_CALL(delegate, GetTaskRunners())
774 .WillRepeatedly(ReturnRef(task_runners));
775 EXPECT_CALL(delegate, OnFrameRasterized(_));
776
777 auto rasterizer = std::make_unique<Rasterizer>(delegate);
778 auto surface = std::make_unique<NiceMock<MockSurface>>();
779 auto is_gpu_disabled_sync_switch =
780 std::make_shared<const fml::SyncSwitch>(false);
781
782 SurfaceFrame::FramebufferInfo framebuffer_info;
783 framebuffer_info.supports_readback = true;
784 auto surface_frame = std::make_unique<SurfaceFrame>(
785 /*surface=*/
786 nullptr, /*framebuffer_info=*/framebuffer_info,
787 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
788 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
789 /*frame_size=*/DlISize(800, 600));
790 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(true));
791 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
792 .WillByDefault(Return(is_gpu_disabled_sync_switch));
793 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch()).Times(0);
794 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
795 .WillOnce(Return(ByMove(std::move(surface_frame))));
796 EXPECT_CALL(*surface, MakeRenderContextCurrent())
797 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
798
799 rasterizer->Setup(std::move(surface));
801 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
802 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
803 auto layer_tree = std::make_unique<LayerTree>(
804 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
805 auto layer_tree_item = std::make_unique<FrameItem>(
806 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
807 kDevicePixelRatio),
809 PipelineProduceResult result =
810 pipeline->Produce().Complete(std::move(layer_tree_item));
811 EXPECT_TRUE(result.success);
812 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
813 rasterizer->Draw(pipeline);
814 latch.Signal();
815 });
816 latch.Wait();
817}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [121/363]

flutter::TEST ( RasterizerTest  ,
drawWithGpuEnabledAndSurfaceDisallowsDrawingWhenGpuDisabledDoesAcquireFrame   
)

Definition at line 882 of file rasterizer_unittests.cc.

884 {
885 std::string test_name =
886 ::testing::UnitTest::GetInstance()->current_test_info()->name();
887 ThreadHost thread_host("io.flutter.test." + test_name + ".",
888 ThreadHost::Type::kPlatform |
889 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
890 ThreadHost::Type::kUi);
891 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
892 thread_host.raster_thread->GetTaskRunner(),
893 thread_host.ui_thread->GetTaskRunner(),
894 thread_host.io_thread->GetTaskRunner());
895 NiceMock<MockDelegate> delegate;
896 Settings settings;
897 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
898 EXPECT_CALL(delegate, GetTaskRunners())
899 .WillRepeatedly(ReturnRef(task_runners));
900 EXPECT_CALL(delegate, OnFrameRasterized(_));
901 auto rasterizer = std::make_unique<Rasterizer>(delegate);
902 auto surface = std::make_unique<NiceMock<MockSurface>>();
903 auto is_gpu_disabled_sync_switch =
904 std::make_shared<const fml::SyncSwitch>(false);
905
906 SurfaceFrame::FramebufferInfo framebuffer_info;
907 framebuffer_info.supports_readback = true;
908
909 auto surface_frame = std::make_unique<SurfaceFrame>(
910 /*surface=*/
911 nullptr, /*framebuffer_info=*/framebuffer_info,
912 /*encode_callback=*/[](const SurfaceFrame&, DlCanvas*) { return true; },
913 /*submit_callback=*/[](const SurfaceFrame&) { return true; },
914 /*frame_size=*/DlISize(800, 600));
915 EXPECT_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillOnce(Return(false));
916 EXPECT_CALL(delegate, GetIsGpuDisabledSyncSwitch())
917 .WillOnce(Return(is_gpu_disabled_sync_switch));
918 EXPECT_CALL(*surface, AcquireFrame(DlISize()))
919 .WillOnce(Return(ByMove(std::move(surface_frame))));
920 EXPECT_CALL(*surface, MakeRenderContextCurrent())
921 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
922
923 rasterizer->Setup(std::move(surface));
925 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
926 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
927 auto layer_tree = std::make_unique<LayerTree>(
928 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
929 auto layer_tree_item = std::make_unique<FrameItem>(
930 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
931 kDevicePixelRatio),
933 PipelineProduceResult result =
934 pipeline->Produce().Complete(std::move(layer_tree_item));
935 EXPECT_TRUE(result.success);
936 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
937 DrawStatus status = rasterizer->Draw(pipeline);
938 EXPECT_EQ(status, DrawStatus::kDone);
939 latch.Signal();
940 });
941 latch.Wait();
942}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kDone, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [122/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet   
)

Definition at line 516 of file rasterizer_unittests.cc.

516 {
517 std::string test_name =
518 ::testing::UnitTest::GetInstance()->current_test_info()->name();
519 ThreadHost thread_host("io.flutter.test." + test_name + ".",
520 ThreadHost::Type::kPlatform |
521 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
522 ThreadHost::Type::kUi);
523 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
524 thread_host.raster_thread->GetTaskRunner(),
525 thread_host.ui_thread->GetTaskRunner(),
526 thread_host.io_thread->GetTaskRunner());
527 NiceMock<MockDelegate> delegate;
528 Settings settings;
529 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
530 EXPECT_CALL(delegate, GetTaskRunners())
531 .WillRepeatedly(ReturnRef(task_runners));
532 auto rasterizer = std::make_unique<Rasterizer>(delegate);
533
534 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
535 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
536 rasterizer->SetExternalViewEmbedder(external_view_embedder);
537
538 EXPECT_CALL(
539 *external_view_embedder,
540 EndFrame(/*should_resubmit_frame=*/false,
541 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
542 nullptr)))
543 .Times(0);
544
546 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
547 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
548 auto layer_tree = std::make_unique<LayerTree>(
549 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
550 auto layer_tree_item = std::make_unique<FrameItem>(
551 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
552 kDevicePixelRatio),
554 PipelineProduceResult result =
555 pipeline->Produce().Complete(std::move(layer_tree_item));
556 EXPECT_TRUE(result.success);
557 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
558 rasterizer->Draw(pipeline);
559 latch.Signal();
560 });
561 latch.Wait();
562}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [123/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenNotUsedThisFrame   
)

Definition at line 564 of file rasterizer_unittests.cc.

564 {
565 std::string test_name =
566 ::testing::UnitTest::GetInstance()->current_test_info()->name();
567 ThreadHost thread_host("io.flutter.test." + test_name + ".",
568 ThreadHost::Type::kPlatform |
569 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
570 ThreadHost::Type::kUi);
571 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
572 thread_host.raster_thread->GetTaskRunner(),
573 thread_host.ui_thread->GetTaskRunner(),
574 thread_host.io_thread->GetTaskRunner());
575 NiceMock<MockDelegate> delegate;
576 Settings settings;
577 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
578 EXPECT_CALL(delegate, GetTaskRunners())
579 .WillRepeatedly(ReturnRef(task_runners));
580 auto is_gpu_disabled_sync_switch =
581 std::make_shared<const fml::SyncSwitch>(false);
582 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
583 .WillByDefault(Return(is_gpu_disabled_sync_switch));
584
585 auto rasterizer = std::make_unique<Rasterizer>(delegate);
586 auto surface = std::make_unique<NiceMock<MockSurface>>();
587 EXPECT_CALL(*surface, MakeRenderContextCurrent())
588 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
589
590 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
591 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
592 rasterizer->SetExternalViewEmbedder(external_view_embedder);
593 rasterizer->Setup(std::move(surface));
594
595 EXPECT_CALL(*external_view_embedder, BeginFrame(/*context=*/nullptr,
596 /*raster_thread_merger=*/_))
597 .Times(0);
598 EXPECT_CALL(*external_view_embedder, PrepareFlutterView(
599 /*frame_size=*/DlISize(),
600 /*device_pixel_ratio=*/2.0))
601 .Times(0);
602 EXPECT_CALL(
603 *external_view_embedder,
604 EndFrame(/*should_resubmit_frame=*/false,
605 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
606 nullptr)))
607 .Times(0);
608
610 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
611 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
612 auto layer_tree = std::make_unique<LayerTree>(
613 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
614 auto layer_tree_item = std::make_unique<FrameItem>(
615 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
616 kDevicePixelRatio),
618 PipelineProduceResult result =
619 pipeline->Produce().Complete(std::move(layer_tree_item));
620 EXPECT_TRUE(result.success);
621 // Always discard the layer tree.
622 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(true));
623 DrawStatus status = rasterizer->Draw(pipeline);
624 EXPECT_EQ(status, DrawStatus::kDone);
625 EXPECT_EQ(rasterizer->GetLastDrawStatus(kImplicitViewId),
626 DrawSurfaceStatus::kDiscarded);
627 latch.Signal();
628 });
629 latch.Wait();
630}

References CreateFinishedBuildRecorder(), flutter::ThreadHost::io_thread, kDiscarded, kDone, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [124/363]

flutter::TEST ( RasterizerTest  ,
externalViewEmbedderDoesntEndFrameWhenPipelineIsEmpty   
)

Definition at line 632 of file rasterizer_unittests.cc.

632 {
633 std::string test_name =
634 ::testing::UnitTest::GetInstance()->current_test_info()->name();
635 ThreadHost thread_host("io.flutter.test." + test_name + ".",
636 ThreadHost::Type::kPlatform |
637 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
638 ThreadHost::Type::kUi);
639 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
640 thread_host.raster_thread->GetTaskRunner(),
641 thread_host.ui_thread->GetTaskRunner(),
642 thread_host.io_thread->GetTaskRunner());
643 NiceMock<MockDelegate> delegate;
644 Settings settings;
645 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
646 EXPECT_CALL(delegate, GetTaskRunners())
647 .WillRepeatedly(ReturnRef(task_runners));
648
649 auto rasterizer = std::make_unique<Rasterizer>(delegate);
650 auto surface = std::make_unique<NiceMock<MockSurface>>();
651 EXPECT_CALL(*surface, MakeRenderContextCurrent())
652 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
653
654 std::shared_ptr<NiceMock<MockExternalViewEmbedder>> external_view_embedder =
655 std::make_shared<NiceMock<MockExternalViewEmbedder>>();
656 rasterizer->SetExternalViewEmbedder(external_view_embedder);
657 rasterizer->Setup(std::move(surface));
658
659 EXPECT_CALL(
660 *external_view_embedder,
661 EndFrame(/*should_resubmit_frame=*/false,
662 /*raster_thread_merger=*/fml::RefPtr<fml::RasterThreadMerger>(
663 nullptr)))
664 .Times(0);
665
667 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
668 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
669 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
670 DrawStatus status = rasterizer->Draw(pipeline);
671 EXPECT_EQ(status, DrawStatus::kPipelineEmpty);
672 latch.Signal();
673 });
674 latch.Wait();
675}

References flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, kPipelineEmpty, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [125/363]

flutter::TEST ( RasterizerTest  ,
FrameTimingRecorderShouldStartRecordingRasterTimeBeforeSurfaceAcquireFrame   
)

Definition at line 1005 of file rasterizer_unittests.cc.

1007 {
1008 std::string test_name =
1009 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1010 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1011 ThreadHost::Type::kPlatform |
1012 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1013 ThreadHost::Type::kUi);
1014 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1015 thread_host.raster_thread->GetTaskRunner(),
1016 thread_host.ui_thread->GetTaskRunner(),
1017 thread_host.io_thread->GetTaskRunner());
1018 NiceMock<MockDelegate> delegate;
1019 Settings settings;
1020 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1021 EXPECT_CALL(delegate, GetTaskRunners())
1022 .WillRepeatedly(ReturnRef(task_runners));
1023 EXPECT_CALL(delegate, OnFrameRasterized(_))
1024 .WillOnce([&](const FrameTiming& frame_timing) {
1026 fml::TimePoint raster_start =
1027 frame_timing.Get(FrameTiming::kRasterStart);
1028 EXPECT_TRUE(now - raster_start < fml::TimeDelta::FromSecondsF(1));
1029 });
1030
1031 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1032 auto surface = std::make_unique<NiceMock<MockSurface>>();
1033 auto is_gpu_disabled_sync_switch =
1034 std::make_shared<const fml::SyncSwitch>(false);
1035 ON_CALL(delegate, GetIsGpuDisabledSyncSwitch())
1036 .WillByDefault(Return(is_gpu_disabled_sync_switch));
1037 ON_CALL(*surface, AcquireFrame(DlISize()))
1038 .WillByDefault(::testing::Invoke([] { return nullptr; }));
1039 EXPECT_CALL(*surface, AcquireFrame(DlISize()));
1040 EXPECT_CALL(*surface, MakeRenderContextCurrent())
1041 .WillOnce(Return(ByMove(std::make_unique<GLContextDefaultResult>(true))));
1042 rasterizer->Setup(std::move(surface));
1044 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1045 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1046 auto layer_tree = std::make_unique<LayerTree>(
1047 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
1048 auto layer_tree_item = std::make_unique<FrameItem>(
1049 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1050 kDevicePixelRatio),
1052 PipelineProduceResult result =
1053 pipeline->Produce().Complete(std::move(layer_tree_item));
1054 EXPECT_TRUE(result.success);
1055 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1056 DrawStatus status = rasterizer->Draw(pipeline);
1057 EXPECT_EQ(status, DrawStatus::kDone);
1058 EXPECT_EQ(rasterizer->GetLastDrawStatus(kImplicitViewId),
1059 DrawSurfaceStatus::kFailed);
1060 latch.Signal();
1061 });
1062 latch.Wait();
1063}
fml::TimePoint Get(Phase phase) const
Definition settings.h:43
static constexpr TimeDelta FromSecondsF(double seconds)
Definition time_delta.h:53

References CreateFinishedBuildRecorder(), fml::TimeDelta::FromSecondsF(), flutter::FrameTiming::Get(), flutter::ThreadHost::io_thread, kDone, kFailed, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::FrameTiming::kRasterStart, flutter::ThreadHost::kUi, fml::TimePoint::Now(), flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::PipelineProduceResult::success, surface, flutter::ThreadHost::ui_thread, and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [126/363]

flutter::TEST ( RasterizerTest  ,
isAiksContextInitialized   
)

Definition at line 138 of file rasterizer_unittests.cc.

138 {
139 NiceMock<MockDelegate> delegate;
140 Settings settings;
141 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
142 auto rasterizer = std::make_shared<Rasterizer>(delegate);
143
144 EXPECT_TRUE(rasterizer != nullptr);
145 std::shared_ptr<SnapshotController::Delegate> snapshot_delegate = rasterizer;
146
147 EXPECT_FALSE(snapshot_delegate->IsAiksContextInitialized());
148}

◆ TEST() [127/363]

flutter::TEST ( RasterizerTest  ,
presentationTimeNotSetWhenVsyncTargetInPast   
)

Definition at line 1331 of file rasterizer_unittests.cc.

1331 {
1332 GTEST_SKIP() << "eglPresentationTime is disabled due to "
1333 "https://github.com/flutter/flutter/issues/112503";
1334#if false
1335 std::string test_name =
1336 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1337 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1338 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
1339 ThreadHost::Type::kIo | ThreadHost::Type::kUi);
1340 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1341 thread_host.raster_thread->GetTaskRunner(),
1342 thread_host.ui_thread->GetTaskRunner(),
1343 thread_host.io_thread->GetTaskRunner());
1344
1345 NiceMock<MockDelegate> delegate;
1346 Settings settings;
1347 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1348 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1349
1351 std::unique_ptr<Rasterizer> rasterizer;
1352 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1353 rasterizer = std::make_unique<Rasterizer>(delegate);
1354 latch.Signal();
1355 });
1356 latch.Wait();
1357
1358 const auto millis_16 = fml::TimeDelta::FromMilliseconds(16);
1359 const auto first_timestamp = fml::TimePoint::Now() - millis_16;
1360
1361 fml::CountDownLatch submit_latch(1);
1362 auto surface = std::make_unique<MockSurface>();
1363 ON_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillByDefault(Return(true));
1364 ON_CALL(*surface, AcquireFrame(DlISize()))
1365 .WillByDefault(::testing::Invoke([&] {
1366 SurfaceFrame::FramebufferInfo framebuffer_info;
1367 framebuffer_info.supports_readback = true;
1368 return std::make_unique<SurfaceFrame>(
1369 /*surface=*/nullptr, framebuffer_info,
1370 /*submit_callback=*/
1371 [&](const SurfaceFrame& frame, DlCanvas*) {
1372 const std::optional<fml::TimePoint> pres_time =
1373 frame.submit_info().presentation_time;
1374 EXPECT_EQ(pres_time, std::nullopt);
1375 submit_latch.CountDown();
1376 return true;
1377 },
1378 /*frame_size=*/DlISize(800, 600));
1379 }));
1380
1381 ON_CALL(*surface, MakeRenderContextCurrent())
1382 .WillByDefault(::testing::Invoke(
1383 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1384
1385 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1386 rasterizer->Setup(std::move(surface));
1387 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1388 auto layer_tree = std::make_unique<LayerTree>(
1389 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
1390 auto layer_tree_item = std::make_unique<FrameItem>(
1391 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1392 kDevicePixelRatio),
1393 CreateFinishedBuildRecorder(first_timestamp));
1394 PipelineProduceResult result =
1395 pipeline->Produce().Complete(std::move(layer_tree_item));
1396 EXPECT_TRUE(result.success);
1397 EXPECT_EQ(result.is_first_item, true);
1398 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1399 rasterizer->Draw(pipeline);
1400 });
1401
1402 submit_latch.Wait();
1403 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1404 rasterizer.reset();
1405 latch.Signal();
1406 });
1407 latch.Wait();
1408#endif // false
1409}

References fml::CountDownLatch::CountDown(), CreateFinishedBuildRecorder(), fml::TimeDelta::FromMilliseconds(), flutter::ThreadHost::io_thread, flutter::PipelineProduceResult::is_first_item, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, fml::TimePoint::Now(), flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::SurfaceFrame::submit_info(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, fml::CountDownLatch::Wait(), and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [128/363]

flutter::TEST ( RasterizerTest  ,
presentationTimeSetWhenVsyncTargetInFuture   
)

Definition at line 1242 of file rasterizer_unittests.cc.

1242 {
1243 GTEST_SKIP() << "eglPresentationTime is disabled due to "
1244 "https://github.com/flutter/flutter/issues/112503";
1245#if false
1246 std::string test_name =
1247 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1248 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1249 ThreadHost::Type::kPlatform | ThreadHost::Type::kRaster |
1250 ThreadHost::Type::kIo | ThreadHost::Type::kUi);
1251 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1252 thread_host.raster_thread->GetTaskRunner(),
1253 thread_host.ui_thread->GetTaskRunner(),
1254 thread_host.io_thread->GetTaskRunner());
1255
1256 NiceMock<MockDelegate> delegate;
1257 Settings settings;
1258 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1259 ON_CALL(delegate, GetTaskRunners()).WillByDefault(ReturnRef(task_runners));
1260
1262 std::unique_ptr<Rasterizer> rasterizer;
1263 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1264 rasterizer = std::make_unique<Rasterizer>(delegate);
1265 latch.Signal();
1266 });
1267 latch.Wait();
1268
1269 const auto millis_16 = fml::TimeDelta::FromMilliseconds(16);
1270 const auto first_timestamp = fml::TimePoint::Now() + millis_16;
1271 auto second_timestamp = first_timestamp + millis_16;
1272 std::vector<fml::TimePoint> timestamps = {first_timestamp, second_timestamp};
1273
1274 int frames_submitted = 0;
1275 fml::CountDownLatch submit_latch(2);
1276 auto surface = std::make_unique<MockSurface>();
1277 ON_CALL(*surface, AllowsDrawingWhenGpuDisabled()).WillByDefault(Return(true));
1278 ON_CALL(*surface, AcquireFrame(DlISize()))
1279 .WillByDefault(::testing::Invoke([&] {
1280 SurfaceFrame::FramebufferInfo framebuffer_info;
1281 framebuffer_info.supports_readback = true;
1282 return std::make_unique<SurfaceFrame>(
1283 /*surface=*/nullptr, framebuffer_info,
1284 /*submit_callback=*/
1285 [&](const SurfaceFrame& frame, DlCanvas*) {
1286 const auto pres_time = *frame.submit_info().presentation_time;
1287 const auto diff = pres_time - first_timestamp;
1288 int num_frames_submitted = frames_submitted++;
1289 EXPECT_EQ(diff.ToMilliseconds(),
1290 num_frames_submitted * millis_16.ToMilliseconds());
1291 submit_latch.CountDown();
1292 return true;
1293 },
1294 /*frame_size=*/DlISize(800, 600));
1295 }));
1296
1297 ON_CALL(*surface, MakeRenderContextCurrent())
1298 .WillByDefault(::testing::Invoke(
1299 [] { return std::make_unique<GLContextDefaultResult>(true); }));
1300
1301 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1302 rasterizer->Setup(std::move(surface));
1303 auto pipeline = std::make_shared<FramePipeline>(/*depth=*/10);
1304 for (int i = 0; i < 2; i++) {
1305 auto layer_tree = std::make_unique<LayerTree>(
1306 /*root_layer=*/nullptr, /*frame_size=*/DlISize());
1307 auto layer_tree_item = std::make_unique<FrameItem>(
1308 SingleLayerTreeList(kImplicitViewId, std::move(layer_tree),
1309 kDevicePixelRatio),
1310 CreateFinishedBuildRecorder(timestamps[i]));
1311 PipelineProduceResult result =
1312 pipeline->Produce().Complete(std::move(layer_tree_item));
1313 EXPECT_TRUE(result.success);
1314 EXPECT_EQ(result.is_first_item, i == 0);
1315 }
1316 // Although we only call 'Rasterizer::Draw' once, it will be called twice
1317 // finally because there are two items in the pipeline.
1318 ON_CALL(delegate, ShouldDiscardLayerTree).WillByDefault(Return(false));
1319 rasterizer->Draw(pipeline);
1320 });
1321
1322 submit_latch.Wait();
1323 thread_host.raster_thread->GetTaskRunner()->PostTask([&] {
1324 rasterizer.reset();
1325 latch.Signal();
1326 });
1327 latch.Wait();
1328#endif // false
1329}

References fml::CountDownLatch::CountDown(), CreateFinishedBuildRecorder(), fml::TimeDelta::FromMilliseconds(), i, flutter::ThreadHost::io_thread, flutter::PipelineProduceResult::is_first_item, kImplicitViewId, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, fml::TimePoint::Now(), flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, fml::AutoResetWaitableEvent::Signal(), flutter::SurfaceFrame::submit_info(), flutter::PipelineProduceResult::success, flutter::SurfaceFrame::FramebufferInfo::supports_readback, surface, flutter::ThreadHost::ui_thread, fml::CountDownLatch::Wait(), and fml::AutoResetWaitableEvent::Wait().

◆ TEST() [129/363]

flutter::TEST ( RasterizerTest  ,
TeardownFreesResourceCache   
)

Definition at line 1155 of file rasterizer_unittests.cc.

1155 {
1156 std::string test_name =
1157 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1158 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1159 ThreadHost::Type::kPlatform |
1160 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1161 ThreadHost::Type::kUi);
1162 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1163 thread_host.raster_thread->GetTaskRunner(),
1164 thread_host.ui_thread->GetTaskRunner(),
1165 thread_host.io_thread->GetTaskRunner());
1166
1167 NiceMock<MockDelegate> delegate;
1168 Settings settings;
1169 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1170 EXPECT_CALL(delegate, GetTaskRunners())
1171 .WillRepeatedly(ReturnRef(task_runners));
1172
1173 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1174 auto surface = std::make_unique<NiceMock<MockSurface>>();
1175 auto context = GrDirectContext::MakeMock(nullptr);
1176 context->setResourceCacheLimit(0);
1177
1178 EXPECT_CALL(*surface, MakeRenderContextCurrent())
1179 .WillRepeatedly([]() -> std::unique_ptr<GLContextResult> {
1180 return std::make_unique<GLContextDefaultResult>(true);
1181 });
1182 EXPECT_CALL(*surface, GetContext()).WillRepeatedly(Return(context.get()));
1183
1184 rasterizer->Setup(std::move(surface));
1185 EXPECT_EQ(context->getResourceCacheLimit(), 0ul);
1186
1187 rasterizer->SetResourceCacheMaxBytes(10000000, false);
1188 EXPECT_EQ(context->getResourceCacheLimit(), 10000000ul);
1189 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1190
1191 int count = 0;
1192 size_t bytes = 0;
1193 context->getResourceCacheUsage(&count, &bytes);
1194 EXPECT_EQ(bytes, 0ul);
1195
1196 auto image_info =
1197 SkImageInfo::MakeN32Premul(500, 500, SkColorSpace::MakeSRGB());
1198 auto sk_surface = SkSurfaces::RenderTarget(context.get(),
1199 skgpu::Budgeted::kYes, image_info);
1200 EXPECT_TRUE(sk_surface);
1201
1202 SkPaint paint;
1203 sk_surface->getCanvas()->drawPaint(paint);
1204 context->flushAndSubmit(GrSyncCpu::kYes);
1205
1206 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1207
1208 sk_surface.reset();
1209
1210 context->getResourceCacheUsage(&count, &bytes);
1211 EXPECT_GT(bytes, 0ul);
1212 EXPECT_GT(context->getResourceCachePurgeableBytes(), 0ul);
1213
1214 rasterizer->Teardown();
1215 EXPECT_EQ(context->getResourceCachePurgeableBytes(), 0ul);
1216}

References flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, surface, and flutter::ThreadHost::ui_thread.

◆ TEST() [130/363]

flutter::TEST ( RasterizerTest  ,
TeardownNoSurface   
)

Definition at line 1218 of file rasterizer_unittests.cc.

1218 {
1219 std::string test_name =
1220 ::testing::UnitTest::GetInstance()->current_test_info()->name();
1221 ThreadHost thread_host("io.flutter.test." + test_name + ".",
1222 ThreadHost::Type::kPlatform |
1223 ThreadHost::Type::kRaster | ThreadHost::Type::kIo |
1224 ThreadHost::Type::kUi);
1225 TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
1226 thread_host.raster_thread->GetTaskRunner(),
1227 thread_host.ui_thread->GetTaskRunner(),
1228 thread_host.io_thread->GetTaskRunner());
1229
1230 NiceMock<MockDelegate> delegate;
1231 Settings settings;
1232 ON_CALL(delegate, GetSettings()).WillByDefault(ReturnRef(settings));
1233 EXPECT_CALL(delegate, GetTaskRunners())
1234 .WillRepeatedly(ReturnRef(task_runners));
1235
1236 auto rasterizer = std::make_unique<Rasterizer>(delegate);
1237
1238 EXPECT_TRUE(rasterizer);
1239 rasterizer->Teardown();
1240}

References flutter::ThreadHost::io_thread, flutter::ThreadHost::kIo, flutter::ThreadHost::kPlatform, flutter::ThreadHost::kRaster, flutter::ThreadHost::kUi, flutter::ThreadHost::platform_thread, flutter::ThreadHost::raster_thread, and flutter::ThreadHost::ui_thread.

◆ TEST() [131/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}

References flutter::Rect::bottom(), flutter::Rect::left(), flutter::Rect::right(), size, and flutter::Rect::top().

◆ TEST() [132/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}

References flutter::Rect::height(), size, and flutter::Rect::width().

◆ TEST() [133/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}

References flutter::Rect::origin(), size, and flutter::Rect::size().

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

References size.

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

References size.

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

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

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecode().

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

References CheckEncodeDecode().

◆ 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(""), bytes);
153}

References CheckEncodeDecode().

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

References CheckEncodeDecode().

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecode().

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecode().

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecode(), and value.

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

References CheckEncodeDecodeWithEncodePrefix(), and value.

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

References CheckEncodeDecode().

◆ 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:327

References CheckEncodeDecode(), and flutter::PointExtensionSerializer::GetInstance().

◆ 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("hello world"), bytes);
138}

References CheckEncodeDecode().

◆ 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("h\u263Aw"), bytes);
143}

References CheckEncodeDecode().

◆ 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("h\U0001F602w"), bytes);
148}

References CheckEncodeDecode().

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

References CheckEncodeDecode().

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

References CheckEncodeDecode(), flutter::SomeData::data(), flutter::SomeDataExtensionSerializer::GetInstance(), and flutter::SomeData::label().

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

References flutter::StandardMessageCodec::GetInstance().

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

References flutter::StandardMethodCodec::GetInstance().

◆ 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);
171 MethodCall<> call(
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};

References flutter::MethodCodec< T >::DecodeMethodCall(), flutter::MethodCodec< T >::EncodeMethodCall(), flutter::PointExtensionSerializer::GetInstance(), and flutter::StandardMethodCodec::GetInstance().

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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeErrorEnvelope(), flutter::StandardMethodCodec::GetInstance(), and message.

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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeErrorEnvelope(), flutter::StandardMethodCodec::GetInstance(), and message.

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

References flutter::MethodCodec< T >::DecodeMethodCall(), flutter::MethodCodec< T >::EncodeMethodCall(), and flutter::StandardMethodCodec::GetInstance().

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

References flutter::MethodCodec< T >::DecodeMethodCall(), flutter::MethodCodec< T >::EncodeMethodCall(), and flutter::StandardMethodCodec::GetInstance().

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

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeSuccessEnvelope(), and flutter::StandardMethodCodec::GetInstance().

◆ 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();
87 EncodableValue result(42);
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}

References flutter::MethodCodec< T >::DecodeAndProcessResponseEnvelope(), flutter::MethodCodec< T >::EncodeSuccessEnvelope(), and flutter::StandardMethodCodec::GetInstance().

◆ 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.
std::string delta_text() const
int delta_start() const
Get the delta_start_ value.
int delta_end() const
Get the delta_end_ value.
std::string old_text() const

References flutter::TextEditingDelta::delta_end(), flutter::TextEditingDelta::delta_start(), flutter::TextEditingDelta::delta_text(), and flutter::TextEditingDelta::old_text().

◆ 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
29 TextEditingDelta delta = TextEditingDelta(old_text);
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}

References flutter::TextEditingDelta::delta_end(), flutter::TextEditingDelta::delta_start(), flutter::TextEditingDelta::delta_text(), and flutter::TextEditingDelta::old_text().

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

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::Contains().

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

References flutter::TextRange::reversed().

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

References flutter::TextRange::reversed().

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

References flutter::TextRange::reversed().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_base().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_base().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_end().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_end().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_extent().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_extent().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_start().

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

References flutter::TextRange::base(), flutter::TextRange::extent(), and flutter::TextRange::set_start().

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

References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::end(), flutter::TextRange::extent(), flutter::TextRange::length(), flutter::TextRange::position(), and flutter::TextRange::start().

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

References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::end(), flutter::TextRange::extent(), flutter::TextRange::length(), flutter::TextRange::position(), and flutter::TextRange::start().

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

References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::end(), flutter::TextRange::extent(), flutter::TextRange::length(), and flutter::TextRange::start().

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

References flutter::TextRange::base(), flutter::TextRange::collapsed(), flutter::TextRange::end(), flutter::TextRange::extent(), flutter::TextRange::length(), and flutter::TextRange::start().

◆ 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

References flutter::TextureRegistrar::MarkTextureFrameAvailable(), and flutter::PluginRegistrar::texture_registrar().

◆ 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

References height, flutter::TextureRegistrar::MarkTextureFrameAvailable(), flutter::TextureRegistrar::RegisterTexture(), fml::AutoResetWaitableEvent::Signal(), flutter::testing::ScopedStubFlutterApi::stub(), texture, texture_id, flutter::PluginRegistrar::texture_registrar(), flutter::TextureRegistrar::UnregisterTexture(), fml::AutoResetWaitableEvent::Wait(), and width.

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

References fml::AutoResetWaitableEvent::Signal(), flutter::PluginRegistrar::texture_registrar(), flutter::TextureRegistrar::UnregisterTexture(), and fml::AutoResetWaitableEvent::Wait().

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

References flutter::DartProject::dart_entrypoint_arguments(), and flutter::DartProject::set_dart_entrypoint_arguments().

◆ 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 278 of file engine_animator_unittests.cc.

278 {
279 MockAnimatorDelegate animator_delegate;
280 std::unique_ptr<EngineContext> engine_context;
281
282 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
283 std::make_shared<MockPlatformMessageHandler>();
284 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
285 .WillOnce(ReturnRef(platform_message_handler));
287 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
288 .WillOnce(
289 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
290 auto status =
291 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
292 auto tasks = Sorted(item->layer_tree_tasks);
293 EXPECT_EQ(tasks.size(), 2u);
294 EXPECT_EQ(tasks[0]->view_id, 1);
295 EXPECT_EQ(tasks[1]->view_id, 2);
296 });
297 EXPECT_EQ(status, PipelineConsumeResult::Done);
298 draw_latch.Signal();
299 }));
300 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
301 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
302 uint64_t frame_number) {
303 engine_context->EngineTaskSync([&](Engine& engine) {
304 engine.BeginFrame(frame_target_time, frame_number);
305 });
306 }));
307
308 native_latch.Reset();
309 AddNativeCallback("NotifyNative", [](auto args) { native_latch.Signal(); });
310
311 std::unique_ptr<Animator> animator;
312 PostSync(task_runners_.GetUITaskRunner(),
313 [&animator, &animator_delegate, &task_runners = task_runners_] {
314 animator = std::make_unique<Animator>(
315 animator_delegate, task_runners,
316 static_cast<std::unique_ptr<VsyncWaiter>>(
317 std::make_unique<testing::ConstantFiringVsyncWaiter>(
318 task_runners)));
319 });
320
321 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
322 std::move(animator));
323 auto configuration = RunConfiguration::InferFromSettings(settings_);
324 configuration.SetEntrypoint("onDrawFrameRenderAllViews");
325 engine_context->Run(std::move(configuration));
326
327 engine_context->EngineTaskSync([](Engine& engine) {
328 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
329 [](bool added) { ASSERT_TRUE(added); });
330 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
331 [](bool added) { ASSERT_TRUE(added); });
332 });
333
334 native_latch.Wait();
335
336 engine_context->EngineTaskSync(
337 [](Engine& engine) { engine.ScheduleFrame(); });
338 draw_latch.Wait();
339}
Settings settings_
TaskRunners task_runners_
MockDelegate delegate_

References args, delegate_, engine, fml::AutoResetWaitableEvent::Reset(), settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, view_id, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [5/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitPartialViewsForWarmUp   
)

Definition at line 605 of file engine_animator_unittests.cc.

605 {
606 MockAnimatorDelegate animator_delegate;
607 std::unique_ptr<EngineContext> engine_context;
608
609 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
610 std::make_shared<MockPlatformMessageHandler>();
611 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
612 .WillOnce(ReturnRef(platform_message_handler));
613
614 fml::AutoResetWaitableEvent continuation_ready_latch;
616 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
617 .WillOnce(
618 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
619 auto status =
620 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
621 auto tasks = Sorted(item->layer_tree_tasks);
622 EXPECT_EQ(tasks.size(), 2u);
623 EXPECT_EQ(tasks[0]->view_id, 1);
624 EXPECT_EQ(tasks[1]->view_id, 2);
625 });
626 EXPECT_EQ(status, PipelineConsumeResult::Done);
627 draw_latch.Signal();
628 }));
629 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
630 .WillRepeatedly(
631 Invoke([&engine_context, &continuation_ready_latch](
632 fml::TimePoint frame_target_time, uint64_t frame_number) {
633 continuation_ready_latch.Signal();
634 engine_context->EngineTaskSync([&](Engine& engine) {
635 engine.BeginFrame(frame_target_time, frame_number);
636 });
637 }));
638
639 std::unique_ptr<Animator> animator;
640 PostSync(task_runners_.GetUITaskRunner(),
641 [&animator, &animator_delegate, &task_runners = task_runners_] {
642 animator = std::make_unique<Animator>(
643 animator_delegate, task_runners,
644 static_cast<std::unique_ptr<VsyncWaiter>>(
645 std::make_unique<testing::ConstantFiringVsyncWaiter>(
646 task_runners)));
647 });
648
649 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
650 std::move(animator));
651
652 engine_context->EngineTaskSync([](Engine& engine) {
653 // Schedule a frame to make the animator create a continuation.
654 engine.ScheduleFrame(true);
655 // Add multiple views.
656 engine.AddView(0, ViewportMetrics{1, 10, 10, 22, 0},
657 [](bool added) { ASSERT_TRUE(added); });
658 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
659 [](bool added) { ASSERT_TRUE(added); });
660 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
661 [](bool added) { ASSERT_TRUE(added); });
662 });
663
664 continuation_ready_latch.Wait();
665
666 auto configuration = RunConfiguration::InferFromSettings(settings_);
667 configuration.SetEntrypoint("renderWarmUpView1and2");
668 engine_context->Run(std::move(configuration));
669
670 draw_latch.Wait();
671}

References delegate_, engine, settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, view_id, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [6/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitsImplicitViewBeforeDrawFrameEnds   
)

Definition at line 474 of file engine_animator_unittests.cc.

474 {
475 MockAnimatorDelegate animator_delegate;
476 std::unique_ptr<EngineContext> engine_context;
477
478 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
479 std::make_shared<MockPlatformMessageHandler>();
480 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
481 .WillOnce(ReturnRef(platform_message_handler));
482
483 bool rasterization_started = false;
484 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
485 .WillOnce(Invoke([&rasterization_started](
486 const std::shared_ptr<FramePipeline>& pipeline) {
487 rasterization_started = true;
488 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
489 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
490 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
491 });
492 EXPECT_EQ(status, PipelineConsumeResult::Done);
493 }));
494 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
495 .WillRepeatedly(Invoke([&engine_context](fml::TimePoint frame_target_time,
496 uint64_t frame_number) {
497 engine_context->EngineTaskSync([&](Engine& engine) {
498 engine.BeginFrame(frame_target_time, frame_number);
499 });
500 }));
501
502 std::unique_ptr<Animator> animator;
503 PostSync(task_runners_.GetUITaskRunner(),
504 [&animator, &animator_delegate, &task_runners = task_runners_] {
505 animator = std::make_unique<Animator>(
506 animator_delegate, task_runners,
507 static_cast<std::unique_ptr<VsyncWaiter>>(
508 std::make_unique<testing::ConstantFiringVsyncWaiter>(
509 task_runners)));
510 });
511
512 native_latch.Reset();
513 // The native_latch is signaled at the end of handleDrawFrame.
514 AddNativeCallback("NotifyNative",
515 CREATE_NATIVE_ENTRY([&rasterization_started](auto args) {
516 EXPECT_EQ(rasterization_started, true);
517 native_latch.Signal();
518 }));
519
520 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
521 std::move(animator));
522
523 engine_context->EngineTaskSync([](Engine& engine) {
524 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1.0, 10, 10, 1, 0},
525 [](bool added) { ASSERT_TRUE(added); });
526 });
527
528 auto configuration = RunConfiguration::InferFromSettings(settings_);
529 configuration.SetEntrypoint("renderSingleViewAndCallAfterOnDrawFrame");
530 engine_context->Run(std::move(configuration));
531
532 native_latch.Wait();
533}
#define CREATE_NATIVE_ENTRY(native_entry)

References args, CREATE_NATIVE_ENTRY, delegate_, engine, kFlutterImplicitViewId, fml::AutoResetWaitableEvent::Reset(), settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [7/19]

flutter::TEST_F ( EngineAnimatorTest  ,
AnimatorSubmitWarmUpImplicitView   
)

Definition at line 538 of file engine_animator_unittests.cc.

538 {
539 MockAnimatorDelegate animator_delegate;
540 std::unique_ptr<EngineContext> engine_context;
541
542 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
543 std::make_shared<MockPlatformMessageHandler>();
544 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
545 .WillOnce(ReturnRef(platform_message_handler));
546
547 fml::AutoResetWaitableEvent continuation_ready_latch;
549 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
550 .WillOnce(Invoke([&draw_latch](
551 const std::shared_ptr<FramePipeline>& pipeline) {
552 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
553 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
554 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
555 });
556 EXPECT_EQ(status, PipelineConsumeResult::Done);
557 draw_latch.Signal();
558 }));
559 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
560 .WillRepeatedly(
561 Invoke([&engine_context, &continuation_ready_latch](
562 fml::TimePoint frame_target_time, uint64_t frame_number) {
563 continuation_ready_latch.Signal();
564 engine_context->EngineTaskSync([&](Engine& engine) {
565 engine.BeginFrame(frame_target_time, frame_number);
566 });
567 }));
568
569 std::unique_ptr<Animator> animator;
570 PostSync(task_runners_.GetUITaskRunner(),
571 [&animator, &animator_delegate, &task_runners = task_runners_] {
572 animator = std::make_unique<Animator>(
573 animator_delegate, task_runners,
574 static_cast<std::unique_ptr<VsyncWaiter>>(
575 std::make_unique<testing::ConstantFiringVsyncWaiter>(
576 task_runners)));
577 });
578
579 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
580 std::move(animator));
581
582 engine_context->EngineTaskSync([](Engine& engine) {
583 // Schedule a frame to trigger Animator::BeginFrame to create a
584 // continuation. The continuation needs to be available before `Engine::Run`
585 // since the Dart program immediately schedules a warm up frame.
586 engine.ScheduleFrame(true);
587 // Add the implicit view so that the engine recognizes it and that its
588 // metrics is not empty.
589 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1.0, 10, 10, 1, 0},
590 [](bool added) { ASSERT_TRUE(added); });
591 });
592 continuation_ready_latch.Wait();
593
594 auto configuration = RunConfiguration::InferFromSettings(settings_);
595 configuration.SetEntrypoint("renderWarmUpImplicitView");
596 engine_context->Run(std::move(configuration));
597
598 draw_latch.Wait();
599}

References delegate_, engine, kFlutterImplicitViewId, settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [8/19]

flutter::TEST_F ( EngineAnimatorTest  ,
IgnoresDuplicateRenders   
)

Definition at line 398 of file engine_animator_unittests.cc.

398 {
399 MockAnimatorDelegate animator_delegate;
400 std::unique_ptr<EngineContext> engine_context;
401
402 std::vector<std::shared_ptr<Layer>> benchmark_layers;
403 auto capture_root_layer = [&benchmark_layers](Dart_NativeArguments args) {
404 auto handle = Dart_GetNativeArgument(args, 0);
405 intptr_t peer = 0;
406 Dart_Handle result = Dart_GetNativeInstanceField(
407 handle, tonic::DartWrappable::kPeerIndex, &peer);
408 ASSERT_FALSE(Dart_IsError(result));
409 SceneBuilder* scene_builder = reinterpret_cast<SceneBuilder*>(peer);
410 ASSERT_TRUE(scene_builder);
411 std::shared_ptr<ContainerLayer> root_layer =
412 scene_builder->layer_stack()[0];
413 ASSERT_TRUE(root_layer);
414 benchmark_layers = root_layer->layers();
415 };
416
417 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
418 std::make_shared<MockPlatformMessageHandler>();
419 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
420 .WillOnce(ReturnRef(platform_message_handler));
422 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
423 .WillOnce(Invoke([&draw_latch, &benchmark_layers](
424 const std::shared_ptr<FramePipeline>& pipeline) {
425 auto status = pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
426 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
427 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, kFlutterImplicitViewId);
428 ContainerLayer* root_layer = reinterpret_cast<ContainerLayer*>(
429 item->layer_tree_tasks[0]->layer_tree->root_layer());
430 std::vector<std::shared_ptr<Layer>> result_layers =
431 root_layer->layers();
432 EXPECT_EQ(result_layers.size(), benchmark_layers.size());
433 EXPECT_EQ(result_layers[0], benchmark_layers[0]);
434 });
435 EXPECT_EQ(status, PipelineConsumeResult::Done);
436 draw_latch.Signal();
437 }));
438 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
439 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
440 uint64_t frame_number) {
441 engine_context->EngineTaskSync([&](Engine& engine) {
442 engine.BeginFrame(frame_target_time, frame_number);
443 });
444 }));
445
446 AddNativeCallback("CaptureRootLayer",
447 CREATE_NATIVE_ENTRY(capture_root_layer));
448
449 std::unique_ptr<Animator> animator;
450 PostSync(task_runners_.GetUITaskRunner(),
451 [&animator, &animator_delegate, &task_runners = task_runners_] {
452 animator = std::make_unique<Animator>(
453 animator_delegate, task_runners,
454 static_cast<std::unique_ptr<VsyncWaiter>>(
455 std::make_unique<testing::ConstantFiringVsyncWaiter>(
456 task_runners)));
457 });
458
459 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
460 std::move(animator));
461
462 engine_context->EngineTaskSync([](Engine& engine) {
463 engine.AddView(kFlutterImplicitViewId, ViewportMetrics{1, 10, 10, 22, 0},
464 [](bool added) { ASSERT_TRUE(added); });
465 });
466
467 auto configuration = RunConfiguration::InferFromSettings(settings_);
468 configuration.SetEntrypoint("renderTwiceForOneView");
469 engine_context->Run(std::move(configuration));
470
471 draw_latch.Wait();
472}
const std::vector< std::shared_ptr< ContainerLayer > > & layer_stack()

References args, CREATE_NATIVE_ENTRY, delegate_, engine, kFlutterImplicitViewId, tonic::DartWrappable::kPeerIndex, flutter::SceneBuilder::layer_stack(), flutter::ContainerLayer::layers(), settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [9/19]

flutter::TEST_F ( EngineAnimatorTest  ,
IgnoresOutOfFrameRenders   
)

Definition at line 341 of file engine_animator_unittests.cc.

341 {
342 MockAnimatorDelegate animator_delegate;
343 std::unique_ptr<EngineContext> engine_context;
344
345 std::shared_ptr<PlatformMessageHandler> platform_message_handler =
346 std::make_shared<MockPlatformMessageHandler>();
347 EXPECT_CALL(delegate_, GetPlatformMessageHandler)
348 .WillOnce(ReturnRef(platform_message_handler));
350 EXPECT_CALL(animator_delegate, OnAnimatorDraw)
351 .WillOnce(
352 Invoke([&draw_latch](const std::shared_ptr<FramePipeline>& pipeline) {
353 auto status =
354 pipeline->Consume([&](std::unique_ptr<FrameItem> item) {
355 // View 1 is rendered before the frame, and is ignored.
356 // View 2 is rendered within the frame, and is accepted.
357 EXPECT_EQ(item->layer_tree_tasks.size(), 1u);
358 EXPECT_EQ(item->layer_tree_tasks[0]->view_id, 2);
359 });
360 EXPECT_EQ(status, PipelineConsumeResult::Done);
361 draw_latch.Signal();
362 }));
363 EXPECT_CALL(animator_delegate, OnAnimatorBeginFrame)
364 .WillOnce(Invoke([&engine_context](fml::TimePoint frame_target_time,
365 uint64_t frame_number) {
366 engine_context->EngineTaskSync([&](Engine& engine) {
367 engine.BeginFrame(frame_target_time, frame_number);
368 });
369 }));
370
371 std::unique_ptr<Animator> animator;
372 PostSync(task_runners_.GetUITaskRunner(),
373 [&animator, &animator_delegate, &task_runners = task_runners_] {
374 animator = std::make_unique<Animator>(
375 animator_delegate, task_runners,
376 static_cast<std::unique_ptr<VsyncWaiter>>(
377 std::make_unique<testing::ConstantFiringVsyncWaiter>(
378 task_runners)));
379 });
380
381 engine_context = EngineContext::Create(delegate_, settings_, task_runners_,
382 std::move(animator));
383
384 engine_context->EngineTaskSync([](Engine& engine) {
385 engine.AddView(1, ViewportMetrics{1, 10, 10, 22, 0},
386 [](bool added) { ASSERT_TRUE(added); });
387 engine.AddView(2, ViewportMetrics{1, 10, 10, 22, 0},
388 [](bool added) { ASSERT_TRUE(added); });
389 });
390
391 auto configuration = RunConfiguration::InferFromSettings(settings_);
392 configuration.SetEntrypoint("renderViewsInFrameAndOutOfFrame");
393 engine_context->Run(std::move(configuration));
394
395 draw_latch.Wait();
396}

References delegate_, engine, settings_, fml::AutoResetWaitableEvent::Signal(), task_runners_, and fml::AutoResetWaitableEvent::Wait().

◆ TEST_F() [10/19]

flutter::TEST_F ( EngineTest  ,
Create   
)

Definition at line 253 of file engine_unittests.cc.

253 {
254 PostUITaskSync([this] {
255 auto engine = std::make_unique<Engine>(
256 /*delegate=*/delegate_,
257 /*dispatcher_maker=*/dispatcher_maker_,
258 /*image_decoder_task_runner=*/image_decoder_task_runner_,
259 /*task_runners=*/task_runners_,
260 /*settings=*/settings_,
261 /*animator=*/std::move(animator_),
262 /*io_manager=*/io_manager_,
263 /*font_collection=*/std::make_shared<FontCollection>(),
264 /*runtime_controller=*/std::move(runtime_controller_),
265 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
266 EXPECT_TRUE(engine);
267 });
268}
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_

References animator_, delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, runtime_controller_, settings_, and task_runners_.

◆ TEST_F() [11/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageInitialRoute   
)

Definition at line 297 of file engine_unittests.cc.

297 {
298 PostUITaskSync([this] {
299 MockRuntimeDelegate client;
300 auto mock_runtime_controller =
301 std::make_unique<MockRuntimeController>(client, task_runners_);
302 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
303 .WillRepeatedly(::testing::Return(false));
304 auto engine = std::make_unique<Engine>(
305 /*delegate=*/delegate_,
306 /*dispatcher_maker=*/dispatcher_maker_,
307 /*image_decoder_task_runner=*/image_decoder_task_runner_,
308 /*task_runners=*/task_runners_,
309 /*settings=*/settings_,
310 /*animator=*/std::move(animator_),
311 /*io_manager=*/io_manager_,
312 /*font_collection=*/std::make_shared<FontCollection>(),
313 /*runtime_controller=*/std::move(mock_runtime_controller),
314 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
315
317 fml::MakeRefCounted<MockResponse>();
318 std::map<std::string, std::string> values{
319 {"method", "setInitialRoute"},
320 {"args", "test_initial_route"},
321 };
322 std::unique_ptr<PlatformMessage> message =
323 MakePlatformMessage("flutter/navigation", values, response);
324 engine->DispatchPlatformMessage(std::move(message));
325 EXPECT_EQ(engine->InitialRoute(), "test_initial_route");
326 });
327}

References animator_, delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, message, settings_, and task_runners_.

◆ TEST_F() [12/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageInitialRouteIgnored   
)

Definition at line 329 of file engine_unittests.cc.

329 {
330 PostUITaskSync([this] {
331 MockRuntimeDelegate client;
332 auto mock_runtime_controller =
333 std::make_unique<MockRuntimeController>(client, task_runners_);
334 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
335 .WillRepeatedly(::testing::Return(true));
336 EXPECT_CALL(*mock_runtime_controller, DispatchPlatformMessage(::testing::_))
337 .WillRepeatedly(::testing::Return(true));
338 auto engine = std::make_unique<Engine>(
339 /*delegate=*/delegate_,
340 /*dispatcher_maker=*/dispatcher_maker_,
341 /*image_decoder_task_runner=*/image_decoder_task_runner_,
342 /*task_runners=*/task_runners_,
343 /*settings=*/settings_,
344 /*animator=*/std::move(animator_),
345 /*io_manager=*/io_manager_,
346 /*font_collection=*/std::make_shared<FontCollection>(),
347 /*runtime_controller=*/std::move(mock_runtime_controller),
348 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
349
351 fml::MakeRefCounted<MockResponse>();
352 std::map<std::string, std::string> values{
353 {"method", "setInitialRoute"},
354 {"args", "test_initial_route"},
355 };
356 std::unique_ptr<PlatformMessage> message =
357 MakePlatformMessage("flutter/navigation", values, response);
358 engine->DispatchPlatformMessage(std::move(message));
359 EXPECT_EQ(engine->InitialRoute(), "");
360 });
361}

References animator_, delegate_, dispatcher_maker_, DispatchPlatformMessage(), engine, image_decoder_task_runner_, io_manager_, message, settings_, and task_runners_.

◆ TEST_F() [13/19]

flutter::TEST_F ( EngineTest  ,
DispatchPlatformMessageUnknown   
)

Definition at line 270 of file engine_unittests.cc.

270 {
271 PostUITaskSync([this] {
272 MockRuntimeDelegate client;
273 auto mock_runtime_controller =
274 std::make_unique<MockRuntimeController>(client, task_runners_);
275 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
276 .WillRepeatedly(::testing::Return(false));
277 auto engine = std::make_unique<Engine>(
278 /*delegate=*/delegate_,
279 /*dispatcher_maker=*/dispatcher_maker_,
280 /*image_decoder_task_runner=*/image_decoder_task_runner_,
281 /*task_runners=*/task_runners_,
282 /*settings=*/settings_,
283 /*animator=*/std::move(animator_),
284 /*io_manager=*/io_manager_,
285 /*font_collection=*/std::make_shared<FontCollection>(),
286 /*runtime_controller=*/std::move(mock_runtime_controller),
287 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
288
290 fml::MakeRefCounted<MockResponse>();
291 std::unique_ptr<PlatformMessage> message =
292 std::make_unique<PlatformMessage>("foo", response);
293 engine->DispatchPlatformMessage(std::move(message));
294 });
295}

References animator_, delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, message, settings_, and task_runners_.

◆ TEST_F() [14/19]

flutter::TEST_F ( EngineTest  ,
PassesLoadDartDeferredLibraryErrorToRuntime   
)

Definition at line 456 of file engine_unittests.cc.

456 {
457 PostUITaskSync([this] {
458 intptr_t error_id = 123;
459 const std::string error_message = "error message";
460 MockRuntimeDelegate client;
461 auto mock_runtime_controller =
462 std::make_unique<MockRuntimeController>(client, task_runners_);
463 EXPECT_CALL(*mock_runtime_controller, IsRootIsolateRunning())
464 .WillRepeatedly(::testing::Return(true));
465 EXPECT_CALL(*mock_runtime_controller,
466 LoadDartDeferredLibraryError(error_id, error_message, true))
467 .Times(1);
468 auto engine = std::make_unique<Engine>(
469 /*delegate=*/delegate_,
470 /*dispatcher_maker=*/dispatcher_maker_,
471 /*image_decoder_task_runner=*/image_decoder_task_runner_,
472 /*task_runners=*/task_runners_,
473 /*settings=*/settings_,
474 /*animator=*/std::move(animator_),
475 /*io_manager=*/io_manager_,
476 /*font_collection=*/std::make_shared<FontCollection>(),
477 /*runtime_controller=*/std::move(mock_runtime_controller),
478 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
479
480 engine->LoadDartDeferredLibraryError(error_id, error_message, true);
481 });
482}

References animator_, delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, settings_, and task_runners_.

◆ TEST_F() [15/19]

flutter::TEST_F ( EngineTest  ,
SpawnedEngineInheritsAssetManager   
)

Definition at line 484 of file engine_unittests.cc.

484 {
485 PostUITaskSync([this] {
486 MockRuntimeDelegate client;
487 auto mock_runtime_controller =
488 std::make_unique<MockRuntimeController>(client, task_runners_);
489 auto vm_ref = DartVMRef::Create(settings_);
490 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
491 .WillRepeatedly(::testing::Return(vm_ref.get()));
492
493 // auto mock_font_collection = std::make_shared<MockFontCollection>();
494 // EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
495 // .WillOnce(::testing::Return());
496 auto engine = std::make_unique<Engine>(
497 /*delegate=*/delegate_,
498 /*dispatcher_maker=*/dispatcher_maker_,
499 /*image_decoder_task_runner=*/image_decoder_task_runner_,
500 /*task_runners=*/task_runners_,
501 /*settings=*/settings_,
502 /*animator=*/std::move(animator_),
503 /*io_manager=*/io_manager_,
504 /*font_collection=*/std::make_shared<FontCollection>(),
505 /*runtime_controller=*/std::move(mock_runtime_controller),
506 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
507
508 EXPECT_EQ(engine->GetAssetManager(), nullptr);
509
510 auto asset_manager = std::make_shared<AssetManager>();
511 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
512 engine->UpdateAssetManager(asset_manager);
513 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
514
515 auto spawn =
517 std::string(), io_manager_, snapshot_delegate_, nullptr);
518 EXPECT_TRUE(spawn != nullptr);
519 EXPECT_EQ(engine->GetAssetManager(), spawn->GetAssetManager());
520 });
521}
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate_

References animator_, flutter::DartVMRef::Create(), delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, settings_, snapshot_delegate_, and task_runners_.

◆ TEST_F() [16/19]

flutter::TEST_F ( EngineTest  ,
SpawnSharesFontLibrary   
)

Definition at line 363 of file engine_unittests.cc.

363 {
364 PostUITaskSync([this] {
365 MockRuntimeDelegate client;
366 auto mock_runtime_controller =
367 std::make_unique<MockRuntimeController>(client, task_runners_);
368 auto vm_ref = DartVMRef::Create(settings_);
369 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
370 .WillRepeatedly(::testing::Return(vm_ref.get()));
371 auto engine = std::make_unique<Engine>(
372 /*delegate=*/delegate_,
373 /*dispatcher_maker=*/dispatcher_maker_,
374 /*image_decoder_task_runner=*/image_decoder_task_runner_,
375 /*task_runners=*/task_runners_,
376 /*settings=*/settings_,
377 /*animator=*/std::move(animator_),
378 /*io_manager=*/io_manager_,
379 /*font_collection=*/std::make_shared<FontCollection>(),
380 /*runtime_controller=*/std::move(mock_runtime_controller),
381 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
382
383 auto spawn =
385 std::string(), io_manager_, snapshot_delegate_, nullptr);
386 EXPECT_TRUE(spawn != nullptr);
387 EXPECT_EQ(&engine->GetFontCollection(), &spawn->GetFontCollection());
388 });
389}

References animator_, flutter::DartVMRef::Create(), delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, settings_, snapshot_delegate_, and task_runners_.

◆ TEST_F() [17/19]

flutter::TEST_F ( EngineTest  ,
SpawnWithCustomInitialRoute   
)

Definition at line 391 of file engine_unittests.cc.

391 {
392 PostUITaskSync([this] {
393 MockRuntimeDelegate client;
394 auto mock_runtime_controller =
395 std::make_unique<MockRuntimeController>(client, task_runners_);
396 auto vm_ref = DartVMRef::Create(settings_);
397 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
398 .WillRepeatedly(::testing::Return(vm_ref.get()));
399 auto engine = std::make_unique<Engine>(
400 /*delegate=*/delegate_,
401 /*dispatcher_maker=*/dispatcher_maker_,
402 /*image_decoder_task_runner=*/image_decoder_task_runner_,
403 /*task_runners=*/task_runners_,
404 /*settings=*/settings_,
405 /*animator=*/std::move(animator_),
406 /*io_manager=*/io_manager_,
407 /*font_collection=*/std::make_shared<FontCollection>(),
408 /*runtime_controller=*/std::move(mock_runtime_controller),
409 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
410
411 auto spawn =
412 engine->Spawn(delegate_, dispatcher_maker_, settings_, nullptr, "/foo",
414 EXPECT_TRUE(spawn != nullptr);
415 ASSERT_EQ("/foo", spawn->InitialRoute());
416 });
417}

References animator_, flutter::DartVMRef::Create(), delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, settings_, snapshot_delegate_, and task_runners_.

◆ TEST_F() [18/19]

flutter::TEST_F ( EngineTest  ,
SpawnWithCustomSettings   
)

Definition at line 419 of file engine_unittests.cc.

419 {
420 PostUITaskSync([this] {
421 MockRuntimeDelegate client;
422 auto mock_runtime_controller =
423 std::make_unique<MockRuntimeController>(client, task_runners_);
424 auto vm_ref = DartVMRef::Create(settings_);
425 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
426 .WillRepeatedly(::testing::Return(vm_ref.get()));
427 auto engine = std::make_unique<Engine>(
428 /*delegate=*/delegate_,
429 /*dispatcher_maker=*/dispatcher_maker_,
430 /*image_decoder_task_runner=*/image_decoder_task_runner_,
431 /*task_runners=*/task_runners_,
432 /*settings=*/settings_,
433 /*animator=*/std::move(animator_),
434 /*io_manager=*/io_manager_,
435 /*font_collection=*/std::make_shared<FontCollection>(),
436 /*runtime_controller=*/std::move(mock_runtime_controller),
437 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
438
439 Settings custom_settings = settings_;
440 custom_settings.persistent_isolate_data =
441 std::make_shared<fml::DataMapping>("foo");
442 auto spawn =
443 engine->Spawn(delegate_, dispatcher_maker_, custom_settings, nullptr,
444 std::string(), io_manager_, snapshot_delegate_, nullptr);
445 EXPECT_TRUE(spawn != nullptr);
446 auto new_persistent_isolate_data =
447 const_cast<RuntimeController*>(spawn->GetRuntimeController())
448 ->GetPersistentIsolateData();
449 EXPECT_EQ(custom_settings.persistent_isolate_data->GetMapping(),
450 new_persistent_isolate_data->GetMapping());
451 EXPECT_EQ(custom_settings.persistent_isolate_data->GetSize(),
452 new_persistent_isolate_data->GetSize());
453 });
454}
std::shared_ptr< const fml::Mapping > persistent_isolate_data
Definition settings.h:345

References animator_, flutter::DartVMRef::Create(), delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, flutter::Settings::persistent_isolate_data, settings_, snapshot_delegate_, and task_runners_.

◆ TEST_F() [19/19]

flutter::TEST_F ( EngineTest  ,
UpdateAssetManagerWithEqualManagers   
)

Definition at line 523 of file engine_unittests.cc.

523 {
524 PostUITaskSync([this] {
525 MockRuntimeDelegate client;
526 auto mock_runtime_controller =
527 std::make_unique<MockRuntimeController>(client, task_runners_);
528 auto vm_ref = DartVMRef::Create(settings_);
529 EXPECT_CALL(*mock_runtime_controller, GetDartVM())
530 .WillRepeatedly(::testing::Return(vm_ref.get()));
531
532 auto mock_font_collection = std::make_shared<MockFontCollection>();
533 EXPECT_CALL(*mock_font_collection, RegisterFonts(::testing::_))
534 .WillOnce(::testing::Return());
535 auto engine = std::make_unique<Engine>(
536 /*delegate=*/delegate_,
537 /*dispatcher_maker=*/dispatcher_maker_,
538 /*image_decoder_task_runner=*/image_decoder_task_runner_,
539 /*task_runners=*/task_runners_,
540 /*settings=*/settings_,
541 /*animator=*/std::move(animator_),
542 /*io_manager=*/io_manager_,
543 /*font_collection=*/mock_font_collection,
544 /*runtime_controller=*/std::move(mock_runtime_controller),
545 /*gpu_disabled_switch=*/std::make_shared<fml::SyncSwitch>());
546
547 EXPECT_EQ(engine->GetAssetManager(), nullptr);
548
549 auto asset_manager = std::make_shared<AssetManager>();
550 asset_manager->PushBack(std::make_unique<FontManifestAssetResolver>());
551
552 auto asset_manager_2 = std::make_shared<AssetManager>();
553 asset_manager_2->PushBack(std::make_unique<FontManifestAssetResolver>());
554
555 EXPECT_NE(asset_manager, asset_manager_2);
556 EXPECT_TRUE(*asset_manager == *asset_manager_2);
557
558 engine->UpdateAssetManager(asset_manager);
559 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
560
561 engine->UpdateAssetManager(asset_manager_2);
562 // Didn't change because they're equivalent.
563 EXPECT_EQ(engine->GetAssetManager(), asset_manager);
564 });
565}

References animator_, flutter::DartVMRef::Create(), delegate_, dispatcher_maker_, engine, image_decoder_task_runner_, io_manager_, settings_, and task_runners_.

◆ ThreadExitCallback()

void flutter::ThreadExitCallback ( )

Definition at line 152 of file dart_vm.cc.

152{}

◆ ToApproximateSkRRect()

◆ ToDlIRect()

◆ ToDlISize()

◆ ToDlMatrix() [1/3]

DlMatrix flutter::ToDlMatrix ( const SkM44 &  matrix)
inline

Definition at line 72 of file dl_geometry_conversions.h.

72 {
73 DlMatrix dl_matrix;
74 matrix.getColMajor(dl_matrix.m);
75 return dl_matrix;
76}

References impeller::Matrix::m.

◆ ToDlMatrix() [2/3]

DlMatrix flutter::ToDlMatrix ( const SkMatrix &  matrix)
inline

Definition at line 61 of file dl_geometry_conversions.h.

61 {
62 // clang-format off
63 return DlMatrix::MakeColumn(
64 matrix[SkMatrix::kMScaleX], matrix[SkMatrix::kMSkewY], 0.0f, matrix[SkMatrix::kMPersp0],
65 matrix[SkMatrix::kMSkewX], matrix[SkMatrix::kMScaleY], 0.0f, matrix[SkMatrix::kMPersp1],
66 0.0f, 0.0f, 1.0f, 0.0f,
67 matrix[SkMatrix::kMTransX], matrix[SkMatrix::kMTransY], 0.0f, matrix[SkMatrix::kMPersp2]
68 );
69 // clang-format on
70}

References impeller::Matrix::MakeColumn().

Referenced by flutter::testing::MockRasterCache::AddMockPicture(), flutter::SurfaceTextureExternalTexture::DrawFrame(), flutter::DlSkCanvasAdapter::GetMatrix(), flutter::CanvasGradient::initLinear(), flutter::ImageFilter::initMatrix(), flutter::CanvasGradient::initRadial(), flutter::CanvasGradient::initSweep(), flutter::CanvasGradient::initTwoPointConical(), flutter::ImageShader::initWithImage(), flutter::SceneBuilder::pushTransform(), flutter::RasterCache::Rasterize(), flutter::testing::SkJobRenderer::Render(), and flutter::testing::TEST().

◆ ToDlMatrix() [3/3]

DlMatrix flutter::ToDlMatrix ( const tonic::Float64List &  matrix4)

Definition at line 46 of file matrix.cc.

46 {
47 FML_DCHECK(matrix4.data());
48 // clang-format off
49 return DlMatrix::MakeColumn(
50 SafeNarrow(matrix4[ 0]), SafeNarrow(matrix4[ 1]), SafeNarrow(matrix4[ 2]), SafeNarrow(matrix4[ 3]),
51 SafeNarrow(matrix4[ 4]), SafeNarrow(matrix4[ 5]), SafeNarrow(matrix4[ 6]), SafeNarrow(matrix4[ 7]),
52 SafeNarrow(matrix4[ 8]), SafeNarrow(matrix4[ 9]), SafeNarrow(matrix4[10]), SafeNarrow(matrix4[11]),
53 SafeNarrow(matrix4[12]), SafeNarrow(matrix4[13]), SafeNarrow(matrix4[14]), SafeNarrow(matrix4[15])
54 );
55 // clang-format on
56}

References FML_DCHECK, impeller::Matrix::MakeColumn(), and SafeNarrow().

◆ ToDlPoint()

const DlPoint & flutter::ToDlPoint ( const SkPoint &  point)
inline

Definition at line 26 of file dl_geometry_conversions.h.

26 {
27 return *reinterpret_cast<const DlPoint*>(&point);
28}

Referenced by flutter::DlPath::Dispatch(), flutter::DlPath::IsLine(), and flutter::testing::TEST().

◆ ToDlRect() [1/2]

const DlRect flutter::ToDlRect ( const SkIRect &  rect)
inline

Definition at line 34 of file dl_geometry_conversions.h.

34 {
35 return DlRect::MakeLTRB(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
36}

References impeller::TRect< Scalar >::MakeLTRB().

◆ ToDlRect() [2/2]

◆ ToDlRoundRect()

const DlRoundRect flutter::ToDlRoundRect ( const SkRRect &  rrect)
inline

Definition at line 50 of file dl_geometry_conversions.h.

50 {
51 return DlRoundRect::MakeRectRadii(
52 ToDlRect(rrect.rect()),
53 {
54 .top_left = ToDlSize(rrect.radii(SkRRect::kUpperLeft_Corner)),
55 .top_right = ToDlSize(rrect.radii(SkRRect::kUpperRight_Corner)),
56 .bottom_left = ToDlSize(rrect.radii(SkRRect::kLowerLeft_Corner)),
57 .bottom_right = ToDlSize(rrect.radii(SkRRect::kLowerRight_Corner)),
58 });
59}
const DlRect & ToDlRect(const SkRect &rect)

References impeller::RoundRect::MakeRectRadii(), and ToDlRect().

Referenced by flutter::DlPath::IsRoundRect().

◆ ToDlSize()

const DlSize & flutter::ToDlSize ( const SkVector &  vector)
inline

Definition at line 46 of file dl_geometry_conversions.h.

46 {
47 return *reinterpret_cast<const DlSize*>(&vector);
48}

Referenced by flutter::testing::TEST().

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

◆ ToMatrix4()

tonic::Float64List flutter::ToMatrix4 ( const SkMatrix &  sk_matrix)

Definition at line 58 of file matrix.cc.

58 {
59 tonic::Float64List matrix4(Dart_NewTypedData(Dart_TypedData_kFloat64, 16));
60 for (int i = 0; i < 9; ++i) {
62 }
63 matrix4[10] = 1.0; // Identity along the z axis.
64 return matrix4;
65}
SkMatrix sk_matrix
static const int kSkMatrixIndexToMatrix4Index[]
Definition matrix.cc:13

References i, kSkMatrixIndexToMatrix4Index, and sk_matrix.

◆ ToNonShaderSk()

SkPaint flutter::ToNonShaderSk ( const DlPaint paint)

Definition at line 67 of file dl_sk_conversions.cc.

67 {
68 DlPaint non_shader_paint = paint;
69 non_shader_paint.setColorSource(nullptr);
70 return ToSk(non_shader_paint);
71}
SkPaint ToSk(const DlPaint &paint)

References flutter::DlPaint::setColorSource(), and ToSk().

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

◆ ToOptSkIRect()

std::optional< const SkIRect > flutter::ToOptSkIRect ( std::optional< const DlIRect rect)
inline

Definition at line 98 of file dl_geometry_conversions.h.

99 {
100 return rect.has_value() ? std::optional(ToSkIRect(*rect)) : std::nullopt;
101}
const SkIRect & ToSkIRect(const DlIRect &rect)
Definition ref_ptr.h:261

References ToSkIRect().

◆ ToSk() [1/28]

SkBlurStyle flutter::ToSk ( const DlBlurStyle  blur_style)
inline

Definition at line 52 of file dl_sk_conversions.h.

52 {
53 return static_cast<SkBlurStyle>(blur_style);
54}

◆ ToSk() [2/28]

sk_sp< SkColorFilter > flutter::ToSk ( const DlColorFilter filter)
inline

Definition at line 111 of file dl_sk_conversions.h.

111 {
112 return ToSk(&filter);
113}

References ToSk().

◆ ToSk() [3/28]

sk_sp< SkColorFilter > flutter::ToSk ( const DlColorFilter filter)

Definition at line 244 of file dl_sk_conversions.cc.

244 {
245 if (!filter) {
246 return nullptr;
247 }
248 switch (filter->type()) {
249 case DlColorFilterType::kBlend: {
250 const DlBlendColorFilter* blend_filter = filter->asBlend();
251 FML_DCHECK(blend_filter != nullptr);
252 return SkColorFilters::Blend(ToSkColor4f(blend_filter->color()), nullptr,
253 ToSk(blend_filter->mode()));
254 }
255 case DlColorFilterType::kMatrix: {
256 const DlMatrixColorFilter* matrix_filter = filter->asMatrix();
257 FML_DCHECK(matrix_filter != nullptr);
258 float matrix[20];
259 matrix_filter->get_matrix(matrix);
260 return SkColorFilters::Matrix(matrix);
261 }
262 case DlColorFilterType::kSrgbToLinearGamma: {
263 return SkColorFilters::SRGBToLinearGamma();
264 }
265 case DlColorFilterType::kLinearToSrgbGamma: {
266 return SkColorFilters::LinearToSRGBGamma();
267 }
268 }
269}
virtual T type() const =0
virtual const DlBlendColorFilter * asBlend() const
virtual const DlMatrixColorFilter * asMatrix() const

References flutter::DlColorFilter::asBlend(), flutter::DlColorFilter::asMatrix(), flutter::DlBlendColorFilter::color(), FML_DCHECK, flutter::DlMatrixColorFilter::get_matrix(), kBlend, kLinearToSrgbGamma, kMatrix, kSrgbToLinearGamma, flutter::DlBlendColorFilter::mode(), ToSk(), ToSkColor4f(), and flutter::DlAttribute< D, T >::type().

◆ ToSk() [4/28]

sk_sp< SkShader > flutter::ToSk ( const DlColorSource source)
inline

Definition at line 94 of file dl_sk_conversions.h.

94 {
95 return ToSk(&source);
96}

References ToSk().

◆ ToSk() [5/28]

sk_sp< SkShader > flutter::ToSk ( const DlColorSource source)

Definition at line 73 of file dl_sk_conversions.cc.

73 {
74 if (!source) {
75 return nullptr;
76 }
77 SkMatrix scratch;
78 static auto ToSkColors =
79 [](const DlGradientColorSourceBase* gradient) -> std::vector<SkColor> {
80 std::vector<SkColor> sk_colors;
81 sk_colors.reserve(gradient->stop_count());
82 for (int i = 0; i < gradient->stop_count(); ++i) {
83 sk_colors.push_back(gradient->colors()[i].argb());
84 }
85 return sk_colors;
86 };
87 switch (source->type()) {
88 case DlColorSourceType::kImage: {
89 const DlImageColorSource* image_source = source->asImage();
90 FML_DCHECK(image_source != nullptr);
91 auto image = image_source->image();
92 if (!image || !image->skia_image()) {
93 return nullptr;
94 }
95 return image->skia_image()->makeShader(
96 ToSk(image_source->horizontal_tile_mode()),
97 ToSk(image_source->vertical_tile_mode()),
98 ToSk(image_source->sampling()),
99 ToSk(image_source->matrix_ptr(), scratch));
100 }
101 case DlColorSourceType::kLinearGradient: {
102 const DlLinearGradientColorSource* linear_source =
103 source->asLinearGradient();
104 FML_DCHECK(linear_source != nullptr);
105 SkPoint pts[] = {ToSkPoint(linear_source->start_point()),
106 ToSkPoint(linear_source->end_point())};
107 std::vector<SkColor> skcolors = ToSkColors(linear_source);
108 return SkGradientShader::MakeLinear(
109 pts, skcolors.data(), linear_source->stops(),
110 linear_source->stop_count(), ToSk(linear_source->tile_mode()), 0,
111 ToSk(linear_source->matrix_ptr(), scratch));
112 }
113 case DlColorSourceType::kRadialGradient: {
114 const DlRadialGradientColorSource* radial_source =
115 source->asRadialGradient();
116 FML_DCHECK(radial_source != nullptr);
117 return SkGradientShader::MakeRadial(
118 ToSkPoint(radial_source->center()), radial_source->radius(),
119 ToSkColors(radial_source).data(), radial_source->stops(),
120 radial_source->stop_count(), ToSk(radial_source->tile_mode()), 0,
121 ToSk(radial_source->matrix_ptr(), scratch));
122 }
123 case DlColorSourceType::kConicalGradient: {
124 const DlConicalGradientColorSource* conical_source =
125 source->asConicalGradient();
126 FML_DCHECK(conical_source != nullptr);
127 return SkGradientShader::MakeTwoPointConical(
128 ToSkPoint(conical_source->start_center()),
129 conical_source->start_radius(),
130 ToSkPoint(conical_source->end_center()), conical_source->end_radius(),
131 ToSkColors(conical_source).data(), conical_source->stops(),
132 conical_source->stop_count(), ToSk(conical_source->tile_mode()), 0,
133 ToSk(conical_source->matrix_ptr(), scratch));
134 }
135 case DlColorSourceType::kSweepGradient: {
136 const DlSweepGradientColorSource* sweep_source =
137 source->asSweepGradient();
138 FML_DCHECK(sweep_source != nullptr);
139 return SkGradientShader::MakeSweep(
140 sweep_source->center().x, sweep_source->center().y,
141 ToSkColors(sweep_source).data(), sweep_source->stops(),
142 sweep_source->stop_count(), ToSk(sweep_source->tile_mode()),
143 sweep_source->start(), sweep_source->end(), 0,
144 ToSk(sweep_source->matrix_ptr(), scratch));
145 }
146 case DlColorSourceType::kRuntimeEffect: {
147 const DlRuntimeEffectColorSource* runtime_source =
148 source->asRuntimeEffect();
149 FML_DCHECK(runtime_source != nullptr);
150 auto runtime_effect = runtime_source->runtime_effect();
151 if (!runtime_effect || !runtime_effect->skia_runtime_effect()) {
152 return nullptr;
153 }
154
155 auto samplers = runtime_source->samplers();
156 std::vector<sk_sp<SkShader>> sk_samplers(samplers.size());
157 for (size_t i = 0; i < samplers.size(); i++) {
158 const auto& sampler = samplers[i];
159 if (sampler == nullptr) {
160 return nullptr;
161 }
162 sk_samplers[i] = ToSk(sampler);
163 }
164
165 auto uniform_data = runtime_source->uniform_data();
166 auto ref = new std::shared_ptr<std::vector<uint8_t>>(uniform_data);
167 auto sk_uniform_data = SkData::MakeWithProc(
168 uniform_data->data(), uniform_data->size(),
169 [](const void* ptr, void* context) {
170 delete reinterpret_cast<std::shared_ptr<std::vector<uint8_t>>*>(
171 context);
172 },
173 ref);
174
175 return runtime_effect->skia_runtime_effect()->makeShader(
176 sk_uniform_data, sk_samplers.data(), sk_samplers.size());
177 }
178 }
179}
virtual const DlRuntimeEffectColorSource * asRuntimeEffect() const
virtual const DlRadialGradientColorSource * asRadialGradient() const
virtual const DlLinearGradientColorSource * asLinearGradient() const
virtual const DlImageColorSource * asImage() const
virtual const DlSweepGradientColorSource * asSweepGradient() const
virtual const DlConicalGradientColorSource * asConicalGradient() const
const SkPoint & ToSkPoint(const DlPoint &point)
FlutterVulkanImageHandle image
Definition embedder.h:931

References flutter::DlColorSource::asConicalGradient(), flutter::DlColorSource::asImage(), flutter::DlColorSource::asLinearGradient(), flutter::DlColorSource::asRadialGradient(), flutter::DlColorSource::asRuntimeEffect(), flutter::DlColorSource::asSweepGradient(), flutter::DlRadialGradientColorSource::center(), flutter::DlSweepGradientColorSource::center(), data, flutter::DlSweepGradientColorSource::end(), flutter::DlConicalGradientColorSource::end_center(), flutter::DlLinearGradientColorSource::end_point(), flutter::DlConicalGradientColorSource::end_radius(), FML_DCHECK, flutter::DlImageColorSource::horizontal_tile_mode(), i, flutter::DlImageColorSource::image(), image, kConicalGradient, kImage, kLinearGradient, kRadialGradient, kRuntimeEffect, kSweepGradient, flutter::DlMatrixColorSourceBase::matrix_ptr(), flutter::DlRadialGradientColorSource::radius(), flutter::DlRuntimeEffectColorSource::runtime_effect(), flutter::DlRuntimeEffectColorSource::samplers(), flutter::DlImageColorSource::sampling(), flutter::DlSweepGradientColorSource::start(), flutter::DlConicalGradientColorSource::start_center(), flutter::DlLinearGradientColorSource::start_point(), flutter::DlConicalGradientColorSource::start_radius(), flutter::DlGradientColorSourceBase::stop_count(), flutter::DlGradientColorSourceBase::stops(), flutter::DlGradientColorSourceBase::tile_mode(), ToSk(), ToSkPoint(), flutter::DlAttribute< D, T >::type(), flutter::DlRuntimeEffectColorSource::uniform_data(), flutter::DlImageColorSource::vertical_tile_mode(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.

◆ ToSk() [6/28]

SkFilterMode flutter::ToSk ( const DlFilterMode  filter_mode)
inline

Definition at line 56 of file dl_sk_conversions.h.

56 {
57 return static_cast<SkFilterMode>(filter_mode);
58}

◆ ToSk() [7/28]

sk_sp< SkImageFilter > flutter::ToSk ( const DlImageFilter filter)
inline

Definition at line 102 of file dl_sk_conversions.h.

102 {
103 return ToSk(&filter);
104}

References ToSk().

◆ ToSk() [8/28]

sk_sp< SkImageFilter > flutter::ToSk ( const DlImageFilter filter)

Definition at line 181 of file dl_sk_conversions.cc.

181 {
182 if (!filter) {
183 return nullptr;
184 }
185 switch (filter->type()) {
186 case DlImageFilterType::kBlur: {
187 const DlBlurImageFilter* blur_filter = filter->asBlur();
188 FML_DCHECK(blur_filter != nullptr);
189 return SkImageFilters::Blur(blur_filter->sigma_x(),
190 blur_filter->sigma_y(),
191 ToSk(blur_filter->tile_mode()), nullptr);
192 }
193 case DlImageFilterType::kDilate: {
194 const DlDilateImageFilter* dilate_filter = filter->asDilate();
195 FML_DCHECK(dilate_filter != nullptr);
196 return SkImageFilters::Dilate(dilate_filter->radius_x(),
197 dilate_filter->radius_y(), nullptr);
198 }
199 case DlImageFilterType::kErode: {
200 const DlErodeImageFilter* erode_filter = filter->asErode();
201 FML_DCHECK(erode_filter != nullptr);
202 return SkImageFilters::Erode(erode_filter->radius_x(),
203 erode_filter->radius_y(), nullptr);
204 }
205 case DlImageFilterType::kMatrix: {
206 const DlMatrixImageFilter* matrix_filter = filter->asMatrix();
207 FML_DCHECK(matrix_filter != nullptr);
208 return SkImageFilters::MatrixTransform(
209 ToSkMatrix(matrix_filter->matrix()), ToSk(matrix_filter->sampling()),
210 nullptr);
211 }
212 case DlImageFilterType::kCompose: {
213 const DlComposeImageFilter* compose_filter = filter->asCompose();
214 FML_DCHECK(compose_filter != nullptr);
215 return SkImageFilters::Compose(ToSk(compose_filter->outer()),
216 ToSk(compose_filter->inner()));
217 }
218 case DlImageFilterType::kColorFilter: {
219 const DlColorFilterImageFilter* cf_filter = filter->asColorFilter();
220 FML_DCHECK(cf_filter != nullptr);
221 return SkImageFilters::ColorFilter(ToSk(cf_filter->color_filter()),
222 nullptr);
223 }
224 case DlImageFilterType::kLocalMatrix: {
225 const DlLocalMatrixImageFilter* lm_filter = filter->asLocalMatrix();
226 FML_DCHECK(lm_filter != nullptr);
227 sk_sp<SkImageFilter> skia_filter = ToSk(lm_filter->image_filter());
228 // The image_filter property itself might have been null, or the
229 // construction of the SkImageFilter might be optimized to null
230 // for any number of reasons. In any case, if the filter is null
231 // or optimizaed away, let's then optimize away this local matrix
232 // case by returning null.
233 if (!skia_filter) {
234 return nullptr;
235 }
236 return skia_filter->makeWithLocalMatrix(ToSkMatrix(lm_filter->matrix()));
237 }
238 case DlImageFilterType::kRuntimeEffect:
239 // UNSUPPORTED.
240 return nullptr;
241 }
242}
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
SkMatrix ToSkMatrix(const DlMatrix &matrix)

References flutter::DlImageFilter::asBlur(), flutter::DlImageFilter::asColorFilter(), flutter::DlImageFilter::asCompose(), flutter::DlImageFilter::asDilate(), flutter::DlImageFilter::asErode(), flutter::DlImageFilter::asLocalMatrix(), flutter::DlImageFilter::asMatrix(), flutter::DlColorFilterImageFilter::color_filter(), FML_DCHECK, flutter::DlLocalMatrixImageFilter::image_filter(), flutter::DlComposeImageFilter::inner(), kBlur, kColorFilter, kCompose, kDilate, kErode, kLocalMatrix, kMatrix, kRuntimeEffect, flutter::DlLocalMatrixImageFilter::matrix(), flutter::DlMatrixImageFilter::matrix(), flutter::DlComposeImageFilter::outer(), flutter::DlDilateImageFilter::radius_x(), flutter::DlErodeImageFilter::radius_x(), flutter::DlDilateImageFilter::radius_y(), flutter::DlErodeImageFilter::radius_y(), flutter::DlMatrixImageFilter::sampling(), flutter::DlBlurImageFilter::sigma_x(), flutter::DlBlurImageFilter::sigma_y(), flutter::DlBlurImageFilter::tile_mode(), ToSk(), ToSkMatrix(), and flutter::DlAttribute< D, T >::type().

◆ ToSk() [9/28]

sk_sp< SkMaskFilter > flutter::ToSk ( const DlMaskFilter filter)
inline

Definition at line 120 of file dl_sk_conversions.h.

120 {
121 return ToSk(&filter);
122}

References ToSk().

◆ ToSk() [10/28]

sk_sp< SkMaskFilter > flutter::ToSk ( const DlMaskFilter filter)

Definition at line 271 of file dl_sk_conversions.cc.

271 {
272 if (!filter) {
273 return nullptr;
274 }
275 switch (filter->type()) {
276 case DlMaskFilterType::kBlur: {
277 const DlBlurMaskFilter* blur_filter = filter->asBlur();
278 FML_DCHECK(blur_filter != nullptr);
279 return SkMaskFilter::MakeBlur(ToSk(blur_filter->style()),
280 blur_filter->sigma(),
281 blur_filter->respectCTM());
282 }
283 }
284}
virtual const DlBlurMaskFilter * asBlur() const

References flutter::DlMaskFilter::asBlur(), FML_DCHECK, kBlur, flutter::DlBlurMaskFilter::respectCTM(), flutter::DlBlurMaskFilter::sigma(), flutter::DlBlurMaskFilter::style(), ToSk(), and flutter::DlAttribute< D, T >::type().

◆ ToSk() [11/28]

SkMatrix * flutter::ToSk ( const DlMatrix matrix,
SkMatrix &  scratch 
)
inline

Definition at line 124 of file dl_sk_conversions.h.

124 {
125 return matrix ? &scratch.setAll(matrix->m[0], matrix->m[4], matrix->m[12], //
126 matrix->m[1], matrix->m[5], matrix->m[13], //
127 matrix->m[3], matrix->m[7], matrix->m[15])
128 : nullptr;
129}

References impeller::Matrix::m.

◆ ToSk() [12/28]

SkPaint flutter::ToSk ( const DlPaint paint)

Definition at line 27 of file dl_sk_conversions.cc.

27 {
28 SkPaint sk_paint;
29
30 sk_paint.setAntiAlias(paint.isAntiAlias());
31 sk_paint.setColor(ToSkColor4f(paint.getColor()));
32 sk_paint.setBlendMode(ToSk(paint.getBlendMode()));
33 sk_paint.setStyle(ToSk(paint.getDrawStyle()));
34 sk_paint.setStrokeWidth(paint.getStrokeWidth());
35 sk_paint.setStrokeMiter(paint.getStrokeMiter());
36 sk_paint.setStrokeCap(ToSk(paint.getStrokeCap()));
37 sk_paint.setStrokeJoin(ToSk(paint.getStrokeJoin()));
38 sk_paint.setImageFilter(ToSk(paint.getImageFilterPtr()));
39 auto color_filter = ToSk(paint.getColorFilterPtr());
40 if (paint.isInvertColors()) {
41 auto invert_filter = SkColorFilters::Matrix(kInvertColorMatrix);
42 if (color_filter) {
43 invert_filter = invert_filter->makeComposed(color_filter);
44 }
45 color_filter = invert_filter;
46 }
47 sk_paint.setColorFilter(color_filter);
48
49 auto color_source = paint.getColorSourcePtr();
50 if (color_source) {
51 // Unconditionally set dither to true for gradient shaders.
52 sk_paint.setDither(color_source->isGradient());
53 sk_paint.setShader(ToSk(color_source));
54 }
55
56 sk_paint.setMaskFilter(ToSk(paint.getMaskFilterPtr()));
57
58 return sk_paint;
59}
bool isAntiAlias() const
Definition dl_paint.h:57
DlStrokeCap getStrokeCap() const
Definition dl_paint.h:98
DlColor getColor() const
Definition dl_paint.h:69
DlBlendMode getBlendMode() const
Definition dl_paint.h:82
float getStrokeMiter() const
Definition dl_paint.h:120
DlStrokeJoin getStrokeJoin() const
Definition dl_paint.h:106
const DlColorSource * getColorSourcePtr() const
Definition dl_paint.h:129
const DlMaskFilter * getMaskFilterPtr() const
Definition dl_paint.h:183
const DlColorFilter * getColorFilterPtr() const
Definition dl_paint.h:147
const DlImageFilter * getImageFilterPtr() const
Definition dl_paint.h:165
DlDrawStyle getDrawStyle() const
Definition dl_paint.h:90
float getStrokeWidth() const
Definition dl_paint.h:114
bool isInvertColors() const
Definition dl_paint.h:63
SkColor4f ToSkColor4f(DlColor color)

References flutter::DlPaint::getBlendMode(), flutter::DlPaint::getColor(), flutter::DlPaint::getColorFilterPtr(), flutter::DlPaint::getColorSourcePtr(), flutter::DlPaint::getDrawStyle(), flutter::DlPaint::getImageFilterPtr(), flutter::DlPaint::getMaskFilterPtr(), flutter::DlPaint::getStrokeCap(), flutter::DlPaint::getStrokeJoin(), flutter::DlPaint::getStrokeMiter(), flutter::DlPaint::getStrokeWidth(), flutter::DlPaint::isAntiAlias(), flutter::DlPaint::isInvertColors(), kInvertColorMatrix, ToSk(), and ToSkColor4f().

Referenced by flutter::DlSkCanvasAdapter::ClipOval(), flutter::DlSkCanvasDispatcher::clipOval(), flutter::DlSkCanvasAdapter::ClipPath(), flutter::DlSkCanvasDispatcher::clipPath(), flutter::DlSkCanvasAdapter::ClipRect(), flutter::DlSkCanvasDispatcher::clipRect(), flutter::DlSkCanvasAdapter::ClipRoundRect(), flutter::DlSkCanvasDispatcher::clipRoundRect(), flutter::DlSkCanvasAdapter::ClipRoundSuperellipse(), flutter::DlSkCanvasDispatcher::clipRoundSuperellipse(), flutter::DlSkCanvasAdapter::DrawArc(), flutter::DlSkCanvasAdapter::DrawAtlas(), flutter::DlSkCanvasDispatcher::drawAtlas(), flutter::DlSkCanvasAdapter::DrawCircle(), flutter::DlSkCanvasAdapter::DrawColor(), flutter::DlSkCanvasDispatcher::drawColor(), flutter::DlSkCanvasAdapter::DrawDiffRoundRect(), flutter::DlSkCanvasAdapter::DrawImage(), flutter::DlSkCanvasDispatcher::drawImage(), flutter::DlSkCanvasAdapter::DrawImageNine(), flutter::DlSkCanvasDispatcher::drawImageNine(), flutter::DlSkCanvasAdapter::DrawImageRect(), flutter::DlSkCanvasDispatcher::drawImageRect(), flutter::DlSkCanvasAdapter::DrawOval(), flutter::DlSkCanvasAdapter::DrawPaint(), flutter::DlSkCanvasAdapter::DrawPath(), flutter::DlSkCanvasDispatcher::drawPoints(), flutter::DlSkCanvasAdapter::DrawPoints(), flutter::DlSkCanvasAdapter::DrawRect(), flutter::DlSkCanvasAdapter::DrawRoundRect(), flutter::DlSkCanvasAdapter::DrawRoundSuperellipse(), flutter::DlSkCanvasAdapter::DrawText(), flutter::DlSkCanvasDispatcher::drawVertices(), flutter::DlSkCanvasAdapter::DrawVertices(), flutter::DlSkCanvasDispatcher::saveLayer(), flutter::DlSkCanvasAdapter::SaveLayer(), flutter::DlSkPaintDispatchHelper::setBlendMode(), flutter::DlSkPaintDispatchHelper::setColorFilter(), flutter::DlSkPaintDispatchHelper::setColorSource(), flutter::DlSkPaintDispatchHelper::setDrawStyle(), flutter::DlSkPaintDispatchHelper::setImageFilter(), flutter::DlSkPaintDispatchHelper::setMaskFilter(), flutter::DlSkPaintDispatchHelper::setStrokeCap(), flutter::DlSkPaintDispatchHelper::setStrokeJoin(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::DisplayListNopTest::test_attributes_image(), ToNonShaderSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), ToSk(), and ToStrokedSk().

◆ ToSk() [13/28]

const SkRSXform * flutter::ToSk ( const DlRSTransform transforms)
inline

Definition at line 133 of file dl_sk_conversions.h.

133 {
134 return reinterpret_cast<const SkRSXform*>(transforms);
135}

◆ ToSk() [14/28]

sk_sp< SkColorFilter > flutter::ToSk ( const std::shared_ptr< const DlColorFilter > &  filter)
inline

Definition at line 107 of file dl_sk_conversions.h.

108 {
109 return ToSk(filter.get());
110}

References ToSk().

◆ ToSk() [15/28]

sk_sp< SkShader > flutter::ToSk ( const std::shared_ptr< const DlColorSource > &  source)
inline

Definition at line 90 of file dl_sk_conversions.h.

91 {
92 return ToSk(source.get());
93}

References ToSk().

◆ ToSk() [16/28]

sk_sp< SkMaskFilter > flutter::ToSk ( const std::shared_ptr< const DlMaskFilter > &  filter)
inline

Definition at line 116 of file dl_sk_conversions.h.

117 {
118 return ToSk(filter.get());
119}

References ToSk().

◆ ToSk() [17/28]

sk_sp< SkImageFilter > flutter::ToSk ( const std::shared_ptr< DlImageFilter > &  filter)
inline

Definition at line 99 of file dl_sk_conversions.h.

99 {
100 return ToSk(filter.get());
101}

References ToSk().

◆ ToSk() [18/28]

sk_sp< SkVertices > flutter::ToSk ( const std::shared_ptr< DlVertices > &  vertices)

Definition at line 286 of file dl_sk_conversions.cc.

286 {
287 std::vector<SkColor> sk_colors;
288 const SkColor* sk_colors_ptr = nullptr;
289 if (vertices->colors()) {
290 sk_colors.reserve(vertices->vertex_count());
291 for (int i = 0; i < vertices->vertex_count(); ++i) {
292 sk_colors.push_back(vertices->colors()[i].argb());
293 }
294 sk_colors_ptr = sk_colors.data();
295 }
296 return SkVertices::MakeCopy(ToSk(vertices->mode()), vertices->vertex_count(),
297 ToSkPoints(vertices->vertex_data()),
298 ToSkPoints(vertices->texture_coordinate_data()),
299 sk_colors_ptr, vertices->index_count(),
300 vertices->indices());
301}
const SkPoint * ToSkPoints(const DlPoint *points)

References i, ToSk(), and ToSkPoints().

◆ ToSk() [19/28]

SkBlendMode flutter::ToSk ( DlBlendMode  mode)
inline

Definition at line 17 of file dl_sk_conversions.h.

17 {
18 return static_cast<SkBlendMode>(mode);
19}
it will be possible to load the file into Perfetto s trace viewer use test 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 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

References mode.

◆ ToSk() [20/28]

SkClipOp flutter::ToSk ( DlClipOp  op)
inline

Definition at line 81 of file dl_sk_conversions.h.

81 {
82 return static_cast<SkClipOp>(op);
83}

◆ ToSk() [21/28]

SkPaint::Style flutter::ToSk ( DlDrawStyle  style)
inline

Definition at line 36 of file dl_sk_conversions.h.

36 {
37 return static_cast<SkPaint::Style>(style);
38}

◆ ToSk() [22/28]

SkSamplingOptions flutter::ToSk ( DlImageSampling  sampling)
inline

Definition at line 64 of file dl_sk_conversions.h.

64 {
65 switch (sampling) {
66 case DlImageSampling::kCubic:
67 return SkSamplingOptions(SkCubicResampler{1 / 3.0f, 1 / 3.0f});
68 case DlImageSampling::kLinear:
69 return SkSamplingOptions(SkFilterMode::kLinear);
70 case DlImageSampling::kMipmapLinear:
71 return SkSamplingOptions(SkFilterMode::kLinear, SkMipmapMode::kLinear);
72 case DlImageSampling::kNearestNeighbor:
73 return SkSamplingOptions(SkFilterMode::kNearest);
74 }
75}

References kCubic, kLinear, kMipmapLinear, and kNearestNeighbor.

◆ ToSk() [23/28]

SkCanvas::PointMode flutter::ToSk ( DlPointMode  mode)
inline

Definition at line 85 of file dl_sk_conversions.h.

85 {
86 return static_cast<SkCanvas::PointMode>(mode);
87}

References mode.

◆ ToSk() [24/28]

SkCanvas::SrcRectConstraint flutter::ToSk ( DlSrcRectConstraint  constraint)
inline

Definition at line 77 of file dl_sk_conversions.h.

77 {
78 return static_cast<SkCanvas::SrcRectConstraint>(constraint);
79}

◆ ToSk() [25/28]

SkPaint::Cap flutter::ToSk ( DlStrokeCap  cap)
inline

Definition at line 40 of file dl_sk_conversions.h.

40 {
41 return static_cast<SkPaint::Cap>(cap);
42}

◆ ToSk() [26/28]

SkPaint::Join flutter::ToSk ( DlStrokeJoin  join)
inline

Definition at line 44 of file dl_sk_conversions.h.

44 {
45 return static_cast<SkPaint::Join>(join);
46}

◆ ToSk() [27/28]

SkTileMode flutter::ToSk ( DlTileMode  dl_mode)
inline

Definition at line 48 of file dl_sk_conversions.h.

48 {
49 return static_cast<SkTileMode>(dl_mode);
50}

◆ ToSk() [28/28]

SkVertices::VertexMode flutter::ToSk ( DlVertexMode  dl_mode)
inline

Definition at line 60 of file dl_sk_conversions.h.

60 {
61 return static_cast<SkVertices::VertexMode>(dl_mode);
62}

◆ ToSkColor()

SkColor flutter::ToSkColor ( DlColor  color)
inline

Definition at line 32 of file dl_sk_conversions.h.

32 {
33 return color.argb();
34}
uint32_t argb() const
Definition dl_color.h:158

References flutter::DlColor::argb().

Referenced by flutter::DlSkCanvasDispatcher::DrawShadow(), and flutter::testing::TEST().

◆ ToSkColor4f()

SkColor4f flutter::ToSkColor4f ( DlColor  color)
inline

Definition at line 22 of file dl_sk_conversions.h.

22 {
23 if (color.getColorSpace() == DlColorSpace::kSRGB ||
24 color.getColorSpace() == DlColorSpace::kExtendedSRGB) {
25 return SkColor4f{color.getRedF(), color.getGreenF(), color.getBlueF(),
26 color.getAlphaF()};
27 } else {
28 return ToSkColor4f(color.withColorSpace(DlColorSpace::kExtendedSRGB));
29 }
30}
constexpr DlColorSpace getColorSpace() const
Definition dl_color.h:118
constexpr DlScalar getRedF() const
Definition dl_color.h:114
constexpr DlScalar getAlphaF() const
Definition dl_color.h:113
DlColor withColorSpace(DlColorSpace color_space) const
Definition dl_color.cc:40
constexpr DlScalar getBlueF() const
Definition dl_color.h:116
constexpr DlScalar getGreenF() const
Definition dl_color.h:115

References flutter::DlColor::getAlphaF(), flutter::DlColor::getBlueF(), flutter::DlColor::getColorSpace(), flutter::DlColor::getGreenF(), flutter::DlColor::getRedF(), kExtendedSRGB, kSRGB, ToSkColor4f(), and flutter::DlColor::withColorSpace().

Referenced by flutter::DlSkCanvasAdapter::DrawColor(), flutter::DlSkCanvasDispatcher::drawColor(), flutter::testing::RenderEnvironment::getResult(), flutter::testing::CanvasCompareTester::RenderWithSaveRestore(), flutter::DlSkPaintDispatchHelper::setColor(), flutter::testing::TEST(), flutter::testing::DisplayListNopTest::test_attributes_image(), flutter::testing::DisplayListNopTest::test_mode_color_via_filter(), flutter::testing::DisplayListNopTest::test_mode_color_via_rendering(), ToSk(), ToSk(), and ToSkColor4f().

◆ ToSkIRect()

◆ ToSkIRects()

const SkIRect * flutter::ToSkIRects ( const DlIRect rects)
inline

Definition at line 119 of file dl_geometry_conversions.h.

119 {
120 return rects == nullptr ? nullptr : reinterpret_cast<const SkIRect*>(rects);
121}

Referenced by flutter::testing::TEST().

◆ ToSkISize()

const SkISize & flutter::ToSkISize ( const DlISize size)
inline

◆ ToSkM44() [1/2]

SkM44 flutter::ToSkM44 ( const DlMatrix matrix)
inline

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

References SafeNarrow().

◆ ToSkMatrix() [1/2]

◆ ToSkMatrix() [2/2]

SkMatrix flutter::ToSkMatrix ( const tonic::Float64List &  matrix4)

Definition at line 32 of file matrix.cc.

32 {
33 FML_DCHECK(matrix4.data());
34 SkMatrix sk_matrix;
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}

References FML_DCHECK, i, kSkMatrixIndexToMatrix4Index, SafeNarrow(), and sk_matrix.

◆ ToSkPoint()

◆ ToSkPoints() [1/2]

◆ ToSkPoints() [2/2]

SkPoint * flutter::ToSkPoints ( DlPoint points)
inline

Definition at line 86 of file dl_geometry_conversions.h.

86 {
87 return points == nullptr ? nullptr : reinterpret_cast<SkPoint*>(points);
88}

References points.

◆ ToSkRect() [1/4]

const SkRect & flutter::ToSkRect ( const DlRect rect)
inline

Definition at line 90 of file dl_geometry_conversions.h.

90 {
91 return *reinterpret_cast<const SkRect*>(&rect);
92}

Referenced by flutter::DlPathBuilder::AddArc(), flutter::testing::MockRasterCache::AddMockLayer(), flutter::testing::MockRasterCache::AddMockPicture(), flutter::DlPathBuilder::AddOval(), flutter::DlPathBuilder::AddRect(), flutter::DlSkCanvasAdapter::ClipOval(), flutter::DlSkCanvasDispatcher::clipOval(), flutter::DlSkCanvasAdapter::ClipRect(), flutter::DlSkCanvasDispatcher::clipRect(), flutter::RasterCacheResult::draw(), flutter::DlSkCanvasDispatcher::drawArc(), flutter::DlSkCanvasAdapter::DrawArc(), flutter::DlSkCanvasAdapter::DrawAtlas(), flutter::DlSkCanvasDispatcher::drawAtlas(), flutter::DlSkCanvasDispatcher::drawDisplayList(), flutter::DlSkCanvasAdapter::DrawDisplayList(), flutter::DlSkCanvasAdapter::DrawImageNine(), flutter::DlSkCanvasDispatcher::drawImageNine(), flutter::DlSkCanvasAdapter::DrawImageRect(), flutter::DlSkCanvasDispatcher::drawImageRect(), flutter::DlSkCanvasDispatcher::drawOval(), flutter::DlSkCanvasAdapter::DrawOval(), flutter::DlSkCanvasDispatcher::drawRect(), flutter::DlSkCanvasAdapter::DrawRect(), flutter::LayerRasterCacheItem::GetPaintBoundsFromLayer(), IsDisplayListWorthRasterizing(), flutter::DlPath::IsOval(), flutter::DlPath::IsRect(), flutter::DlPath::MakeArc(), flutter::DlPath::MakeOval(), flutter::testing::SkJobRenderer::MakePicture(), flutter::DlPath::MakeRect(), flutter::DlPath::MakeRoundRectXY(), flutter::DlSkCanvasAdapter::QuickReject(), flutter::testing::CanvasCompareTester::RenderWithClips(), flutter::testing::CanvasCompareTester::RenderWithSaveRestore(), flutter::DlSkCanvasDispatcher::saveLayer(), flutter::DlSkCanvasAdapter::SaveLayer(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::DisplayListNopTest::test_mode_color_via_rendering(), ToSkRect(), ToSkRRect(), and flutter::DisplayListRasterCacheItem::TryToPrepareRasterCache().

◆ ToSkRect() [2/4]

const SkRect * flutter::ToSkRect ( const DlRect rect)
inline

Definition at line 103 of file dl_geometry_conversions.h.

103 {
104 return rect == nullptr ? nullptr : reinterpret_cast<const SkRect*>(rect);
105}

◆ ToSkRect() [3/4]

const SkRect * flutter::ToSkRect ( const std::optional< DlRect > &  rect)
inline

Definition at line 107 of file dl_geometry_conversions.h.

107 {
108 return rect.has_value() ? &ToSkRect(rect.value()) : nullptr;
109}
const SkRect & ToSkRect(const DlRect &rect)

References ToSkRect().

◆ ToSkRect() [4/4]

SkRect * flutter::ToSkRect ( DlRect rect)
inline

Definition at line 111 of file dl_geometry_conversions.h.

111 {
112 return rect == nullptr ? nullptr : reinterpret_cast<SkRect*>(rect);
113}

◆ ToSkRects()

const SkRect * flutter::ToSkRects ( const DlRect rects)
inline

Definition at line 115 of file dl_geometry_conversions.h.

115 {
116 return rects == nullptr ? nullptr : reinterpret_cast<const SkRect*>(rects);
117}

◆ ToSkRRect()

const SkRRect flutter::ToSkRRect ( const DlRoundRect round_rect)
inline

Definition at line 135 of file dl_geometry_conversions.h.

135 {
136 SkVector radii[4];
137 radii[SkRRect::kUpperLeft_Corner] =
138 ToSkVector(round_rect.GetRadii().top_left);
139 radii[SkRRect::kUpperRight_Corner] =
140 ToSkVector(round_rect.GetRadii().top_right);
141 radii[SkRRect::kLowerLeft_Corner] =
142 ToSkVector(round_rect.GetRadii().bottom_left);
143 radii[SkRRect::kLowerRight_Corner] =
144 ToSkVector(round_rect.GetRadii().bottom_right);
145 SkRRect rrect;
146 rrect.setRectRadii(ToSkRect(round_rect.GetBounds()), radii);
147 return rrect;
148};
const SkVector & ToSkVector(const DlSize &size)

References impeller::RoundingRadii::bottom_left, impeller::RoundingRadii::bottom_right, impeller::RoundRect::GetBounds(), impeller::RoundRect::GetRadii(), impeller::RoundingRadii::top_left, impeller::RoundingRadii::top_right, ToSkRect(), and ToSkVector().

Referenced by flutter::DlPathBuilder::AddRoundRect(), flutter::CanvasPath::addRRect(), flutter::DlSkCanvasAdapter::ClipRoundRect(), flutter::DlSkCanvasDispatcher::clipRoundRect(), flutter::DlSkCanvasDispatcher::drawDiffRoundRect(), flutter::DlSkCanvasAdapter::DrawDiffRoundRect(), flutter::DlSkCanvasDispatcher::drawRoundRect(), flutter::DlSkCanvasAdapter::DrawRoundRect(), flutter::DlPath::MakeRoundRect(), flutter::testing::CanvasCompareTester::RenderWithClips(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and ToApproximateSkRRect().

◆ ToSkSize()

const SkSize & flutter::ToSkSize ( const DlSize size)
inline

Definition at line 123 of file dl_geometry_conversions.h.

123 {
124 return *reinterpret_cast<const SkSize*>(&size);
125}

References size.

Referenced by flutter_runner::ExternalViewEmbedder::SubmitFlutterView().

◆ ToSkVector()

const SkVector & flutter::ToSkVector ( const DlSize size)
inline

Definition at line 131 of file dl_geometry_conversions.h.

131 {
132 return *reinterpret_cast<const SkVector*>(&size);
133}

References size.

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

◆ ToStrokedSk()

SkPaint flutter::ToStrokedSk ( const DlPaint paint)

Definition at line 61 of file dl_sk_conversions.cc.

61 {
62 DlPaint stroked_paint = paint;
63 stroked_paint.setDrawStyle(DlDrawStyle::kStroke);
64 return ToSk(stroked_paint);
65}

References kStroke, flutter::DlPaint::setDrawStyle(), and ToSk().

Referenced by flutter::DlSkCanvasAdapter::DrawDashedLine(), flutter::DlSkCanvasAdapter::DrawLine(), flutter::DlSkCanvasAdapter::DrawPoints(), and flutter::testing::TEST().

◆ TransformedSurfaceSize()

static DlISize flutter::TransformedSurfaceSize ( const DlISize size,
const DlMatrix transformation 
)
static

Definition at line 19 of file embedder_external_view.cc.

20 {
21 const auto source_rect = DlRect::MakeSize(size);
22 const auto transformed_rect =
23 source_rect.TransformAndClipBounds(transformation);
24 return DlIRect::RoundOut(transformed_rect).GetSize();
25}

References impeller::TRect< Scalar >::MakeSize(), impeller::TRect< T >::RoundOut(), and size.

◆ UnblockSIGPROF()

static void flutter::UnblockSIGPROF ( )
static

Definition at line 335 of file tester_main.cc.

335 {
336#if defined(FML_OS_POSIX)
337 sigset_t set;
338 sigemptyset(&set);
339 sigaddset(&set, SIGPROF);
340 pthread_sigmask(SIG_UNBLOCK, &set, NULL);
341#endif // defined(FML_OS_POSIX)
342}
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 switch_defs.h:71

References set.

Referenced by RunTester().

◆ UndeadChar()

uint32_t flutter::UndeadChar ( uint32_t  ch)
inline

Definition at line 34 of file keyboard_utils.h.

34 {
35 return ch & ~kDeadKeyCharMask;
36}

Referenced by flutter::KeyboardKeyChannelHandler::KeyboardHook().

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

567 {
568 ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture(
569 static_cast<int64_t>(texture_id));
570}

References ANDROID_SHELL_HOLDER, and texture_id.

Referenced by RegisterApi().

◆ UpdateDisplayMetrics()

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

Definition at line 411 of file platform_view_android_jni_impl.cc.

413 {
414 ANDROID_SHELL_HOLDER->UpdateDisplayMetrics();
415}

References ANDROID_SHELL_HOLDER.

Referenced by RegisterApi().

◆ UpdateJavaAssetManager()

static void flutter::UpdateJavaAssetManager ( JNIEnv *  env,
jobject  obj,
jlong  shell_holder,
jobject  jAssetManager,
jstring  jAssetBundlePath 
)
static

Definition at line 698 of file platform_view_android_jni_impl.cc.

702 {
703 auto asset_resolver = std::make_unique<flutter::APKAssetProvider>(
704 env, // jni environment
705 jAssetManager, // asset manager
706 fml::jni::JavaStringToString(env, jAssetBundlePath)); // apk asset dir
707
708 ANDROID_SHELL_HOLDER->GetPlatformView()->UpdateAssetResolverByType(
709 std::move(asset_resolver),
710 AssetResolver::AssetResolverType::kApkAssetProvider);
711}

References ANDROID_SHELL_HOLDER, fml::jni::JavaStringToString(), and flutter::AssetResolver::kApkAssetProvider.

Referenced by RegisterApi().

◆ 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.
173 FML_DCHECK(!image->isTextureBacked());
174
175 if (!io_manager->GetResourceContext() || !io_manager->GetSkiaUnrefQueue()) {
176 FML_LOG(ERROR)
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] {
191 SkSafeRef(image.get());
192 sk_sp<SkImage> texture_image = SkImages::RasterFromPixmap(
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 =
204 SkImages::CrossContextTextureFromPixmap(
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}
VkQueue queue
Definition main.cc:71
Represents the 2 code paths available when calling |SyncSwitchExecute|.
Definition sync_switch.h:35

References FML_DCHECK, FML_LOG, image, queue, fml::tracing::TraceFlow::Step(), and TRACE_EVENT0.

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

References FML_LOG.

◆ WCharBufferToString()

std::string flutter::WCharBufferToString ( const wchar_t *  wstr)

Convert a null terminated wchar_t buffer to a std::string using Windows utilities.

The reliance on wchar_t buffers is problematic on C++20 since their interop with standard library components has been deprecated/removed.

Parameters
[in]wstrThe null terminated buffer.
Returns
The converted string if conversion is possible. Empty string otherwise.

Definition at line 11 of file wchar_util.cc.

11 {
12 if (!wstr) {
13 return "";
14 }
15
16 int buffer_size = WideCharToMultiByte(CP_UTF8, //
17 0, //
18 wstr, //
19 -1, //
20 nullptr, //
21 0, //
22 nullptr, //
23 nullptr //
24 );
25 if (buffer_size <= 0) {
26 return "";
27 }
28
29 std::string result(buffer_size - 1, 0);
30 WideCharToMultiByte(CP_UTF8, //
31 0, //
32 wstr, //
33 -1, //
34 result.data(), //
35 buffer_size, //
36 nullptr, //
37 nullptr //
38 );
39 return result;
40}

Referenced by flutter::DirectManipulationOwner::Update().

◆ WindowsPlatformThreadPrioritySetter()

static void flutter::WindowsPlatformThreadPrioritySetter ( FlutterThreadPriority  priority)
static

Definition at line 62 of file flutter_windows_engine.h.

63 {
64 // TODO(99502): Add support for tracing to the windows embedding so we can
65 // mark thread priorities and success/failure.
66 switch (priority) {
68 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
69 break;
70 }
72 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
73 break;
74 }
76 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
77 break;
78 }
80 // For normal or default priority we do not need to set the priority
81 // class.
82 break;
83 }
84 }
85}
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
Definition embedder.h:371
@ kDisplay
Suitable for threads which generate data for the display.
Definition embedder.h:375
@ kRaster
Suitable for thread which raster data.
Definition embedder.h:377

References kBackground, kDisplay, kNormal, and kRaster.

Referenced by flutter::testing::TEST_F().

◆ WrapOnscreenSurface()

static sk_sp< SkSurface > flutter::WrapOnscreenSurface ( GrDirectContext *  context,
const DlISize size,
intptr_t  fbo 
)
static

Definition at line 132 of file gpu_surface_gl_skia.cc.

134 {
135 GrGLenum format = kUnknown_SkColorType;
136 const SkColorType color_type = FirstSupportedColorType(context, &format);
137
138 GrGLFramebufferInfo framebuffer_info = {};
139 framebuffer_info.fFBOID = static_cast<GrGLuint>(fbo);
140 framebuffer_info.fFormat = format;
141
142 auto render_target =
143 GrBackendRenderTargets::MakeGL(size.width, // width
144 size.height, // height
145 0, // sample count
146 0, // stencil bits
147 framebuffer_info // framebuffer info
148 );
149
150 sk_sp<SkColorSpace> colorspace = SkColorSpace::MakeSRGB();
151 SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
152
153 return SkSurfaces::WrapBackendRenderTarget(
154 context, // Gr context
155 render_target, // render target
156 GrSurfaceOrigin::kBottomLeft_GrSurfaceOrigin, // origin
157 color_type, // color type
158 colorspace, // colorspace
159 &surface_props // surface properties
160 );
161}
static SkColorType FirstSupportedColorType(GrDirectContext *context, GrGLenum *format)
uint32_t color_type

References color_type, FirstSupportedColorType(), format, and size.

◆ WriteServerErrorResponse()

static void flutter::WriteServerErrorResponse ( rapidjson::Document *  document,
const char *  message 
)
static

Definition at line 99 of file service_protocol.cc.

100 {
101 document->SetObject();
102 document->AddMember("code", -32000, document->GetAllocator());
103 rapidjson::Value message_value;
104 message_value.SetString(message, document->GetAllocator());
105 document->AddMember("message", message_value, document->GetAllocator());
106}

References message.

Variable Documentation

◆ backends

it will be possible to load the file into Perfetto s trace viewer use test 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 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 258 of file switch_defs.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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring flutter::buffer

Definition at line 98 of file switch_defs.h.

Referenced by flutter::DartIsolateGroupData::AddKernelBuffer(), flutter::FlutterSkiaVulkanMemoryAllocator::allocateBufferMemory(), flutter::AndroidShellHolder::AndroidShellHolder(), flutter::BuiltinSkiaCodecImageGenerator::BuiltinSkiaCodecImageGenerator(), flutter::ByteBufferStreamWriter::ByteBufferStreamWriter(), flutter::ImageEncodingImpeller::ConvertDlImageToSkImage(), ConvertMappingToNSData(), flutter::ImageGeneratorRegistry::CreateCompatibleGenerator(), flutter::ImageDecoderImpeller::DecompressTexture(), flutter::PlatformConfiguration::DispatchPointerDataPacket(), DispatchPointerDataPacket(), flutter::gpu::RenderPass::Draw(), flutter::JsonMessageCodec::EncodeMessageInternal(), flutter::PlatformViewAndroidJNIImpl::FlutterViewUpdateSemantics(), GetBitmap(), GetCursorFromBuffer(), GetExecutableDirectory(), impeller::testing::GetImageMemoryBarriers(), flutter::testing::FuchsiaShellTest::GetLocalTime(), GetPreferredLanguages(), GetPreferredLanguagesFromMUI(), GetUserTimeFormat(), flutter::ImageGeneratorRegistry::ImageGeneratorRegistry(), flutter::ImmutableBuffer::init(), flutter::ImmutableBuffer::initFromAsset(), flutter::ImmutableBuffer::initFromFile(), flutter::testing::MemsetPatternSetOrCheck(), flutter::testing::MemsetPatternSetOrCheck(), flutter::DartIsolate::PrepareForRunningFromKernel(), flutter::ByteBufferStreamReader::ReadBytes(), impeller::testing::RendererDartTest::RenderDartToPlayground(), flutter::PlatformConfigurationNativeApi::RespondToPlatformMessage(), impeller::testing::RecordingRenderPass::SetVertexBuffer(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::PlatformViewAndroidDelegate::UpdateSemantics(), and flutter::ImageDecoderImpeller::UploadTextureToPrivate().

◆ counts

it will be possible to load the file into Perfetto s trace viewer use test 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 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 221 of file switch_defs.h.

◆ dart

it will be possible to load the file into Perfetto s trace viewer use test 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 disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via flutter::dart

Definition at line 197 of file switch_defs.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.

Referenced by FindAndInvokeDartPluginRegistrant(), flutter::testing::DartIsolateTest::OverrideDartPluginRegistrant(), and flutter::testing::DartIsolateTest::TearDown().

◆ 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 36 of file switch_defs.h.

Referenced by _glGetIntegerv(), flutter::AccessibilityBridge::AccessibilityBridge(), flutter::FlutterPlatformNodeDelegate::AccessibilityPerformAction(), BM_PlatformMessageResponseDartComplete(), flutter::PersistentCache::BuildCacheObject(), flutter::testing::CheckTextSkData(), impeller::testing::CompareFunctionUI(), flutter::PlatformMessageResponseDart::Complete(), flutter::PlatformMessageResponseDartPort::Complete(), flutter::PlatformConfiguration::CompletePlatformMessageResponse(), ConvertNSDataToMappingPtr(), CopyNSDataToMapping(), flutter::testing::CreateSimpleSimulatedPointerData(), flutter::testing::CreateSimulatedMousePointerData(), flutter::testing::CreateSimulatedPointerData(), flutter::testing::CreateSimulatedPointerData(), flutter::testing::CreateSimulatedTrackpadGestureData(), Data(), flutter::MessageCodec< T >::DecodeMessage(), flutter::MethodCodec< T >::DecodeMethodCall(), DeserializeImageWithoutData(), DestroyData(), flutter::DlPath::Dispatch(), flutter::AccessibilityBridgeMac::DispatchAccessibilityAction(), flutter::AccessibilityBridgeWindows::DispatchAccessibilityAction(), DispatchPointerDataPacket(), flutter::PersistentCache::DumpSkp(), flutter::EmbedderSurfaceVulkanImpeller::EmbedderSurfaceVulkanImpeller(), EncodeImage(), flutter::EngineMethodResult< T >::ErrorInternal(), flutter::PlatformViewAndroidJNIImpl::FlutterViewHandlePlatformMessageResponse(), flutter::HostWindow::GetOwnedWindows(), flutter::PlatformMessageHandlerIos::HandlePlatformMessage(), flutter::FragmentProgram::initFromAsset(), flutter::FlutterProjectBundle::LoadAotData(), flutter::testing::LoadValidImageFixture(), flutter::gpu::ShaderLibrary::MakeFromAsset(), flutter::BuiltinSkiaCodecImageGenerator::MakeFromData(), flutter::FlutterSkiaVulkanMemoryAllocator::mapMemory(), flutter::testing::MockEmbedderApiForKeyboard(), impeller::testing::mockReadPixels(), flutter::testing::NormalizeImage(), flutter::DirectManipulationEventHandler::OnContentUpdated(), flutter::testing::OpenFixtureAsSkData(), flutter::gpu::Texture::Overwrite(), FlutterStandardReaderWriter::readerWithData:, flutter::SomeDataExtensionSerializer::ReadValueOfType(), flutter::PlatformConfiguration::ReportTimings(), flutter::PlatformConfigurationNativeApi::RespondToPlatformMessage(), flutter::BinaryMessengerImpl::Send(), flutter::internal::ReplyManager::SendResponseData(), flutter::SurfaceFrame::set_user_data(), flutter::RuntimeController::SetInitialLifecycleState(), flutter::RuntimeController::SetUserSettingsData(), flutter::WindowsProcTable::SetWindowCompositionAttribute(), flutter::testing::DlSurfaceProvider::Snapshot(), flutter::EngineMethodResult< T >::SuccessInternal(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), TEST(), TEST(), TEST(), TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::egl::ProcTable::TexImage2D(), ToSk(), flutter::testing::WriteImageToDisk(), and FlutterStandardWriter::writeValue:.

◆ flow_type [1/2]

const auto* flutter::flow_type = "RasterCacheFlow::DisplayList"
static

◆ 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 use test 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 disable asset flutter::fonts

Definition at line 188 of file switch_defs.h.

◆ forever

it will be possible to load the file into Perfetto s trace viewer use test 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 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 209 of file switch_defs.h.

◆ full

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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is flutter::full

Definition at line 98 of file switch_defs.h.

◆ g_acquire_latest_image_method

jmethodID flutter::g_acquire_latest_image_method = nullptr
static

◆ g_async_wait_for_vsync_method_

jmethodID flutter::g_async_wait_for_vsync_method_ = nullptr
static

Definition at line 20 of file vsync_waiter_android.cc.

Referenced by flutter::VsyncWaiterAndroid::Register().

◆ g_attach_to_gl_context_method

jmethodID flutter::g_attach_to_gl_context_method = nullptr
static

◆ g_bitmap_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_bitmap_class = nullptr
static

Definition at line 55 of file platform_view_android_jni_impl.cc.

Referenced by GetBitmap(), and RegisterApi().

◆ g_bitmap_config_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_bitmap_config_class = nullptr
static

Definition at line 57 of file platform_view_android_jni_impl.cc.

Referenced by GetBitmap(), and RegisterApi().

◆ g_bitmap_config_value_of

jmethodID flutter::g_bitmap_config_value_of = nullptr
static

Definition at line 157 of file platform_view_android_jni_impl.cc.

Referenced by GetBitmap(), and RegisterApi().

◆ g_bitmap_copy_pixels_from_buffer_method

jmethodID flutter::g_bitmap_copy_pixels_from_buffer_method = nullptr
static

Definition at line 155 of file platform_view_android_jni_impl.cc.

Referenced by GetBitmap(), and RegisterApi().

◆ g_bitmap_create_bitmap_method

jmethodID flutter::g_bitmap_create_bitmap_method = nullptr
static

Definition at line 153 of file platform_view_android_jni_impl.cc.

Referenced by GetBitmap(), and RegisterApi().

◆ g_compute_platform_resolved_locale_method

jmethodID flutter::g_compute_platform_resolved_locale_method = nullptr
static

◆ g_decode_image_method

jmethodID flutter::g_decode_image_method = nullptr
static

Definition at line 20 of file android_image_generator.cc.

Referenced by flutter::AndroidImageGenerator::Register().

◆ g_detach_from_gl_context_method

jmethodID flutter::g_detach_from_gl_context_method = nullptr
static

◆ g_flutter_callback_info_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_callback_info_class
static
Initial value:
=
nullptr

Definition at line 36 of file platform_view_android_jni_impl.cc.

Referenced by LookupCallbackInformation(), and flutter::PlatformViewAndroid::Register().

◆ g_flutter_callback_info_constructor

jmethodID flutter::g_flutter_callback_info_constructor = nullptr
static

◆ g_flutter_jni_class [1/2]

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_jni_class = nullptr
static

◆ g_flutter_jni_class [2/2]

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_flutter_jni_class = nullptr
static

Definition at line 39 of file platform_view_android_jni_impl.cc.

◆ g_flutter_main

std::unique_ptr<FlutterMain> flutter::g_flutter_main
static

Definition at line 73 of file flutter_main.cc.

Referenced by flutter::FlutterMain::Get().

◆ g_get_transform_matrix_method

jmethodID flutter::g_get_transform_matrix_method = nullptr
static

◆ g_hardware_buffer_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_hardware_buffer_class = nullptr
static

◆ g_hardware_buffer_close_method

jmethodID flutter::g_hardware_buffer_close_method = nullptr
static

◆ g_image_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_image_class = nullptr
static

◆ g_image_close_method

jmethodID flutter::g_image_close_method = nullptr
static

◆ g_image_consumer_texture_registry_interface

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_image_consumer_texture_registry_interface = nullptr
static

◆ g_image_get_hardware_buffer_method

jmethodID flutter::g_image_get_hardware_buffer_method = nullptr
static

◆ g_java_long_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_java_long_class = nullptr
static

◆ g_java_weak_reference_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_java_weak_reference_class
static
Initial value:
=
nullptr

Definition at line 41 of file platform_view_android_jni_impl.cc.

Referenced by flutter::PlatformViewAndroid::Register().

◆ g_java_weak_reference_get_method

◆ g_jni_constructor

jmethodID flutter::g_jni_constructor = nullptr
static

Definition at line 117 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi(), and SpawnJNI().

◆ g_jni_shell_holder_field

jfieldID flutter::g_jni_shell_holder_field = nullptr
static

Definition at line 63 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi(), and SpawnJNI().

◆ g_long_constructor

jmethodID flutter::g_long_constructor = nullptr
static

Definition at line 119 of file platform_view_android_jni_impl.cc.

Referenced by RegisterApi(), and SpawnJNI().

◆ g_mutators_stack_class

◆ g_mutators_stack_init_method

◆ g_mutators_stack_push_clippath_method

jmethodID flutter::g_mutators_stack_push_clippath_method = nullptr
static

◆ g_mutators_stack_push_cliprect_method

◆ g_mutators_stack_push_cliprrect_method

◆ g_mutators_stack_push_opacity_method

jmethodID flutter::g_mutators_stack_push_opacity_method = nullptr
static

◆ g_mutators_stack_push_transform_method

◆ g_overlay_surface_id_method

◆ g_overlay_surface_surface_method

jmethodID flutter::g_overlay_surface_surface_method = nullptr
static

◆ g_path_fill_type_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_path_fill_type_class = nullptr
static

◆ g_path_fill_type_even_odd_field

jfieldID flutter::g_path_fill_type_even_odd_field = nullptr
static

◆ g_path_fill_type_winding_field

jfieldID flutter::g_path_fill_type_winding_field = nullptr
static

◆ g_refresh_rate_

std::atomic_uint flutter::g_refresh_rate_ = 60
static

Definition at line 21 of file vsync_waiter_android.cc.

◆ g_request_dart_deferred_library_method

jmethodID flutter::g_request_dart_deferred_library_method = nullptr
static

◆ g_shell

absl::NoDestructor<std::unique_ptr<Shell> > flutter::g_shell
static

Definition at line 124 of file tester_main.cc.

Referenced by RunTester(), and Spawn().

◆ g_surface_texture_wrapper_should_update

jmethodID flutter::g_surface_texture_wrapper_should_update = nullptr
static

◆ g_texture_wrapper_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_texture_wrapper_class = nullptr
static

◆ g_update_tex_image_method

jmethodID flutter::g_update_tex_image_method = nullptr
static

◆ g_vsync_waiter_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::g_vsync_waiter_class = nullptr
static

Definition at line 19 of file vsync_waiter_android.cc.

Referenced by flutter::VsyncWaiterAndroid::Register().

◆ gc

it will be possible to load the file into Perfetto s trace viewer use test 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 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 220 of file switch_defs.h.

◆ gFontFile

std::string flutter::gFontFile
static

Definition at line 10 of file flow_test_utils.cc.

Referenced by GetFontFile(), and SetFontFile().

◆ gGoldenDir

std::string flutter::gGoldenDir
static

Definition at line 9 of file flow_test_utils.cc.

Referenced by GetGoldenDir(), and SetGoldenDir().

◆ gVM

std::weak_ptr<DartVM> flutter::gVM
static

◆ gVMData

std::weak_ptr<const DartVMData> flutter::gVMData
static

◆ gVMDependentsMutex

◆ gVMIsolateNameServer

std::weak_ptr<IsolateNameServer> flutter::gVMIsolateNameServer
static

◆ gVMLaunchCount

std::atomic_size_t flutter::gVMLaunchCount
static

Definition at line 261 of file dart_vm.cc.

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

◆ gVMLeak

std::shared_ptr<DartVM>* flutter::gVMLeak
static

Definition at line 17 of file dart_vm_lifecycle.cc.

Referenced by flutter::DartVMRef::Create().

◆ gVMMutex

std::mutex flutter::gVMMutex
static

◆ gVMServiceProtocol

std::weak_ptr<ServiceProtocol> flutter::gVMServiceProtocol
static

◆ 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

◆ impeller

it will be possible to load the file into Perfetto s trace viewer use test 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 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 248 of file switch_defs.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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode flutter::ipv6

Definition at line 86 of file switch_defs.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 23 of file engine.cc.

◆ kBinarySearchThreshold

const int flutter::kBinarySearchThreshold = 10

Definition at line 13 of file dl_region.cc.

Referenced by flutter::DlRegion::intersects().

◆ kBlendModeDefault

constexpr uint32_t flutter::kBlendModeDefault
constexpr
Initial value:
=
static_cast<uint32_t>(SkBlendMode::kSrcOver)

Definition at line 53 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kBlendModeIndex

constexpr int flutter::kBlendModeIndex = 6
constexpr

Definition at line 31 of file paint.cc.

Referenced by flutter::Paint::paint().

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

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

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

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

◆ kColorAlphaIndex

constexpr int flutter::kColorAlphaIndex = 4
constexpr

Definition at line 29 of file paint.cc.

◆ kColorBlueIndex

constexpr int flutter::kColorBlueIndex = 3
constexpr

Definition at line 28 of file paint.cc.

◆ kColorFilterIndex

constexpr int flutter::kColorFilterIndex = 1
constexpr

Definition at line 48 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kColorGreenIndex

constexpr int flutter::kColorGreenIndex = 2
constexpr

Definition at line 27 of file paint.cc.

◆ kColorRedIndex

constexpr int flutter::kColorRedIndex = 1
constexpr

Definition at line 26 of file paint.cc.

◆ kColorSpaceIndex

constexpr int flutter::kColorSpaceIndex = 5
constexpr

Definition at line 30 of file paint.cc.

◆ kControl

◆ kDartAllConfigsArgs

const char* flutter::kDartAllConfigsArgs[]
static
Initial value:
= {
"--enable_mirrors=false",
"--background_compilation",
}

Definition at line 34 of file dart_vm.cc.

34 {
35 // clang-format off
36 "--enable_mirrors=false",
37 "--background_compilation",
38 // 'mark_when_idle' appears to cause a regression, turning off for now.
39 // "--mark_when_idle",
40 // clang-format on
41};

◆ kDartAssertArgs

const char* flutter::kDartAssertArgs[]
static
Initial value:
= {
"--enable_asserts",
}

Definition at line 65 of file dart_vm.cc.

65 {
66 // clang-format off
67 "--enable_asserts",
68 // clang-format on
69};

◆ kDartDefaultTraceStreamsArgs

const char* flutter::kDartDefaultTraceStreamsArgs[]
static
Initial value:
{
"--timeline_streams=Dart,Embedder,GC,Microtask",
}

Definition at line 94 of file dart_vm.cc.

94 {
95 "--timeline_streams=Dart,Embedder,GC,Microtask",
96};

◆ kDartDisableIntegerDivisionArgs

const char* flutter::kDartDisableIntegerDivisionArgs[]
static
Initial value:
= {
"--no_use_integer_division",
}

Definition at line 61 of file dart_vm.cc.

61 {
62 "--no_use_integer_division",
63};

◆ kDartEndlessTraceBufferArgs

const char* flutter::kDartEndlessTraceBufferArgs[]
static
Initial value:
{
"--timeline_recorder=endless",
}

Definition at line 75 of file dart_vm.cc.

75 {
76 "--timeline_recorder=endless",
77};

◆ kDartPrecompilationArgs

const char* flutter::kDartPrecompilationArgs[] = {"--precompilation"}
static

Definition at line 43 of file dart_vm.cc.

43{"--precompilation"};

◆ kDartProfileMicrotasksArgs

const char* flutter::kDartProfileMicrotasksArgs[]
static
Initial value:
{
"--profile_microtasks",
}

Definition at line 108 of file dart_vm.cc.

108 {
109 "--profile_microtasks",
110};

◆ kDartStartPausedArgs

const char* flutter::kDartStartPausedArgs[]
static
Initial value:
{
"--pause_isolates_on_start",
}

Definition at line 71 of file dart_vm.cc.

71 {
72 "--pause_isolates_on_start",
73};

◆ kDartStartupTraceStreamsArgs

const char* flutter::kDartStartupTraceStreamsArgs[]
static
Initial value:
{
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,Microtask,"
"VM,API",
}

Definition at line 98 of file dart_vm.cc.

98 {
99 "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,Microtask,"
100 "VM,API",
101};

◆ kDartSystraceTraceBufferArgs

const char* flutter::kDartSystraceTraceBufferArgs[]
static
Initial value:
= {
"--timeline_recorder=systrace",
}

Definition at line 79 of file dart_vm.cc.

79 {
80 "--timeline_recorder=systrace",
81};

◆ kDartSystraceTraceStreamsArgs

const char* flutter::kDartSystraceTraceStreamsArgs[]
static
Initial value:
= {
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,Microtask,"
"VM,API",
}

Definition at line 103 of file dart_vm.cc.

103 {
104 "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,Microtask,"
105 "VM,API",
106};

◆ kDartWrapperInfoUIImage

const tonic::DartWrapperInfo flutter::kDartWrapperInfoUIImage("ui", "_Image") ( "ui"  ,
"_Image"   
)
static

◆ kDartWriteProtectCodeArgs

const char* flutter::kDartWriteProtectCodeArgs[]
static
Initial value:
= {
"--no_write_protect_code",
}

Definition at line 56 of file dart_vm.cc.

56 {
57 "--no_write_protect_code",
58};

◆ kDataByteCount

constexpr size_t flutter::kDataByteCount = 68
constexpr

Definition at line 42 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kDeadKeyCharMask

constexpr int flutter::kDeadKeyCharMask = 0x80000000
constexpr

Definition at line 30 of file keyboard_utils.h.

Referenced by flutter::KeyboardManager::HandleMessage().

◆ kDefaultDpi

constexpr UINT flutter::kDefaultDpi = 96
constexpr

Definition at line 12 of file dpi_utils.h.

◆ kDisplayEngineStatistics

const int flutter::kDisplayEngineStatistics = 1 << 2

Definition at line 20 of file performance_overlay_layer.h.

Referenced by flutter::PerformanceOverlayLayer::Paint().

◆ kDisplayRasterizerStatistics

const int flutter::kDisplayRasterizerStatistics = 1 << 0

◆ kEhCloseEnough

◆ kEmpty [1/2]

constexpr DlRect flutter::kEmpty = DlRect()
staticconstexpr

Definition at line 122 of file dl_builder.cc.

Referenced by ProtectEmpty().

◆ kEmpty [2/2]

constexpr DlRect flutter::kEmpty = DlRect()
staticconstexpr

Definition at line 13 of file dl_matrix_clip_tracker.cc.

◆ kExitTypeNames

constexpr const char* flutter::kExitTypeNames[]
staticconstexpr
Initial value:
= {
PlatformHandler::kExitTypeRequired, PlatformHandler::kExitTypeCancelable}

Definition at line 405 of file platform_handler.cc.

405 {
406 PlatformHandler::kExitTypeRequired, PlatformHandler::kExitTypeCancelable};

Referenced by flutter::PlatformHandler::RequestAppExit().

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

149 {
150 @0x00000024 : @0x0010000000d, // Enter -> enter
151 @0x00000030 : @0x00100000009, // Tab -> tab
152 @0x00000033 : @0x00100000008, // Backspace -> backspace
153 @0x00000035 : @0x0010000001b, // Escape -> escape
154 @0x00000036 : @0x00200000107, // MetaRight -> metaRight
155 @0x00000037 : @0x00200000106, // MetaLeft -> metaLeft
156 @0x00000038 : @0x00200000102, // ShiftLeft -> shiftLeft
157 @0x00000039 : @0x00100000104, // CapsLock -> capsLock
158 @0x0000003a : @0x00200000104, // AltLeft -> altLeft
159 @0x0000003b : @0x00200000100, // ControlLeft -> controlLeft
160 @0x0000003c : @0x00200000103, // ShiftRight -> shiftRight
161 @0x0000003d : @0x00200000105, // AltRight -> altRight
162 @0x0000003e : @0x00200000101, // ControlRight -> controlRight
163 @0x0000003f : @0x00100000106, // Fn -> fn
164 @0x00000040 : @0x00100000811, // F17 -> f17
165 @0x00000041 : @0x0020000022e, // NumpadDecimal -> numpadDecimal
166 @0x00000043 : @0x0020000022a, // NumpadMultiply -> numpadMultiply
167 @0x00000045 : @0x0020000022b, // NumpadAdd -> numpadAdd
168 @0x00000047 : @0x0010000010a, // NumLock -> numLock
169 @0x00000048 : @0x00100000a10, // AudioVolumeUp -> audioVolumeUp
170 @0x00000049 : @0x00100000a0f, // AudioVolumeDown -> audioVolumeDown
171 @0x0000004a : @0x00100000a11, // AudioVolumeMute -> audioVolumeMute
172 @0x0000004b : @0x0020000022f, // NumpadDivide -> numpadDivide
173 @0x0000004c : @0x0020000020d, // NumpadEnter -> numpadEnter
174 @0x0000004e : @0x0020000022d, // NumpadSubtract -> numpadSubtract
175 @0x0000004f : @0x00100000812, // F18 -> f18
176 @0x00000050 : @0x00100000813, // F19 -> f19
177 @0x00000051 : @0x0020000023d, // NumpadEqual -> numpadEqual
178 @0x00000052 : @0x00200000230, // Numpad0 -> numpad0
179 @0x00000053 : @0x00200000231, // Numpad1 -> numpad1
180 @0x00000054 : @0x00200000232, // Numpad2 -> numpad2
181 @0x00000055 : @0x00200000233, // Numpad3 -> numpad3
182 @0x00000056 : @0x00200000234, // Numpad4 -> numpad4
183 @0x00000057 : @0x00200000235, // Numpad5 -> numpad5
184 @0x00000058 : @0x00200000236, // Numpad6 -> numpad6
185 @0x00000059 : @0x00200000237, // Numpad7 -> numpad7
186 @0x0000005a : @0x00100000814, // F20 -> f20
187 @0x0000005b : @0x00200000238, // Numpad8 -> numpad8
188 @0x0000005c : @0x00200000239, // Numpad9 -> numpad9
189 @0x0000005d : @0x00200000022, // IntlYen -> intlYen
190 @0x0000005e : @0x00200000021, // IntlRo -> intlRo
191 @0x0000005f : @0x0020000022c, // NumpadComma -> numpadComma
192 @0x00000060 : @0x00100000805, // F5 -> f5
193 @0x00000061 : @0x00100000806, // F6 -> f6
194 @0x00000062 : @0x00100000807, // F7 -> f7
195 @0x00000063 : @0x00100000803, // F3 -> f3
196 @0x00000064 : @0x00100000808, // F8 -> f8
197 @0x00000065 : @0x00100000809, // F9 -> f9
198 @0x00000066 : @0x00200000011, // Lang2 -> lang2
199 @0x00000067 : @0x0010000080b, // F11 -> f11
200 @0x00000068 : @0x00200000010, // Lang1 -> lang1
201 @0x00000069 : @0x0010000080d, // F13 -> f13
202 @0x0000006a : @0x00100000810, // F16 -> f16
203 @0x0000006b : @0x0010000080e, // F14 -> f14
204 @0x0000006d : @0x0010000080a, // F10 -> f10
205 @0x0000006e : @0x00100000505, // ContextMenu -> contextMenu
206 @0x0000006f : @0x0010000080c, // F12 -> f12
207 @0x00000071 : @0x0010000080f, // F15 -> f15
208 @0x00000072 : @0x00100000407, // Insert -> insert
209 @0x00000073 : @0x00100000306, // Home -> home
210 @0x00000074 : @0x00100000308, // PageUp -> pageUp
211 @0x00000075 : @0x0010000007f, // Delete -> delete
212 @0x00000076 : @0x00100000804, // F4 -> f4
213 @0x00000077 : @0x00100000305, // End -> end
214 @0x00000078 : @0x00100000802, // F2 -> f2
215 @0x00000079 : @0x00100000307, // PageDown -> pageDown
216 @0x0000007a : @0x00100000801, // F1 -> f1
217 @0x0000007b : @0x00100000302, // ArrowLeft -> arrowLeft
218 @0x0000007c : @0x00100000303, // ArrowRight -> arrowRight
219 @0x0000007d : @0x00100000301, // ArrowDown -> arrowDown
220 @0x0000007e : @0x00100000304, // ArrowUp -> arrowUp
221};

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

223 {
224 @0x00000038 : @(kModifierFlagShiftLeft),
225 @0x0000003c : @(kModifierFlagShiftRight),
226 @0x0000003b : @(kModifierFlagControlLeft),
227 @0x0000003e : @(kModifierFlagControlRight),
228 @0x0000003a : @(kModifierFlagAltLeft),
229 @0x0000003d : @(kModifierFlagAltRight),
230 @0x00000037 : @(kModifierFlagMetaLeft),
231 @0x00000036 : @(kModifierFlagMetaRight),
232};

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

26 {
27 @0x00000000 : @0x00070004, // keyA
28 @0x00000001 : @0x00070016, // keyS
29 @0x00000002 : @0x00070007, // keyD
30 @0x00000003 : @0x00070009, // keyF
31 @0x00000004 : @0x0007000b, // keyH
32 @0x00000005 : @0x0007000a, // keyG
33 @0x00000006 : @0x0007001d, // keyZ
34 @0x00000007 : @0x0007001b, // keyX
35 @0x00000008 : @0x00070006, // keyC
36 @0x00000009 : @0x00070019, // keyV
37 @0x0000000a : @0x00070064, // intlBackslash
38 @0x0000000b : @0x00070005, // keyB
39 @0x0000000c : @0x00070014, // keyQ
40 @0x0000000d : @0x0007001a, // keyW
41 @0x0000000e : @0x00070008, // keyE
42 @0x0000000f : @0x00070015, // keyR
43 @0x00000010 : @0x0007001c, // keyY
44 @0x00000011 : @0x00070017, // keyT
45 @0x00000012 : @0x0007001e, // digit1
46 @0x00000013 : @0x0007001f, // digit2
47 @0x00000014 : @0x00070020, // digit3
48 @0x00000015 : @0x00070021, // digit4
49 @0x00000016 : @0x00070023, // digit6
50 @0x00000017 : @0x00070022, // digit5
51 @0x00000018 : @0x0007002e, // equal
52 @0x00000019 : @0x00070026, // digit9
53 @0x0000001a : @0x00070024, // digit7
54 @0x0000001b : @0x0007002d, // minus
55 @0x0000001c : @0x00070025, // digit8
56 @0x0000001d : @0x00070027, // digit0
57 @0x0000001e : @0x00070030, // bracketRight
58 @0x0000001f : @0x00070012, // keyO
59 @0x00000020 : @0x00070018, // keyU
60 @0x00000021 : @0x0007002f, // bracketLeft
61 @0x00000022 : @0x0007000c, // keyI
62 @0x00000023 : @0x00070013, // keyP
63 @0x00000024 : @0x00070028, // enter
64 @0x00000025 : @0x0007000f, // keyL
65 @0x00000026 : @0x0007000d, // keyJ
66 @0x00000027 : @0x00070034, // quote
67 @0x00000028 : @0x0007000e, // keyK
68 @0x00000029 : @0x00070033, // semicolon
69 @0x0000002a : @0x00070031, // backslash
70 @0x0000002b : @0x00070036, // comma
71 @0x0000002c : @0x00070038, // slash
72 @0x0000002d : @0x00070011, // keyN
73 @0x0000002e : @0x00070010, // keyM
74 @0x0000002f : @0x00070037, // period
75 @0x00000030 : @0x0007002b, // tab
76 @0x00000031 : @0x0007002c, // space
77 @0x00000032 : @0x00070035, // backquote
78 @0x00000033 : @0x0007002a, // backspace
79 @0x00000035 : @0x00070029, // escape
80 @0x00000036 : @0x000700e7, // metaRight
81 @0x00000037 : @0x000700e3, // metaLeft
82 @0x00000038 : @0x000700e1, // shiftLeft
83 @0x00000039 : @0x00070039, // capsLock
84 @0x0000003a : @0x000700e2, // altLeft
85 @0x0000003b : @0x000700e0, // controlLeft
86 @0x0000003c : @0x000700e5, // shiftRight
87 @0x0000003d : @0x000700e6, // altRight
88 @0x0000003e : @0x000700e4, // controlRight
89 @0x0000003f : @0x00000012, // fn
90 @0x00000040 : @0x0007006c, // f17
91 @0x00000041 : @0x00070063, // numpadDecimal
92 @0x00000043 : @0x00070055, // numpadMultiply
93 @0x00000045 : @0x00070057, // numpadAdd
94 @0x00000047 : @0x00070053, // numLock
95 @0x00000048 : @0x00070080, // audioVolumeUp
96 @0x00000049 : @0x00070081, // audioVolumeDown
97 @0x0000004a : @0x0007007f, // audioVolumeMute
98 @0x0000004b : @0x00070054, // numpadDivide
99 @0x0000004c : @0x00070058, // numpadEnter
100 @0x0000004e : @0x00070056, // numpadSubtract
101 @0x0000004f : @0x0007006d, // f18
102 @0x00000050 : @0x0007006e, // f19
103 @0x00000051 : @0x00070067, // numpadEqual
104 @0x00000052 : @0x00070062, // numpad0
105 @0x00000053 : @0x00070059, // numpad1
106 @0x00000054 : @0x0007005a, // numpad2
107 @0x00000055 : @0x0007005b, // numpad3
108 @0x00000056 : @0x0007005c, // numpad4
109 @0x00000057 : @0x0007005d, // numpad5
110 @0x00000058 : @0x0007005e, // numpad6
111 @0x00000059 : @0x0007005f, // numpad7
112 @0x0000005a : @0x0007006f, // f20
113 @0x0000005b : @0x00070060, // numpad8
114 @0x0000005c : @0x00070061, // numpad9
115 @0x0000005d : @0x00070089, // intlYen
116 @0x0000005e : @0x00070087, // intlRo
117 @0x0000005f : @0x00070085, // numpadComma
118 @0x00000060 : @0x0007003e, // f5
119 @0x00000061 : @0x0007003f, // f6
120 @0x00000062 : @0x00070040, // f7
121 @0x00000063 : @0x0007003c, // f3
122 @0x00000064 : @0x00070041, // f8
123 @0x00000065 : @0x00070042, // f9
124 @0x00000066 : @0x00070091, // lang2
125 @0x00000067 : @0x00070044, // f11
126 @0x00000068 : @0x00070090, // lang1
127 @0x00000069 : @0x00070068, // f13
128 @0x0000006a : @0x0007006b, // f16
129 @0x0000006b : @0x00070069, // f14
130 @0x0000006d : @0x00070043, // f10
131 @0x0000006e : @0x00070065, // contextMenu
132 @0x0000006f : @0x00070045, // f12
133 @0x00000071 : @0x0007006a, // f15
134 @0x00000072 : @0x00070049, // insert
135 @0x00000073 : @0x0007004a, // home
136 @0x00000074 : @0x0007004b, // pageUp
137 @0x00000075 : @0x0007004c, // delete
138 @0x00000076 : @0x0007003d, // f4
139 @0x00000077 : @0x0007004d, // end
140 @0x00000078 : @0x0007003b, // f2
141 @0x00000079 : @0x0007004e, // pageDown
142 @0x0000007a : @0x0007003a, // f1
143 @0x0000007b : @0x00070050, // arrowLeft
144 @0x0000007c : @0x0007004f, // arrowRight
145 @0x0000007d : @0x00070051, // arrowDown
146 @0x0000007e : @0x00070052, // arrowUp
147};

◆ kFileUriPrefix

constexpr char flutter::kFileUriPrefix[] = "file://"
constexpr

Definition at line 118 of file dart_vm.cc.

Referenced by DartFileModifiedCallback().

◆ kFileUriPrefixLength

constexpr size_t flutter::kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1
constexpr

Definition at line 119 of file dart_vm.cc.

Referenced by DartFileModifiedCallback().

◆ kFilterQualities

const std::array<DlImageSampling, 4> flutter::kFilterQualities
static
Initial value:
= {
DlImageSampling::kNearestNeighbor,
DlImageSampling::kLinear,
DlImageSampling::kMipmapLinear,
DlImageSampling::kCubic,
}

Definition at line 29 of file image_filter.cc.

29 {
30 DlImageSampling::kNearestNeighbor,
31 DlImageSampling::kLinear,
32 DlImageSampling::kMipmapLinear,
33 DlImageSampling::kCubic,
34};

Referenced by flutter::ImageFilter::SamplingFromIndex().

◆ kFilterQualityIndex

constexpr int flutter::kFilterQualityIndex = 12
constexpr

Definition at line 37 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kFlutterImplicitViewId

◆ kFlutterThreadName

constexpr const char* flutter::kFlutterThreadName = "io.flutter"
constexpr

Definition at line 126 of file embedder_thread_host.cc.

Referenced by MakeThreadConfig().

◆ kFontChange

constexpr char flutter::kFontChange[] = "fontsChange"
constexpr

Definition at line 54 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

◆ kGrCacheMaxByteSize

const size_t flutter::kGrCacheMaxByteSize = 24 * (1 << 20)
static

Definition at line 40 of file gpu_surface_gl_skia.cc.

Referenced by flutter::GPUSurfaceGLSkia::MakeGLContext().

◆ kHandleKey

const char* flutter::kHandleKey = "handle"
static

Definition at line 25 of file callback_cache.cc.

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

◆ kHasScrollingAction

constexpr int flutter::kHasScrollingAction
constexpr

◆ kHorizontalScrollSemanticsActions

constexpr int flutter::kHorizontalScrollSemanticsActions
constexpr
Initial value:
=
static_cast<int32_t>(SemanticsAction::kScrollLeft) |
static_cast<int32_t>(SemanticsAction::kScrollRight)

Definition at line 56 of file semantics_node.h.

◆ kImageFilterIndex

constexpr int flutter::kImageFilterIndex = 2
constexpr

Definition at line 49 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kImageReaderSwapchainSize

constexpr size_t flutter::kImageReaderSwapchainSize = 6u
staticconstexpr

◆ 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 210 of file compositor_context.cc.

◆ kImplicitViewId

◆ kInvertColorIndex

constexpr int flutter::kInvertColorIndex = 16
constexpr

Definition at line 41 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ 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 19 of file dl_sk_conversions.cc.

19 {
20 -1.0, 0, 0, 1.0, 0,
21 0, -1.0, 0, 1.0, 0,
22 0, 0, -1.0, 1.0, 0,
23 1.0, 1.0, 1.0, 1.0, 0
24};

Referenced by ToSk().

◆ kIsAntiAliasIndex

constexpr int flutter::kIsAntiAliasIndex = 0
constexpr

Definition at line 25 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kIsolateChannel

constexpr char flutter::kIsolateChannel[] = "flutter/isolate"
staticconstexpr

Definition at line 28 of file engine.cc.

Referenced by flutter::Engine::Run().

◆ kKeyCodeControlLeft

constexpr int flutter::kKeyCodeControlLeft = 0xa2
constexpr

◆ kKeyCodeShiftLeft

constexpr int flutter::kKeyCodeShiftLeft = 0xa0
constexpr

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

248 {
249 LayoutGoal{0x31, 0x20, false}, // Space
250 LayoutGoal{0x27, 0x22, false}, // Quote
251 LayoutGoal{0x2b, 0x2c, false}, // Comma
252 LayoutGoal{0x1b, 0x2d, false}, // Minus
253 LayoutGoal{0x2f, 0x2e, false}, // Period
254 LayoutGoal{0x2c, 0x2f, false}, // Slash
255 LayoutGoal{0x1d, 0x30, true}, // Digit0
256 LayoutGoal{0x12, 0x31, true}, // Digit1
257 LayoutGoal{0x13, 0x32, true}, // Digit2
258 LayoutGoal{0x14, 0x33, true}, // Digit3
259 LayoutGoal{0x15, 0x34, true}, // Digit4
260 LayoutGoal{0x17, 0x35, true}, // Digit5
261 LayoutGoal{0x16, 0x36, true}, // Digit6
262 LayoutGoal{0x1a, 0x37, true}, // Digit7
263 LayoutGoal{0x1c, 0x38, true}, // Digit8
264 LayoutGoal{0x19, 0x39, true}, // Digit9
265 LayoutGoal{0x29, 0x3b, false}, // Semicolon
266 LayoutGoal{0x18, 0x3d, false}, // Equal
267 LayoutGoal{0x21, 0x5b, false}, // BracketLeft
268 LayoutGoal{0x2a, 0x5c, false}, // Backslash
269 LayoutGoal{0x1e, 0x5d, false}, // BracketRight
270 LayoutGoal{0x32, 0x60, false}, // Backquote
271 LayoutGoal{0x00, 0x61, true}, // KeyA
272 LayoutGoal{0x0b, 0x62, true}, // KeyB
273 LayoutGoal{0x08, 0x63, true}, // KeyC
274 LayoutGoal{0x02, 0x64, true}, // KeyD
275 LayoutGoal{0x0e, 0x65, true}, // KeyE
276 LayoutGoal{0x03, 0x66, true}, // KeyF
277 LayoutGoal{0x05, 0x67, true}, // KeyG
278 LayoutGoal{0x04, 0x68, true}, // KeyH
279 LayoutGoal{0x22, 0x69, true}, // KeyI
280 LayoutGoal{0x26, 0x6a, true}, // KeyJ
281 LayoutGoal{0x28, 0x6b, true}, // KeyK
282 LayoutGoal{0x25, 0x6c, true}, // KeyL
283 LayoutGoal{0x2e, 0x6d, true}, // KeyM
284 LayoutGoal{0x2d, 0x6e, true}, // KeyN
285 LayoutGoal{0x1f, 0x6f, true}, // KeyO
286 LayoutGoal{0x23, 0x70, true}, // KeyP
287 LayoutGoal{0x0c, 0x71, true}, // KeyQ
288 LayoutGoal{0x0f, 0x72, true}, // KeyR
289 LayoutGoal{0x01, 0x73, true}, // KeyS
290 LayoutGoal{0x11, 0x74, true}, // KeyT
291 LayoutGoal{0x20, 0x75, true}, // KeyU
292 LayoutGoal{0x09, 0x76, true}, // KeyV
293 LayoutGoal{0x0d, 0x77, true}, // KeyW
294 LayoutGoal{0x07, 0x78, true}, // KeyX
295 LayoutGoal{0x10, 0x79, true}, // KeyY
296 LayoutGoal{0x06, 0x7a, true}, // KeyZ
297 LayoutGoal{0x0a, 0x200000020, false}, // IntlBackslash
298};

Referenced by flutter::testing::TEST().

◆ kLibraryPathKey

const char* flutter::kLibraryPathKey = "library_path"
static

Definition at line 29 of file callback_cache.cc.

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

◆ kLifecycleChannel

constexpr char flutter::kLifecycleChannel[] = "flutter/lifecycle"
staticconstexpr

Definition at line 24 of file engine.cc.

Referenced by flutter::Engine::DispatchPlatformMessage().

◆ kListViewsExtensionName

constexpr std::string_view flutter::kListViewsExtensionName
staticconstexpr
Initial value:
=
"_flutter.listViews"

Definition at line 44 of file service_protocol.cc.

Referenced by flutter::ServiceProtocol::ServiceProtocol().

◆ kLocalizationChannel

constexpr char flutter::kLocalizationChannel[] = "flutter/localization"
staticconstexpr

Definition at line 26 of file engine.cc.

Referenced by flutter::Engine::DispatchPlatformMessage().

◆ 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 = 14
constexpr

Definition at line 39 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kMaskFilterIndex

constexpr int flutter::kMaskFilterIndex = 13
constexpr

Definition at line 38 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kMaskFilterSigmaIndex

constexpr int flutter::kMaskFilterSigmaIndex = 15
constexpr

Definition at line 40 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kMaxCount

constexpr size_t flutter::kMaxCount = 4
staticconstexpr

Definition at line 269 of file dart_vm.cc.

◆ kMaxFrameMarkers

const size_t flutter::kMaxFrameMarkers = 8
static

Definition at line 19 of file stopwatch_dl.cc.

Referenced by flutter::DlStopwatchVisualizer::Visualize().

◆ kMaxSamples

const size_t flutter::kMaxSamples = 120
static

Definition at line 18 of file stopwatch_dl.cc.

Referenced by flutter::DlStopwatchVisualizer::Visualize().

◆ kMegaByteSizeInBytes

constexpr double flutter::kMegaByteSizeInBytes = (1 << 20)
constexpr

Definition at line 9 of file constants.h.

Referenced by FlutterDartProject::defaultBundleIdentifier.

◆ kMinCount

constexpr size_t flutter::kMinCount = 2
staticconstexpr

Definition at line 268 of file dart_vm.cc.

◆ kMinimumAndroidApiLevelForImpeller

constexpr int flutter::kMinimumAndroidApiLevelForImpeller = 29
constexpr

Definition at line 34 of file flutter_main.cc.

Referenced by flutter::FlutterMain::SelectedRenderingAPI().

◆ kMinPlatformViewId

constexpr int32_t flutter::kMinPlatformViewId = -1
constexpr

Definition at line 11 of file semantics_node.cc.

Referenced by flutter::SemanticsNode::IsPlatformViewNode().

◆ kNameKey

const char* flutter::kNameKey = "name"
static

Definition at line 27 of file callback_cache.cc.

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

◆ kNavigationChannel

constexpr char flutter::kNavigationChannel[] = "flutter/navigation"
staticconstexpr

Definition at line 25 of file engine.cc.

Referenced by flutter::Engine::DispatchPlatformMessage().

◆ kObjectCount

constexpr int flutter::kObjectCount = 3
constexpr

Definition at line 50 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kOpaqueBlack

constexpr int flutter::kOpaqueBlack = 0xff000000
constexpr

Definition at line 12 of file compositor_software.cc.

Referenced by flutter::CompositorSoftware::Present().

◆ kOrientationUpdateNotificationKey

const char *const flutter::kOrientationUpdateNotificationKey
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOrientationNotificationKey"

Definition at line 39 of file FlutterPlatformPlugin.mm.

◆ kOrientationUpdateNotificationName

const char *const flutter::kOrientationUpdateNotificationName
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOrientationNotificationName"

Definition at line 37 of file FlutterPlatformPlugin.mm.

◆ kOverlayStyleUpdateNotificationKey

const char *const flutter::kOverlayStyleUpdateNotificationKey
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOverlayNotificationKey"

Definition at line 43 of file FlutterPlatformPlugin.mm.

◆ kOverlayStyleUpdateNotificationName

const char *const flutter::kOverlayStyleUpdateNotificationName
Initial value:
=
"io.flutter.plugin.platform.SystemChromeOverlayNotificationName"

Definition at line 41 of file FlutterPlatformPlugin.mm.

◆ kPi

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

◆ kPollTimeoutTimerId

const uintptr_t flutter::kPollTimeoutTimerId = 1
static

Definition at line 16 of file task_runner_window.cc.

Referenced by flutter::TaskRunnerWindow::PollOnce().

◆ kRepresentationKey

const char* flutter::kRepresentationKey = "representation"
static

Definition at line 26 of file callback_cache.cc.

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

◆ kRootViewIdentifier

const auto flutter::kRootViewIdentifier = EmbedderExternalView::ViewIdentifier{}
static

Definition at line 17 of file embedder_external_view_embedder.cc.

17{};

◆ kScanCodeControlLeft

constexpr int flutter::kScanCodeControlLeft = 0x1d
constexpr

◆ kScanCodeControlRight

constexpr int flutter::kScanCodeControlRight = 0xe01d
constexpr

◆ kScanCodeShiftLeft

◆ kScanCodeShiftRight

constexpr int flutter::kScanCodeShiftRight = 0x36
constexpr

◆ kScrollableSemanticsActions

constexpr int flutter::kScrollableSemanticsActions
constexpr
Initial value:

Definition at line 60 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 45 of file dart_vm.cc.

45 {
46 // clang-format off
47 "--concurrent_mark=false",
48 "--concurrent_sweep=false",
49 "--compactor_tasks=1",
50 "--scavenger_tasks=0",
51 "--marker_tasks=0",
52 // clang-format on
53};

◆ kSettingsChannel

constexpr char flutter::kSettingsChannel[] = "flutter/settings"
staticconstexpr

Definition at line 27 of file engine.cc.

Referenced by flutter::Engine::DispatchPlatformMessage().

◆ kShaderIndex

constexpr int flutter::kShaderIndex = 0
constexpr

Definition at line 47 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kShift

◆ kSizeFactorSmall

const double flutter::kSizeFactorSmall = 0.3

Definition at line 324 of file dl_region_benchmarks.cc.

◆ kSkiaChannel

constexpr char flutter::kSkiaChannel[] = "flutter/skia"
constexpr

Definition at line 51 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.

13 {
14 // clang-format off
15 0, 4, 12,
16 1, 5, 13,
17 3, 7, 15,
18 // clang-format on
19};

Referenced by ToMatrix4(), and ToSkMatrix().

◆ kStderrStreamId

const char flutter::kStderrStreamId[] = "Stderr"
static

Definition at line 155 of file dart_vm.cc.

Referenced by ServiceStreamCancelCallback(), and ServiceStreamListenCallback().

◆ kStdoutStreamId

const char flutter::kStdoutStreamId[] = "Stdout"
static

Definition at line 154 of file dart_vm.cc.

Referenced by ServiceStreamCancelCallback(), and ServiceStreamListenCallback().

◆ kStrokeCapIndex

constexpr int flutter::kStrokeCapIndex = 9
constexpr

Definition at line 34 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kStrokeJoinIndex

constexpr int flutter::kStrokeJoinIndex = 10
constexpr

Definition at line 35 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kStrokeMiterLimitDefault

constexpr float flutter::kStrokeMiterLimitDefault = 4.0f
constexpr

Definition at line 58 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kStrokeMiterLimitIndex

constexpr int flutter::kStrokeMiterLimitIndex = 11
constexpr

Definition at line 36 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kStrokeWidthIndex

constexpr int flutter::kStrokeWidthIndex = 8
constexpr

Definition at line 33 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kStyleIndex

constexpr int flutter::kStyleIndex = 7
constexpr

Definition at line 32 of file paint.cc.

Referenced by flutter::Paint::paint().

◆ kSystemActions

constexpr int flutter::kSystemActions
constexpr
Initial value:
=
static_cast<int32_t>(SemanticsAction::kDidGainAccessibilityFocus) |
static_cast<int32_t>(SemanticsAction::kDidLoseAccessibilityFocus)

The following actions are not user-initiated.

Definition at line 64 of file semantics_node.h.

◆ kSystemChannel

constexpr char flutter::kSystemChannel[] = "flutter/system"
constexpr

Definition at line 52 of file shell.cc.

◆ kTypeKey

constexpr char flutter::kTypeKey[] = "type"
constexpr

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

Referenced by flutter::PlatformViewAndroidJNIImpl::GetDisplayRefreshRate(), and flutter::DisplayManager::GetMainDisplayRefreshRate().

◆ 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

constexpr int flutter::kVerticalScrollSemanticsActions
constexpr
Initial value:
=
static_cast<int32_t>(SemanticsAction::kScrollUp) |
static_cast<int32_t>(SemanticsAction::kScrollDown)

Definition at line 52 of file semantics_node.h.

◆ kViewIdPrefx

constexpr std::string_view flutter::kViewIdPrefx = "_flutterView/"
staticconstexpr

Definition at line 43 of file service_protocol.cc.

Referenced by CreateFlutterViewID().

◆ kVisualizeEngineStatistics

const int flutter::kVisualizeEngineStatistics = 1 << 3

Definition at line 21 of file performance_overlay_layer.h.

Referenced by flutter::PerformanceOverlayLayer::Paint().

◆ kVisualizeRasterizerStatistics

const int flutter::kVisualizeRasterizerStatistics = 1 << 1

◆ kVsyncFlowName

constexpr const char* flutter::kVsyncFlowName = "VsyncFlow"
staticconstexpr

Definition at line 17 of file vsync_waiter.cc.

Referenced by flutter::VsyncWaiter::FireCallback().

◆ kVsyncTraceName

constexpr const char* flutter::kVsyncTraceName = "VsyncProcessCallback"
staticconstexpr

Definition at line 19 of file vsync_waiter.cc.

Referenced by flutter::VsyncWaiter::FireCallback().

◆ manager

it will be possible to load the file into Perfetto s trace viewer use test 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 disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font flutter::manager

◆ mode

it will be possible to load the file into Perfetto s trace viewer use test 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 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 210 of file switch_defs.h.

Referenced by flutter::testing::BM_DrawPoints(), flutter::testing::BM_DrawVertices(), flutter::DrawAtlasOp::dispatch(), flutter::DrawAtlasCulledOp::dispatch(), flutter::DisplayListBuilder::DrawAtlas(), flutter::DlSkCanvasAdapter::DrawAtlas(), flutter::testing::DisplayListStreamDispatcher::drawAtlas(), flutter::DlSkCanvasDispatcher::drawAtlas(), flutter::DrawAtlasBaseOp::DrawAtlasBaseOp(), flutter::DrawAtlasCulledOp::DrawAtlasCulledOp(), flutter::DrawAtlasOp::DrawAtlasOp(), flutter::DisplayListBuilder::DrawColor(), flutter::DlSkCanvasAdapter::DrawColor(), flutter::DlSkCanvasDispatcher::drawColor(), flutter::testing::DisplayListStreamDispatcher::drawColor(), flutter::testing::DisplayListStreamDispatcher::drawPoints(), flutter::testing::DisplayListGeneralReceiver::drawPoints(), flutter::DlSkCanvasDispatcher::drawPoints(), flutter::DisplayListBuilder::DrawPoints(), flutter::DlSkCanvasAdapter::DrawPoints(), flutter::DlSkCanvasDispatcher::drawVertices(), flutter::testing::DisplayListStreamDispatcher::drawVertices(), flutter::DisplayListBuilder::DrawVertices(), flutter::DlSkCanvasAdapter::DrawVertices(), flutter::ImageFilter::filter(), flutter::testing::FilterModeToString(), impeller::testing::GetBlendModeSelection(), flutter::testing::GetTestVertices(), flutter::DlColorFilter::MakeBlend(), flutter::testing::PointModeToString(), flutter::PlatformConfigurationNativeApi::RequestDartPerformanceMode(), flutter::testing::SaveLayerExpectations::SaveLayerExpectations(), flutter::DlPaint::setBlendMode(), flutter::DlSkPaintDispatchHelper::setBlendMode(), flutter::testing::DisplayListStreamDispatcher::setBlendMode(), SetTextureLayout(), flutter::testing::TEST(), impeller::testing::TEST(), flutter::testing::DisplayListNopTest::test_attributes_image(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::DisplayListNopTest::test_mode_color_via_filter(), flutter::testing::DisplayListNopTest::test_mode_color_via_rendering(), impeller::testing::TEST_P(), ToSk(), ToSk(), and flutter::testing::VertexModeToString().

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

234 {
235 @(kModifierFlagShiftLeft) : @0x00000038,
236 @(kModifierFlagShiftRight) : @0x0000003c,
237 @(kModifierFlagControlLeft) : @0x0000003b,
238 @(kModifierFlagControlRight) : @0x0000003e,
239 @(kModifierFlagAltLeft) : @0x0000003a,
240 @(kModifierFlagAltRight) : @0x0000003d,
241 @(kModifierFlagMetaLeft) : @0x00000037,
242 @(kModifierFlagMetaRight) : @0x00000036,
243};

◆ name

DEF_SWITCHES_START aot vmservice shared library flutter::name

Definition at line 27 of file switch_defs.h.

Referenced by impeller::testing::GoldenDigest::AddDimension(), flutter::testing::DartFixture::AddFfiNativeCallback(), flutter::testing::TestDartNativeResolver::AddFfiNativeCallback(), flutter::testing::EmbedderTestContext::AddNativeCallback(), flutter::testing::DartFixture::AddNativeCallback(), flutter::testing::TestDartNativeResolver::AddNativeCallback(), flutter::testing::WindowsTestContext::AddNativeFunction(), flutter::FlutterEventTracer::addTraceEvent(), flutter::testing::DisplayListTestBase< BaseT >::Build(), flutter::testing::TestGLOnscreenOnlySurface::CreateGrContext(), flutter::testing::ThreadTest::CreateNewThread(), flutter::PlatformViewAndroid::DispatchEmptyPlatformMessage(), flutter::PlatformViewAndroid::DispatchPlatformMessage(), flutter::testing::EmbedderTestContextGL::EmbedderTestContextGL(), flutter::JsonMethodCodec::EncodeMethodCallInternal(), flutter::testing::FixtureNameForBackend(), impeller::testing::GetBlendModeSelection(), flutter::DartCallbackCache::GetCallbackHandle(), flutter::DartRuntimeHooks::GetCallbackHandle(), flutter::FlutterEventTracer::getCategoryGroupEnabled(), flutter::gpu::Shader::UniformBinding::GetMemberMetadata(), flutter::testing::TestGLOnscreenOnlySurface::GetProcAddress(), flutter::AssetManagerFontStyleSet::getStyle(), txt::TypefaceFontStyleSet::getStyle(), flutter::gpu::Shader::GetUniformStruct(), flutter::gpu::Shader::GetUniformTexture(), flutter::testing::EmbedderTestContextGL::GLGetProcAddress(), flutter::testing::EmbedderTestContextVulkan::InstanceProcAddr(), InternalFlutterGpu_Shader_GetUniformStructSize(), InvokeFunction(), LookupEntryPoint(), flutter::IsolateNameServer::LookupIsolatePortByName(), flutter::IsolateNameServerNatives::LookupPortByName(), flutter::gpu::ShaderLibrary::MakeFromAsset(), impeller::testing::mockGetIntegerv(), impeller::testing::mockGetString(), impeller::testing::mockGetStringi(), impeller::testing::mockObjectLabelKHR(), flutter::IsolateNameServer::RegisterIsolatePortWithName(), flutter::IsolateNameServerNatives::RegisterPortWithName(), flutter::IsolateNameServer::RemoveIsolateNameMapping(), flutter::IsolateNameServerNatives::RemovePortNameMapping(), flutter::internal::ResizeChannel(), flutter::PlatformConfigurationNativeApi::SendChannelUpdate(), flutter::PlatformConfigurationNativeApi::SendPlatformMessage(), flutter::PlatformConfigurationNativeApi::SendPortPlatformMessage(), flutter::internal::SetChannelWarnsOnOverflow(), flutter::PlatformConfigurationNativeApi::SetIsolateDebugName(), SettingsFromCommandLine(), flutter::testing::ShellTestPlatformViewGL::ShellTestPlatformViewGL(), flutter::testing::SignalHandler::SignalHandler(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::FlutterEventTracer::updateTraceEventDuration(), flutter::testing::OncePerBackendWarning::warn(), flutter::testing::WriteImageToDisk(), and flutter::AccessibilityBridgeMac::~AccessibilityBridgeMac().

◆ 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 52 of file switch_defs.h.

Referenced by flutter::testing::ClipExpector::addExpectation(), flutter::testing::MockRasterCache::AddMockLayer(), flutter::DlPathBuilder::AddPath(), flutter::testing::BM_DrawPath(), flutter::testing::BM_DrawShadow(), flutter::Canvas::clipPath(), flutter::LayerStateStack::MutatorContext::clipPath(), flutter::testing::ClipExpector::clipPath(), flutter::DlSkCanvasAdapter::ClipPath(), flutter::DlSkCanvasDispatcher::clipPath(), flutter::testing::DisplayListStreamDispatcher::clipPath(), flutter::DisplayListBuilder::ClipPath(), flutter::DisplayListMatrixClipState::clipPath(), flutter::DlCanvasDelegate::clipPath(), flutter::PrerollDelegate::clipPath(), Close(), flutter::DlCanvas::ComputeShadowBounds(), flutter::testing::MyNativeClass::Create(), flutter::CanvasPathMeasure::Create(), CreatePath(), CubicTo(), DartFileModifiedCallback(), DartFileRecorderArgs(), flutter::DartProject::DartProject(), Data(), DestroyPath(), flutter::DlPath::Dispatch(), flutter::Canvas::drawPath(), flutter::DlSkCanvasDispatcher::drawPath(), flutter::testing::DisplayListStreamDispatcher::drawPath(), flutter::DisplayListBuilder::DrawPath(), flutter::DlSkCanvasAdapter::DrawPath(), flutter::Canvas::drawShadow(), flutter::DisplayListBuilder::DrawShadow(), flutter::DlSkCanvasAdapter::DrawShadow(), flutter::DlSkCanvasDispatcher::drawShadow(), flutter::testing::DisplayListStreamDispatcher::drawShadow(), flutter::DlSkCanvasDispatcher::DrawShadow(), GetFileMapping(), GetFillType(), LineTo(), LoadDartDeferredLibrary(), LoadLibraryFromKernel(), flutter::testing::MockLayer::Make(), flutter::DlPath::MakeArc(), flutter::testing::MockLayer::MakeOpacityCompatible(), impeller::testing::MaskBlurVariantTest(), MoveTo(), NativeAssetsDlopen(), NativeAssetsDlopenRelative(), flutter::DlPath::operator+(), flutter::testing::DisplayListStreamDispatcher::out(), flutter::MutatorsStack::PushClipPath(), flutter::SceneBuilder::pushClipPath(), Reset(), flutter::EmbedderResources::ResourceLookup(), SearchMapping(), flutter::PersistentCache::SetCacheDirectoryPath(), flutter::DartCallbackCache::SetCachePath(), flutter::CanvasPathMeasure::setPath(), impeller::testing::WorkingDirectory::SetPath(), SettingsFromCommandLine(), flutter::DlPathBuilder::TakePath(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::testing::TestPathDispatchClosedTriangle(), flutter::testing::TestPathDispatchConicToQuads(), flutter::testing::TestPathDispatchImplicitMoveAfterClose(), flutter::testing::TestPathDispatchMixedCloseTriangles(), flutter::testing::TestPathDispatchOneOfEachVerb(), flutter::testing::TestPathDispatchUnclosedTriangle(), flutter::DlPath::WithFillType(), flutter::DlPath::WithOffset(), flutter::testing::SkRenderResult::write(), flutter::testing::ImpellerRenderResult::write(), flutter::testing::DlMetalPixelData::write(), and impeller::testing::MetalScreenshot::WriteToPNG().

◆ path_class

fml::jni::ScopedJavaGlobalRef<jclass>* flutter::path_class = nullptr
static

◆ path_close_method

jmethodID flutter::path_close_method = nullptr
static

◆ path_conic_to_method

jmethodID flutter::path_conic_to_method = nullptr
static

◆ path_constructor

jmethodID flutter::path_constructor = nullptr
static

◆ path_cubic_to_method

jmethodID flutter::path_cubic_to_method = nullptr
static

◆ path_line_to_method

jmethodID flutter::path_line_to_method = nullptr
static

◆ path_move_to_method

jmethodID flutter::path_move_to_method = nullptr
static

◆ path_quad_to_method

jmethodID flutter::path_quad_to_method = nullptr
static

◆ path_set_fill_type_method

jmethodID flutter::path_set_fill_type_method = nullptr
static

◆ policy

it will be possible to load the file into Perfetto s trace viewer use test 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 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

◆ rendering

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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not the profiler sample buffer is used as a ring meaning that once it is new samples start overwriting the oldest ones This switch is only meaningful when set in conjunction with enable dart profiling enable software flutter::rendering

Definition at line 108 of file switch_defs.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 disable vm flutter::service

Definition at line 79 of file switch_defs.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 defaults to or::depending on whether ipv6 is specified disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile Make the profiler discard new samples once the profiler sample buffer is full When this flag is not flutter::set

◆ size

it will be possible to load the file into Perfetto s trace viewer use test 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 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 241 of file switch_defs.h.

Referenced by flutter::AndroidSurfaceSoftware::AcquireBackingStore(), flutter::TesterPlatformView::AcquireBackingStore(), flutter::GPUSurfaceGLSkia::AcquireFrame(), flutter::GPUSurfaceSoftware::AcquireFrame(), flutter::EmbedderSurfaceVulkan::AcquireImage(), flutter::EmbedderSurfaceVulkanImpeller::AcquireImage(), flutter::testing::BM_DrawArc(), flutter::testing::BM_DrawImageNine(), flutter::testing::BM_DrawImageRect(), flutter::testing::BM_DrawOval(), flutter::testing::BM_DrawRect(), flutter::PlatformMessageResponseDart::Complete(), ConvertMappingToNSData(), ConvertSize(), flutter::CompositorSoftware::CreateBackingStore(), flutter::FlutterCompositor::CreateBackingStore(), flutter::testing::TestVulkanContext::CreateImage(), flutter::testing::TestMetalContext::CreateMetalTexture(), CreateSnapshotSurface(), flutter::MessageCodec< T >::DecodeMessage(), flutter::MethodCodec< T >::DecodeMethodCall(), FillAllIndices(), flutter::FlutterSkiaVulkanMemoryAllocator::flushMemory(), flutter::DlImageSkia::GetApproximateByteSize(), flutter::DlDeferredImageGPUImpeller::GetApproximateByteSize(), flutter::DlImageGPU::GetApproximateByteSize(), flutter::testing::GetDebuggerStatus(), flutter::DisplayListBuilder::GetImageInfo(), flutter::EmbedderRenderTargetImpeller::GetRenderTargetSize(), flutter::BuiltinSkiaCodecImageGenerator::GetScaledDimensions(), GetSymbolMapping(), flutter::FlutterWindow::InitializeChild(), flutter::FlutterSkiaVulkanMemoryAllocator::invalidateMemory(), flutter::BoxConstraints::IsSatisfiedBy(), flutter::DlDeferredImageGPUImpeller::Make(), flutter::gpu::ShaderLibrary::MakeFromFlatbuffer(), flutter::DlRegion::MakeIntersection(), flutter::SnapshotControllerSkia::MakeRasterSnapshotSync(), flutter::testing::CanvasCompareTester::MakeTextBlob(), impeller::testing::BlendFilterContentsTest::MakeTexture(), impeller::testing::GaussianBlurFilterContentsTest::MakeTexture(), impeller::testing::MatrixFilterContentsTest::MakeTexture(), flutter::DlRegion::MakeUnion(), txt::MatchSystemUIFont(), flutter::testing::MemsetPatternSetOrCheck(), impeller::testing::mockDeleteQueriesEXT(), impeller::testing::mockDeleteTextures(), flutter::testing::NormalizeImage(), flutter::PlatformViewAndroid::NotifyChanged(), flutter::OffscreenSurface::OffscreenSurface(), flutter::FlutterWindow::OnCursorRectUpdated(), flutter::AndroidSurfaceDynamicImpeller::OnScreenSurfaceResize(), flutter::AndroidSurfaceGLSkia::OnScreenSurfaceResize(), flutter::AndroidSurfaceVKImpeller::OnScreenSurfaceResize(), ParseLanguageName(), flutter::PlatformHandler::PlatformHandler(), flutter::StandardCodecSerializer::ReadValueOfType(), flutter::SomeDataExtensionSerializer::ReadValueOfType(), impeller::testing::RectMakeCenterSize(), flutter::testing::ResetAssetManager(), flutter::HostWindow::SetContentSize(), impeller::testing::SetSwapchainImageSize(), flutter::testing::DisplayListRenderingTestBase< BaseT >::TearDownTestSuite(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), TEST(), TEST(), impeller::testing::TEST(), impeller::testing::TEST(), impeller::testing::TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), flutter::testing::TestGLOnscreenOnlySurface::TestGLOnscreenOnlySurface(), ToDlISize(), ToSkISize(), ToSkSize(), ToSkVector(), TransformedSurfaceSize(), flutter::DirectManipulationOwner::Update(), WrapOnscreenSurface(), flutter::StandardCodecSerializer::WriteSize(), and flutter::StandardCodecSerializer::WriteValue().

◆ 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 disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set profile flutter::startup

Definition at line 95 of file switch_defs.h.

◆ tracing

it will be possible to load the file into Perfetto s trace viewer use test 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 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 265 of file switch_defs.h.

◆ validation

it will be possible to load the file into Perfetto s trace viewer use test 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 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 256 of file switch_defs.h.