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

Side by Side Diff: gm/imageblur.cpp

Issue 1243493003: make glyph_pos imageblur* largeglyphblur portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused field 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 | « gm/glyph_pos.cpp ('k') | gm/imageblurtiled.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 23 matching lines...) Expand all
34 34
35 void onDraw(SkCanvas* canvas) override { 35 void onDraw(SkCanvas* canvas) override {
36 SkPaint paint; 36 SkPaint paint;
37 paint.setImageFilter(SkBlurImageFilter::Create(fSigmaX, fSigmaY))->unref (); 37 paint.setImageFilter(SkBlurImageFilter::Create(fSigmaX, fSigmaY))->unref ();
38 canvas->saveLayer(NULL, &paint); 38 canvas->saveLayer(NULL, &paint);
39 const char* str = "The quick brown fox jumped over the lazy dog."; 39 const char* str = "The quick brown fox jumped over the lazy dog.";
40 40
41 SkRandom rand; 41 SkRandom rand;
42 SkPaint textPaint; 42 SkPaint textPaint;
43 textPaint.setAntiAlias(true); 43 textPaint.setAntiAlias(true);
44 sk_tool_utils::set_portable_typeface(&textPaint); 44 sk_tool_utils::set_portable_typeface_always(&textPaint);
45 for (int i = 0; i < 25; ++i) { 45 for (int i = 0; i < 25; ++i) {
46 int x = rand.nextULessThan(WIDTH); 46 int x = rand.nextULessThan(WIDTH);
47 int y = rand.nextULessThan(HEIGHT); 47 int y = rand.nextULessThan(HEIGHT);
48 textPaint.setColor(rand.nextBits(24) | 0xFF000000); 48 textPaint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0 xFF000000));
reed1 2015/07/16 21:14:04 Does this actually result in zero-diffs, given tha
caryclark 2015/07/17 12:42:30 No, but it reduces the number of diffs. I've large
49 textPaint.setTextSize(rand.nextRangeScalar(0, 300)); 49 textPaint.setTextSize(rand.nextRangeScalar(0, 300));
50 canvas->drawText(str, strlen(str), SkIntToScalar(x), 50 canvas->drawText(str, strlen(str), SkIntToScalar(x),
51 SkIntToScalar(y), textPaint); 51 SkIntToScalar(y), textPaint);
52 } 52 }
53 canvas->restore(); 53 canvas->restore();
54 } 54 }
55 55
56 private: 56 private:
57 SkScalar fSigmaX; 57 SkScalar fSigmaX;
58 SkScalar fSigmaY; 58 SkScalar fSigmaY;
59 SkString fName; 59 SkString fName;
60 60
61 typedef GM INHERITED; 61 typedef GM INHERITED;
62 }; 62 };
63 63
64 ////////////////////////////////////////////////////////////////////////////// 64 //////////////////////////////////////////////////////////////////////////////
65 65
66 static GM* MyFactory1(void*) { return new ImageBlurGM(24.0f, 0.0f, ""); } 66 static GM* MyFactory1(void*) { return new ImageBlurGM(24.0f, 0.0f, ""); }
67 static GMRegistry reg1(MyFactory1); 67 static GMRegistry reg1(MyFactory1);
68 68
69 static GM* MyFactory2(void*) { return new ImageBlurGM(80.0f, 80.0f, "_large"); } 69 static GM* MyFactory2(void*) { return new ImageBlurGM(80.0f, 80.0f, "_large"); }
70 static GMRegistry reg2(MyFactory2); 70 static GMRegistry reg2(MyFactory2);
71 71
72 } 72 }
OLDNEW
« no previous file with comments | « gm/glyph_pos.cpp ('k') | gm/imageblurtiled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698