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

Side by Side Diff: gm/imagefilterscropped.cpp

Issue 1177303005: next batch of portable typeface changes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/blurs.cpp ('k') | 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 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 26 matching lines...) Expand all
37 paint.setImageFilter(imf); 37 paint.setImageFilter(imf);
38 paint.setAntiAlias(true); 38 paint.setAntiAlias(true);
39 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); 39 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint);
40 } 40 }
41 41
42 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 42 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
43 SkPaint paint; 43 SkPaint paint;
44 paint.setImageFilter(imf); 44 paint.setImageFilter(imf);
45 paint.setColor(SK_ColorGREEN); 45 paint.setColor(SK_ColorGREEN);
46 paint.setAntiAlias(true); 46 paint.setAntiAlias(true);
47 sk_tool_utils::set_portable_typeface(&paint); 47 sk_tool_utils::set_portable_typeface_always(&paint);
48 paint.setTextSize(r.height()/2); 48 paint.setTextSize(r.height()/2);
49 paint.setTextAlign(SkPaint::kCenter_Align); 49 paint.setTextAlign(SkPaint::kCenter_Align);
50 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); 50 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint);
51 } 51 }
52 52
53 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { 53 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
54 SkPaint paint; 54 SkPaint paint;
55 55
56 SkIRect bounds; 56 SkIRect bounds;
57 r.roundOut(&bounds); 57 r.roundOut(&bounds);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 private: 194 private:
195 SkBitmap fCheckerboard; 195 SkBitmap fCheckerboard;
196 typedef GM INHERITED; 196 typedef GM INHERITED;
197 }; 197 };
198 198
199 /////////////////////////////////////////////////////////////////////////////// 199 ///////////////////////////////////////////////////////////////////////////////
200 200
201 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; } 201 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; }
202 static skiagm::GMRegistry reg(MyFactory); 202 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/blurs.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698