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

Side by Side Diff: gm/coloremoji.cpp

Issue 23684041: improve bitmap font support (FreeType only) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Correct selection logic, remove debug code. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ports/SkFontConfigInterface_direct.cpp » ('j') | 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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual SkISize onISize() { 43 virtual SkISize onISize() {
44 return make_isize(640, 480); 44 return make_isize(640, 480);
45 } 45 }
46 46
47 virtual void onDraw(SkCanvas* canvas) { 47 virtual void onDraw(SkCanvas* canvas) {
48 48
49 canvas->drawColor(SK_ColorGRAY); 49 canvas->drawColor(SK_ColorGRAY);
50 50
51 SkPaint paint; 51 SkPaint paint;
52 paint.setTypeface(fTypeface); 52 paint.setTypeface(fTypeface);
53 paint.setEmbeddedBitmapText(true);
bungeman-skia 2013/12/09 22:13:34 The 'embedded bitmap' flag was intended to be used
54 53
55 const char* text = "hamburgerfons"; 54 const char* text = "hamburgerfons";
56 55
57 // draw text at different point sizes 56 // draw text at different point sizes
58 const int textSize[] = { 10, 30, 50 }; 57 const int textSize[] = { 10, 30, 50 };
59 const int textYOffset[] = { 10, 40, 100}; 58 const int textYOffset[] = { 10, 40, 100};
60 SkASSERT(sizeof(textSize) == sizeof(textYOffset)); 59 SkASSERT(sizeof(textSize) == sizeof(textYOffset));
61 for (size_t y = 0; y < sizeof(textSize) / sizeof(int); ++y) { 60 for (size_t y = 0; y < sizeof(textSize) / sizeof(int); ++y) {
62 paint.setTextSize(SkIntToScalar(textSize[y])); 61 paint.setTextSize(SkIntToScalar(textSize[y]));
63 canvas->drawText(text, strlen(text), 10, SkIntToScalar(textYOffset[y ]), paint); 62 canvas->drawText(text, strlen(text), 10, SkIntToScalar(textYOffset[y ]), paint);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 109
111 ////////////////////////////////////////////////////////////////////////////// 110 //////////////////////////////////////////////////////////////////////////////
112 111
113 #if !defined(SK_BUILD_FOR_ANDROID) 112 #if !defined(SK_BUILD_FOR_ANDROID)
114 // fail for now until the appropriate freetype changes are submitted 113 // fail for now until the appropriate freetype changes are submitted
115 static GM* MyFactory(void*) { return new ColorEmojiGM; } 114 static GM* MyFactory(void*) { return new ColorEmojiGM; }
116 static GMRegistry reg(MyFactory); 115 static GMRegistry reg(MyFactory);
117 #endif 116 #endif
118 117
119 } 118 }
OLDNEW
« no previous file with comments | « no previous file | src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698