#include <ios_surface_software.h>
Definition at line 21 of file ios_surface_software.h.
◆ IOSSurfaceSoftware()
flutter::IOSSurfaceSoftware::IOSSurfaceSoftware |
( |
const fml::scoped_nsobject< CALayer > & |
layer, |
|
|
std::shared_ptr< IOSContext > |
context |
|
) |
| |
◆ ~IOSSurfaceSoftware()
flutter::IOSSurfaceSoftware::~IOSSurfaceSoftware |
( |
| ) |
|
|
overridedefault |
◆ AcquireBackingStore()
sk_sp< SkSurface > flutter::IOSSurfaceSoftware::AcquireBackingStore |
( |
const SkISize & |
size | ) |
|
|
override |
Definition at line 53 of file ios_surface_software.mm.
54 TRACE_EVENT0(
"flutter",
"IOSSurfaceSoftware::AcquireBackingStore");
59 if (sk_surface_ !=
nullptr &&
60 SkISize::Make(sk_surface_->width(), sk_surface_->height()) == size) {
65 SkImageInfo info = SkImageInfo::MakeN32(size.fWidth, size.fHeight, kPremul_SkAlphaType,
66 SkColorSpace::MakeSRGB());
67 sk_surface_ = SkSurfaces::Raster(info,
nullptr);
References IsValid().
◆ CreateGPUSurface()
std::unique_ptr< Surface > flutter::IOSSurfaceSoftware::CreateGPUSurface |
( |
GrDirectContext * |
gr_context = nullptr | ) |
|
|
overridevirtual |
◆ IsValid()
bool flutter::IOSSurfaceSoftware::IsValid |
( |
| ) |
const |
|
overridevirtual |
◆ PresentBackingStore()
bool flutter::IOSSurfaceSoftware::PresentBackingStore |
( |
sk_sp< SkSurface > |
backing_store | ) |
|
|
override |
Definition at line 71 of file ios_surface_software.mm.
72 TRACE_EVENT0(
"flutter",
"IOSSurfaceSoftware::PresentBackingStore");
73 if (!
IsValid() || backing_store ==
nullptr) {
78 if (!backing_store->peekPixels(&pixmap)) {
83 uint64_t expected_pixmap_data_size = pixmap.width() * pixmap.height() * 4;
85 const size_t pixmap_size = pixmap.computeByteSize();
87 if (expected_pixmap_data_size != pixmap_size) {
91 fml::CFRef<CGColorSpaceRef> colorspace(CGColorSpaceCreateDeviceRGB());
94 fml::CFRef<CGDataProviderRef> pixmap_data_provider(CGDataProviderCreateWithData(
101 if (!pixmap_data_provider) {
106 fml::CFRef<CGImageRef> pixmap_image(CGImageCreate(pixmap.width(),
112 kCGImageAlphaPremultipliedLast,
113 pixmap_data_provider,
116 kCGRenderingIntentDefault
123 layer_.get().contents = (__bridge id)(
static_cast<CGImageRef
>(pixmap_image));
References IsValid().
◆ UpdateStorageSizeIfNecessary()
void flutter::IOSSurfaceSoftware::UpdateStorageSizeIfNecessary |
( |
| ) |
|
|
overridevirtual |
The documentation for this class was generated from the following files: