Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions shell/platform/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(

if (!surface) {
FML_LOG(ERROR) << "Could not wrap embedder supplied render texture.";
texture->destruction_callback(texture->user_data);
if (texture->destruction_callback) {
texture->destruction_callback(texture->user_data);
}
return nullptr;
}

Expand Down Expand Up @@ -512,7 +514,9 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(

if (!surface) {
FML_LOG(ERROR) << "Could not wrap embedder supplied frame-buffer.";
framebuffer->destruction_callback(framebuffer->user_data);
if (framebuffer->destruction_callback) {
framebuffer->destruction_callback(framebuffer->user_data);
}
return nullptr;
}
return surface;
Expand All @@ -537,7 +541,9 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
captures->user_data = software->user_data;
auto release_proc = [](void* pixels, void* context) {
auto captures = reinterpret_cast<Captures*>(context);
captures->destruction_callback(captures->user_data);
if (captures->destruction_callback) {
captures->destruction_callback(captures->user_data);
}
};

auto surface = SkSurface::MakeRasterDirectReleaseProc(
Expand All @@ -551,7 +557,9 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
if (!surface) {
FML_LOG(ERROR)
<< "Could not wrap embedder supplied software render buffer.";
software->destruction_callback(software->user_data);
if (software->destruction_callback) {
software->destruction_callback(software->user_data);
}
return nullptr;
}
return surface;
Expand Down