1cb93a386Sopenharmony_ci#if 0 // Disabled until updated to use current API. 2cb93a386Sopenharmony_ci// Copyright 2019 Google LLC. 3cb93a386Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 4cb93a386Sopenharmony_ci#include "tools/fiddle/examples.h" 5cb93a386Sopenharmony_ci// HASH=68b6d0208eb0b4de67fc152381af7a58 6cb93a386Sopenharmony_ciREG_FIDDLE(TextBlob_Deserialize, 256, 24, false, 0) { 7cb93a386Sopenharmony_ci#include "include/core/SkSerialProcs.h" 8cb93a386Sopenharmony_ci 9cb93a386Sopenharmony_civoid draw(SkCanvas* canvas) { 10cb93a386Sopenharmony_ci SkFont blobFont; 11cb93a386Sopenharmony_ci blobFont.setSize(24); 12cb93a386Sopenharmony_ci sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromText("Hello World!", 12, blobFont); 13cb93a386Sopenharmony_ci sk_sp<SkData> data = blob->serialize(SkSerialProcs()); 14cb93a386Sopenharmony_ci uint16_t glyphs[6]; 15cb93a386Sopenharmony_ci SkPaint blobPaint; 16cb93a386Sopenharmony_ci blobPaint.textToGlyphs("Hacker", 6, glyphs); 17cb93a386Sopenharmony_ci memcpy((char*)data->writable_data() + 0x54, glyphs, sizeof(glyphs)); 18cb93a386Sopenharmony_ci sk_sp<SkTextBlob> copy = SkTextBlob::Deserialize(data->data(), data->size(), SkDeserialProcs()); 19cb93a386Sopenharmony_ci canvas->drawTextBlob(copy, 20, 20, SkPaint()); 20cb93a386Sopenharmony_ci} 21cb93a386Sopenharmony_ci} // END FIDDLE 22cb93a386Sopenharmony_ci#endif // Disabled until updated to use current API. 23