Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit aff58e3

Browse files
committed
[fuchsia][skp warmup] dont serialize font data
1 parent 838ee77 commit aff58e3

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

shell/common/rasterizer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ static sk_sp<SkData> ScreenshotLayerTreeAsPicture(
479479
#if defined(OS_FUCHSIA)
480480
SkSerialProcs procs = {0};
481481
procs.fImageProc = SerializeImageWithoutData;
482+
procs.fTypefaceProc = SerializeTypefaceWithoutData;
482483
#else
483484
SkSerialProcs procs = {0};
484485
procs.fTypefaceProc = SerializeTypefaceWithData;

shell/common/serialization_callbacks.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@
77
#include "include/core/SkPicture.h"
88
#include "include/core/SkStream.h"
99
#include "include/core/SkTypeface.h"
10+
#include "include/core/SkSerialProcs.h"
11+
1012

1113
namespace flutter {
1214

1315
sk_sp<SkData> SerializeTypefaceWithoutData(SkTypeface* typeface, void* ctx) {
14-
return typeface->serialize(SkTypeface::SerializeBehavior::kDoIncludeData);
16+
return SkData::MakeEmpty();
1517
}
1618

1719
sk_sp<SkData> SerializeTypefaceWithData(SkTypeface* typeface, void* ctx) {
18-
return typeface->serialize(SkTypeface::SerializeBehavior::kDontIncludeData);
20+
return typeface->serialize(SkTypeface::SerializeBehavior::kDoIncludeData);
21+
}
22+
23+
sk_sp<SkTypeface> DeserializeTypefaceWithoutData(const void* data, size_t length, void* ctx){
24+
return SkTypeface::MakeDefault();
1925
}
2026

2127
struct ImageMetaData {

shell/common/serialization_callbacks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ namespace flutter {
1515

1616
sk_sp<SkData> SerializeTypefaceWithoutData(SkTypeface* typeface, void* ctx);
1717
sk_sp<SkData> SerializeTypefaceWithData(SkTypeface* typeface, void* ctx);
18+
sk_sp<SkTypeface> DeserializeTypefaceWithoutData(const void* data, size_t length, void* ctx);
1819

1920
// Serializes only the metadata of the image and not the underlying pixel data.
2021
sk_sp<SkData> SerializeImageWithoutData(SkImage* image, void* ctx);
2122
sk_sp<SkImage> DeserializeImageWithoutData(const void* data,
2223
size_t length,
2324
void* ctx);
2425

26+
2527
} // namespace flutter
2628

2729
#endif // FLUTTER_SHELL_COMMON_SERIALIZATION_CALLBACKS_H_

0 commit comments

Comments
 (0)