diff options
author | Nathaniel Nifong <nifong@google.com> | 2020-01-30 14:38:21 -0500 |
---|---|---|
committer | Nathaniel Nifong <nifong@google.com> | 2020-01-30 16:01:43 -0500 |
commit | 429fff4bcc73be620e9eb8ee1269963fa3fd2dc8 (patch) | |
tree | 16ca252866177cf24da3cc98969498ac6814e1b6 | |
parent | b2cbd9dcc2734b1905a8c79c3a903889525540ab (diff) |
Provide a typeface proc during SKP serialization that forces typefaces to be written.
Test: flashed to Pixel 3, confirmed system typeface is written, normal drawing unaffected.
Change-Id: I0016224f628b4e564670cc05b982460ff001b6ac
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaPipeline.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp index 35a885f46919..82835d4154bc 100644 --- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp @@ -24,6 +24,7 @@ #include <SkOverdrawColorFilter.h> #include <SkPicture.h> #include <SkPictureRecorder.h> +#include <SkTypeface.h> #include <SkSerialProcs.h> #include "LightingInfo.h" #include "VectorDrawable.h" @@ -264,6 +265,9 @@ bool SkiaPipeline::setupMultiFrameCapture() { SkSerialProcs procs; procs.fImageProc = SkSharingSerialContext::serializeImage; procs.fImageCtx = mSerialContext.get(); + procs.fTypefaceProc = [](SkTypeface* tf, void* ctx){ + return tf->serialize(SkTypeface::SerializeBehavior::kDoIncludeData); + }; // SkDocuments don't take owership of the streams they write. // we need to keep it until after mMultiPic.close() // procs is passed as a pointer, but just as a method of having an optional default. @@ -405,6 +409,10 @@ void SkiaPipeline::endCapture(SkSurface* surface) { std::invoke(mPictureCapturedCallback, std::move(picture)); } else { // single frame skp to file + SkSerialProcs procs; + procs.fTypefaceProc = [](SkTypeface* tf, void* ctx){ + return tf->serialize(SkTypeface::SerializeBehavior::kDoIncludeData); + }; auto data = picture->serialize(); savePictureAsync(data, mCapturedFile); mCaptureSequence = 0; |