#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 51 of file ios_surface_software.mm.
52 TRACE_EVENT0(
"flutter",
"IOSSurfaceSoftware::AcquireBackingStore");
57 if (sk_surface_ !=
nullptr &&
58 SkISize::Make(sk_surface_->width(), sk_surface_->height()) == size) {
63 SkImageInfo info = SkImageInfo::MakeN32(size.fWidth, size.fHeight, kPremul_SkAlphaType,
64 SkColorSpace::MakeSRGB());
65 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 69 of file ios_surface_software.mm.
70 TRACE_EVENT0(
"flutter",
"IOSSurfaceSoftware::PresentBackingStore");
71 if (!
IsValid() || backing_store ==
nullptr) {
76 if (!backing_store->peekPixels(&pixmap)) {
81 uint64_t expected_pixmap_data_size = pixmap.width() * pixmap.height() * 4;
83 const size_t pixmap_size = pixmap.computeByteSize();
85 if (expected_pixmap_data_size != pixmap_size) {
89 fml::CFRef<CGColorSpaceRef> colorspace(CGColorSpaceCreateDeviceRGB());
92 fml::CFRef<CGDataProviderRef> pixmap_data_provider(CGDataProviderCreateWithData(
99 if (!pixmap_data_provider) {
104 fml::CFRef<CGImageRef> pixmap_image(CGImageCreate(pixmap.width(),
110 kCGImageAlphaPremultipliedLast,
111 pixmap_data_provider,
114 kCGRenderingIntentDefault
121 layer_.get().contents =
reinterpret_cast<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: