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

Side by Side Diff: gm/imageblur.cpp

Issue 23967014: text size is an SkScalar, Windows reminds me. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/imagemagnifier.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 24 matching lines...) Expand all
35 canvas->saveLayer(NULL, &paint); 35 canvas->saveLayer(NULL, &paint);
36 const char* str = "The quick brown fox jumped over the lazy dog."; 36 const char* str = "The quick brown fox jumped over the lazy dog.";
37 37
38 SkRandom rand; 38 SkRandom rand;
39 SkPaint textPaint; 39 SkPaint textPaint;
40 textPaint.setAntiAlias(true); 40 textPaint.setAntiAlias(true);
41 for (int i = 0; i < 25; ++i) { 41 for (int i = 0; i < 25; ++i) {
42 int x = rand.nextULessThan(WIDTH); 42 int x = rand.nextULessThan(WIDTH);
43 int y = rand.nextULessThan(HEIGHT); 43 int y = rand.nextULessThan(HEIGHT);
44 textPaint.setColor(rand.nextBits(24) | 0xFF000000); 44 textPaint.setColor(rand.nextBits(24) | 0xFF000000);
45 textPaint.setTextSize(rand.nextULessThan(300)); 45 textPaint.setTextSize(rand.nextRangeScalar(0, 300));
46 canvas->drawText(str, strlen(str), SkIntToScalar(x), 46 canvas->drawText(str, strlen(str), SkIntToScalar(x),
47 SkIntToScalar(y), textPaint); 47 SkIntToScalar(y), textPaint);
48 } 48 }
49 canvas->restore(); 49 canvas->restore();
50 } 50 }
51 51
52 private: 52 private:
53 typedef GM INHERITED; 53 typedef GM INHERITED;
54 }; 54 };
55 55
56 ////////////////////////////////////////////////////////////////////////////// 56 //////////////////////////////////////////////////////////////////////////////
57 57
58 static GM* MyFactory(void*) { return new ImageBlurGM; } 58 static GM* MyFactory(void*) { return new ImageBlurGM; }
59 static GMRegistry reg(MyFactory); 59 static GMRegistry reg(MyFactory);
60 60
61 } 61 }
OLDNEW
« no previous file with comments | « no previous file | gm/imagemagnifier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698