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

Side by Side Diff: gm/mixedtextblobs.cpp

Issue 1250753004: make mixedtextblobs gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 fEmojiText = sk_tool_utils::emoji_sample_text(); 43 fEmojiText = sk_tool_utils::emoji_sample_text();
44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf") ); 44 fReallyBigATypeface.reset(GetResourceAsTypeface("/fonts/ReallyBigA.ttf") );
45 45
46 SkTextBlobBuilder builder; 46 SkTextBlobBuilder builder;
47 47
48 // make textblob 48 // make textblob
49 // Text so large we draw as paths 49 // Text so large we draw as paths
50 SkPaint paint; 50 SkPaint paint;
51 paint.setTextSize(385); 51 paint.setTextSize(385);
52 const char* text = "O"; 52 const char* text = "O";
53 sk_tool_utils::set_portable_typeface(&paint); 53 sk_tool_utils::set_portable_typeface_always(&paint);
54 54
55 SkRect bounds; 55 SkRect bounds;
56 paint.measureText(text, strlen(text), &bounds); 56 paint.measureText(text, strlen(text), &bounds);
57 57
58 SkScalar yOffset = bounds.height(); 58 SkScalar yOffset = bounds.height();
59 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, yOffset); 59 sk_tool_utils::add_to_text_blob(&builder, text, paint, 10, yOffset);
60 SkScalar corruptedAx = bounds.width(); 60 SkScalar corruptedAx = bounds.width();
61 SkScalar corruptedAy = yOffset; 61 SkScalar corruptedAy = yOffset;
62 62
63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf; 63 const SkScalar boundsHalfWidth = bounds.width() * SK_ScalarHalf;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 static const int kWidth = 1250; 156 static const int kWidth = 1250;
157 static const int kHeight = 700; 157 static const int kHeight = 700;
158 158
159 typedef GM INHERITED; 159 typedef GM INHERITED;
160 }; 160 };
161 161
162 ////////////////////////////////////////////////////////////////////////////// 162 //////////////////////////////////////////////////////////////////////////////
163 163
164 DEF_GM( return SkNEW(MixedTextBlobsGM); ) 164 DEF_GM( return SkNEW(MixedTextBlobsGM); )
165 } 165 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698