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

Side by Side Diff: gm/displacement.cpp

Issue 348323003: use platform-independent font for gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add include tools for skimage Created 6 years, 6 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 | « gm/degeneratesegments.cpp ('k') | gm/gm.h » ('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 "SkDisplacementMapEffect.h" 9 #include "SkDisplacementMapEffect.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 19 matching lines...) Expand all
30 make_checkerboard(&fLargeW, 96, 64); 30 make_checkerboard(&fLargeW, 96, 64);
31 make_checkerboard(&fLargeH, 64, 96); 31 make_checkerboard(&fLargeH, 64, 96);
32 } 32 }
33 33
34 void make_bitmap() { 34 void make_bitmap() {
35 fBitmap.allocN32Pixels(80, 80); 35 fBitmap.allocN32Pixels(80, 80);
36 SkCanvas canvas(fBitmap); 36 SkCanvas canvas(fBitmap);
37 canvas.clear(0x00000000); 37 canvas.clear(0x00000000);
38 SkPaint paint; 38 SkPaint paint;
39 paint.setAntiAlias(true); 39 paint.setAntiAlias(true);
40 sk_tool_utils::set_portable_typeface(&paint);
40 paint.setColor(0xFF884422); 41 paint.setColor(0xFF884422);
41 paint.setTextSize(SkIntToScalar(96)); 42 paint.setTextSize(SkIntToScalar(96));
42 const char* str = "g"; 43 const char* str = "g";
43 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55), paint); 44 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55), paint);
44 } 45 }
45 46
46 void make_checkerboard(SkBitmap* bitmap, int w, int h) { 47 void make_checkerboard(SkBitmap* bitmap, int w, int h) {
47 bitmap->allocN32Pixels(w, h); 48 bitmap->allocN32Pixels(w, h);
48 SkCanvas canvas(*bitmap); 49 SkCanvas canvas(*bitmap);
49 canvas.clear(0x00000000); 50 canvas.clear(0x00000000);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; 221 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH;
221 bool fInitialized; 222 bool fInitialized;
222 }; 223 };
223 224
224 ////////////////////////////////////////////////////////////////////////////// 225 //////////////////////////////////////////////////////////////////////////////
225 226
226 static GM* MyFactory(void*) { return new DisplacementMapGM; } 227 static GM* MyFactory(void*) { return new DisplacementMapGM; }
227 static GMRegistry reg(MyFactory); 228 static GMRegistry reg(MyFactory);
228 229
229 } 230 }
OLDNEW
« no previous file with comments | « gm/degeneratesegments.cpp ('k') | gm/gm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698