diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 03e7c4e7a59d8..5c009c56dc124 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -26,6 +26,7 @@ #include "third_party/skia/include/core/SkSerialProcs.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/include/encode/SkPngEncoder.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" @@ -696,6 +697,9 @@ static sk_sp ScreenshotLayerTreeAsPicture( #else SkSerialProcs procs = {0}; procs.fTypefaceProc = SerializeTypefaceWithData; + procs.fImageProc = [](SkImage* img, void*) -> sk_sp { + return SkPngEncoder::Encode(nullptr, img, SkPngEncoder::Options{}); + }; #endif return recorder.finishRecordingAsPicture()->serialize(&procs);