Namespaces

Records

Functions

  • glm::vec4 Homogenize (const glm::vec4 & vector)

    Homogenizes |vector|. Does not perform safety checks beyond if vector.w == 0.

    Defined at line 9 of file ../../src/ui/scenic/lib/utils/math.cc

  • bool validate_eventpair (const zx::eventpair & a_object, zx_rights_t a_rights, const zx::eventpair & b_object, zx_rights_t b_rights)

    True IFF eventpairs are valid, are peers, and have expected rights.

    Defined at line 11 of file ../../src/ui/scenic/lib/utils/validate_eventpair.cc

  • template <typename T, size_t N>
    const fidl::Array<T, N> & ReinterpretStdArrayAsFidlArray (const std::array<T, N> & std_array)

    Defined at line 15 of file ../../src/ui/scenic/lib/utils/fidl_array_cast.h

  • fpromise::promise<> sleep_for_a_little_while ()

    Returns a task that completes a little later.

    Used by examples to simulate the passage of time in asynchronous logic.

    Defined at line 16 of file ../../sdk/lib/fit-promise/tests/examples/utils.cc

  • glm::vec2 TransformPointerCoords (const glm::vec2 & pointer, const glm::mat4 & transform)

    Applies |transform| to |pointer| by converting it to 3D and back again.

    Defined at line 16 of file ../../src/ui/scenic/lib/utils/math.cc

  • void ExecuteOrPostTaskOnDispatcher (async_dispatcher_t * dispatcher, fit::closure handler)

    If `dispatcher` is the current dispatcher, invoke the `handler` closure immediately. Otherwise,

    post a task to invoke `handler`.

    Defined at line 17 of file ../../src/ui/scenic/lib/utils/task_utils.h

  • uint8_t LinearToSrgb (const float val)

    Defined at line 20 of file ../../src/ui/scenic/lib/utils/pixel.cc

  • escher::EscherUniquePtr CreateEscher (sys::ComponentContext * app_context, const fidl::SyncClient<fuchsia_io::Directory> & pkg_dir)

    Defined at line 25 of file ../../src/ui/scenic/lib/utils/escher_provider.cc

  • zx_time_t dispatcher_clock_now ()

    Obtain the default dispatcher's notion of timestamp "now" in Scenic. This

    function also helps to reduce clutter and boilerplate.

    It devolves to zx_clock_get_monotonic() for non-test execution, but uses an

    alternate timebase in test situations, which reduces test flakes.

    To get it as zx::time, just wrap the result with zx::time().

    If you have a specific dispatcher you'd like to use, then request the time

    directly from that dispatcher. E.g.,

    zx_time_t now = async_now(dispatcher);

    zx::time now = async::Now(dispatcher);

    Defined at line 27 of file ../../src/ui/scenic/lib/utils/time.h

  • void resume_in_a_little_while (fpromise::suspended_task task)

    Resumes the task after some time has elapsed.

    Used by examples to simulate the passage of time in asynchronous logic.

    Defined at line 27 of file ../../sdk/lib/fit-promise/tests/examples/utils.cc

  • std::array<float, 9> Mat4ToColumnMajorMat3Array (const glm::mat4 & mat)

    Converts a glm::mat4 to an array of a mat3 in column major order by shaving off the third row

    and column. This is valid for 2D-in-3D transforms affecting the xy-plane (i.e. how 2D content is

    handled in GFX).

    Mat4 Mat3 array

    [ 1 2 3 4 ] [ 1 2 4 ]

    [ 5 6 7 8 ] -> [ 5 6 8 ] -> [ 1 5 13 2 6 14 4 8 16 ]

    [ 9 10 11 12 ] [ 13 14 16 ]

    [ 13 14 15 16 ]

    Defined at line 23 of file ../../src/ui/scenic/lib/utils/math.cc

  • glm::mat4 ColumnMajorMat3ArrayToMat4 (const std::array<float, 9> & matrix_array)

    Transforms a column major mat3 in array format to a glm::mat4.

    It is the inverse operation of Mat4ToColumnMajorMat3Array().

    Defined at line 28 of file ../../src/ui/scenic/lib/utils/math.cc

  • std::ostream & operator<< (std::ostream & os, const zx::time value)

    Defined at line 29 of file ../../src/ui/scenic/lib/utils/time.h

  • template <typename T, size_t N>
    const std::array<T, N> & ReinterpretFidlArrayAsStdArray (const fidl::Array<T, N> & fidl_array)

    Defined at line 29 of file ../../src/ui/scenic/lib/utils/fidl_array_cast.h

  • zx_koid_t ExtractKoid (const fuchsia::ui::views::ViewRef & view_ref)

    Helper for extracting the koid from a ViewRef.

    Defined at line 30 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • std::ostream & operator<< (std::ostream & os, const zx::duration value)

    Defined at line 33 of file ../../src/ui/scenic/lib/utils/time.h

  • std::vector<escher::SamplerPtr> ImmutableSamplersForShaderWarmup (escher::EscherWeakPtr escher, vk::Filter filter)

    Generate a list of immutable samplers for combinations of YUV formats and color spaces that are

    supported by Flatland and GFX. These can be used for shader warm-up, and are also stashed in

    Escher's sampler cache.

    Defined at line 42 of file ../../src/ui/scenic/lib/utils/shader_warmup.cc

  • bool validate_viewref (const fuchsia::ui::views::ViewRefControl & control_ref, const fuchsia::ui::views::ViewRef & view_ref)

    True IFF ViewRefControl and ViewRef are valid, are peers, and have expected

    rights.

    - The control ref is expected to have ZX_DEFAULT_EVENTPAIR_RIGHTS.

    - The view ref is expected to have ZX_RIGHTS_BASIC.

    Defined at line 62 of file ../../src/ui/scenic/lib/utils/validate_eventpair.cc

  • bool validate_viewref (const fuchsia_ui_views::ViewRefControl & control_ref, const fuchsia_ui_views::ViewRef & view_ref)

    Defined at line 67 of file ../../src/ui/scenic/lib/utils/validate_eventpair.cc

  • zx_koid_t ExtractKoid (const fuchsia_ui_views::ViewRef & view_ref)

    Defined at line 35 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • zx::event CreateEvent ()

    Create an unsignalled zx::event.

    Defined at line 63 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • std::vector<zx::event> CreateEventArray (size_t n)

    Create a std::vector populated with |n| unsignalled zx::event elements.

    Defined at line 70 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • zx::counter CreateCounter ()

    Create a zx::counter with initial value 0.

    Defined at line 80 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • std::vector<zx::counter> CreateCounterArray (size_t n)

    Create a std::vector populated with |n| zx::counter elements.

    Defined at line 87 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • template <typename T>
    T CopyZxHandle (const T & handle)

    Copy a zx object handle.

    Defined at line 93 of file ../../src/ui/scenic/lib/utils/helpers.h

  • std::vector<zx_koid_t> ExtractKoids (const std::vector<zx::event> & events)

    Create a std::vector populated with koids of the input vector of zx:event.

    Defined at line 97 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • template <typename T>
    std::vector<T> CopyZxHandleVector (const std::vector<T> & handles)

    Copy a std::vector of zx object handles.

    Defined at line 105 of file ../../src/ui/scenic/lib/utils/helpers.h

  • VkBool32 HandleDebugUtilsMessage (VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, VkDebugUtilsMessageTypeFlagsEXT message_types, const VkDebugUtilsMessengerCallbackDataEXT * callback_data, void * user_data)

    Defined at line 145 of file ../../src/ui/scenic/lib/utils/escher_provider.cc

  • std::ostream & operator<< (std::ostream & stream, const utils::Pixel & pixel)

    Defined at line 135 of file ../../src/ui/scenic/lib/utils/pixel.cc

  • bool IsEventSignalled (const zx::event & event, zx_signals_t signal)

    Synchronously checks whether the event has signalled any of the bits in |signal|.

    Defined at line 40 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • bool IsCounterSignalled (const zx::counter & counter, zx_signals_t signal)

    Synchronously checks whether the counter has signalled any of the bits in |signal|.

    Defined at line 49 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • int64_t ReadCounter (const zx::counter & counter)

    Synchronously reads the value of the counter.

    Defined at line 55 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • fidl::WireClient<fuchsia_sysmem2::Allocator> CreateSysmemAllocatorClient (async_dispatcher_t * dispatcher, const std::string & debug_name_suffix)

    Create sysmem allocator.

    Defined at line 110 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • fidl::WireClient<fuchsia_sysmem2::Allocator> CreateSysmemAllocatorClientWithSvc (sys::ServiceDirectory * svc, async_dispatcher_t * dispatcher, const std::string & debug_name_suffix)

    Create sysmem allocator.

    Defined at line 117 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • template <std::size_t Dim>
    std::string GetArrayString (const std::string & name, const std::array<float, Dim> & array)

    Defined at line 143 of file ../../src/ui/scenic/lib/utils/helpers.h

  • fuchsia::sysmem2::BufferCollectionConstraints CreateDefaultConstraints (uint32_t buffer_count, uint32_t kWidth, uint32_t kHeight, fuchsia::images2::PixelFormat format, bool set_min_max_size)

    Creates default constraints for |buffer_collection|

    Defined at line 146 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • void PrettyPrintMat3 (std::string , const std::array<float, 9> & mat3)

    Prints in row-major order.

    Defined at line 172 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • float GetOrientationAngle (fuchsia::ui::composition::Orientation orientation)

    Defined at line 180 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • float GetOrientationAngle (fuchsia_ui_composition::Orientation orientation)

    Defined at line 193 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerPixel (const fuchsia::sysmem2::SingleBufferSettings & settings)

    Defined at line 227 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerPixel (const fuchsia::sysmem::SingleBufferSettings & settings)

    Defined at line 230 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerPixel (const fuchsia::sysmem2::ImageFormatConstraints & image_format_constraints)

    Defined at line 234 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerPixel (const fuchsia::sysmem::ImageFormatConstraints & image_format_constraints)

    Defined at line 247 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerRow (const fuchsia::sysmem2::SingleBufferSettings & settings, uint32_t image_width)

    Defined at line 254 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerRow (const fuchsia::sysmem::SingleBufferSettings & settings, uint32_t image_width)

    Defined at line 258 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerRow (const fuchsia::sysmem2::ImageFormatConstraints & image_format_constraints, uint32_t image_width)

    Defined at line 263 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetBytesPerRow (const fuchsia::sysmem::ImageFormatConstraints & image_format_constraints, uint32_t image_width)

    Defined at line 268 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetPixelsPerRow (const fuchsia::sysmem2::SingleBufferSettings & settings, uint32_t image_width)

    Defined at line 274 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetPixelsPerRow (const fuchsia::sysmem::SingleBufferSettings & settings, uint32_t image_width)

    Defined at line 279 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetPixelsPerRow (const fuchsia::sysmem2::ImageFormatConstraints & image_format_constraints, uint32_t image_width)

    Defined at line 284 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • uint32_t GetPixelsPerRow (const fuchsia::sysmem::ImageFormatConstraints & image_format_constraints, uint32_t image_width)

    Defined at line 289 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • void SignalReleaseFences (const std::vector<zx::event> & fences)

    Signal all fences with ZX_EVENT_SIGNALED.

    Defined at line 295 of file ../../src/ui/scenic/lib/utils/helpers.cc

  • void SignalPresentFences (const std::vector<zx::counter> & fenceszx::time timestamp)

    Defined at line 302 of file ../../src/ui/scenic/lib/utils/helpers.cc