Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: gm/textblob.cpp

Issue 563783003: Ensure blob typeface information survives SkGPipe serialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass TypefaceBuffer by ptr Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/core/SkPtrRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/textblob.cpp
diff --git a/gm/textblob.cpp b/gm/textblob.cpp
index 68373638989b7000512afb124de26cf612ef9f97..a0340071f7dfed63848fe5cd7142ad77a6bba313 100644
--- a/gm/textblob.cpp
+++ b/gm/textblob.cpp
@@ -66,8 +66,10 @@ const SkScalar kFontSize = 16;
class TextBlobGM : public skiagm::GM {
public:
- TextBlobGM(const char* txt) {
+ TextBlobGM(const char* txt)
+ : fTypeface(sk_tool_utils::create_portable_typeface("Times", SkTypeface::kNormal)) {
SkPaint p;
+ p.setTypeface(fTypeface);
size_t txtLen = strlen(txt);
int glyphCount = p.textToGlyphs(txt, txtLen, NULL);
@@ -111,6 +113,7 @@ private:
font.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
font.setAntiAlias(true);
font.setSubpixelText(true);
+ font.setTypeface(fTypeface);
for (unsigned l = 0; l < SK_ARRAY_COUNT(blobConfigs[blobIndex]); ++l) {
unsigned currentGlyph = 0;
@@ -173,7 +176,8 @@ private:
return builder.build();
}
- SkTDArray<uint16_t> fGlyphs;
+ SkTDArray<uint16_t> fGlyphs;
+ SkAutoTUnref<SkTypeface> fTypeface;
typedef skiagm::GM INHERITED;
};
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/core/SkPtrRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698