Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
pixel_formats.cc File Reference
#include "flutter/shell/platform/embedder/pixel_formats.h"
#include "flutter/shell/platform/embedder/embedder.h"
#include "third_party/skia/include/core/SkColorSpace.h"
#include "third_party/skia/include/core/SkColorType.h"
#include "third_party/skia/include/core/SkImageInfo.h"

Go to the source code of this file.

Functions

std::optional< SkColorTypegetSkColorType (FlutterSoftwarePixelFormat pixfmt)
 
std::optional< SkColorInfogetSkColorInfo (FlutterSoftwarePixelFormat pixfmt)
 

Function Documentation

◆ getSkColorInfo()

std::optional< SkColorInfo > getSkColorInfo ( FlutterSoftwarePixelFormat  pixfmt)

Definition at line 34 of file pixel_formats.cc.

34 {
35 auto ct = getSkColorType(pixfmt);
36 if (!ct) {
37 return std::nullopt;
38 }
39
42
43 return SkColorInfo(*ct, at, SkColorSpace::MakeSRGB());
44}
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
SK_API bool SkColorTypeIsAlwaysOpaque(SkColorType ct)
static sk_sp< SkColorSpace > MakeSRGB()
std::optional< SkColorType > getSkColorType(FlutterSoftwarePixelFormat pixfmt)

◆ getSkColorType()

std::optional< SkColorType > getSkColorType ( FlutterSoftwarePixelFormat  pixfmt)

Definition at line 12 of file pixel_formats.cc.

12 {
13 switch (pixfmt) {
27 return kN32_SkColorType;
28 default:
29 FML_LOG(ERROR) << "Invalid software rendering pixel format";
30 return std::nullopt;
31 }
32}
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
Definition SkColorType.h:23
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition SkColorType.h:26
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition SkColorType.h:35
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
Definition SkColorType.h:22
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
@ kRGB_888x_SkColorType
pixel with 8 bits each for red, green, blue; in 32-bit word
Definition SkColorType.h:25
@ kFlutterSoftwarePixelFormatRGBA4444
Definition embedder.h:345
@ kFlutterSoftwarePixelFormatRGBA8888
Definition embedder.h:349
@ kFlutterSoftwarePixelFormatBGRA8888
Definition embedder.h:357
@ kFlutterSoftwarePixelFormatGray8
Definition embedder.h:337
@ kFlutterSoftwarePixelFormatNative32
Definition embedder.h:361
@ kFlutterSoftwarePixelFormatRGBX8888
Definition embedder.h:353
@ kFlutterSoftwarePixelFormatRGB565
Definition embedder.h:341
#define FML_LOG(severity)
Definition logging.h:82
#define ERROR(message)