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

Side by Side Diff: tools/sk_tool_utils.h

Issue 1974783002: Revert of Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 #ifndef sk_tool_utils_DEFINED 8 #ifndef sk_tool_utils_DEFINED
9 #define sk_tool_utils_DEFINED 9 #define sk_tool_utils_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 const char* colortype_name(SkColorType); 29 const char* colortype_name(SkColorType);
30 30
31 /** 31 /**
32 * Map opaque colors from 8888 to 565. 32 * Map opaque colors from 8888 to 565.
33 */ 33 */
34 SkColor color_to_565(SkColor color); 34 SkColor color_to_565(SkColor color);
35 35
36 /** 36 /**
37 * Return a color emoji typeface if available. 37 * Return a color emoji typeface if available.
38 */ 38 */
39 sk_sp<SkTypeface> emoji_typeface(); 39 void emoji_typeface(SkAutoTUnref<SkTypeface>* );
40 40
41 /** 41 /**
42 * If the platform supports color emoji, return sample text the emoji can re nder. 42 * If the platform supports color emoji, return sample text the emoji can re nder.
43 */ 43 */
44 const char* emoji_sample_text(); 44 const char* emoji_sample_text();
45 45
46 /** 46 /**
47 * If the platform supports color emoji, return the type (i.e. "CBDT", "SBIX ", ""). 47 * If the platform supports color emoji, return the type (i.e. "CBDT", "SBIX ", "").
48 */ 48 */
49 const char* platform_os_emoji(); 49 const char* platform_os_emoji();
(...skipping 20 matching lines...) Expand all
70 70
71 /** 71 /**
72 * Sets the paint to use a platform-independent text renderer 72 * Sets the paint to use a platform-independent text renderer
73 */ 73 */
74 void set_portable_typeface(SkPaint* paint, const char* name = nullptr, 74 void set_portable_typeface(SkPaint* paint, const char* name = nullptr,
75 SkTypeface::Style style = SkTypeface::kNormal); 75 SkTypeface::Style style = SkTypeface::kNormal);
76 76
77 /** 77 /**
78 * Returns a platform-independent text renderer. 78 * Returns a platform-independent text renderer.
79 */ 79 */
80 sk_sp<SkTypeface> create_portable_typeface(const char* name, SkTypeface::Sty le style); 80 SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style sty le);
81 81
82 /** Call to clean up portable font references. */ 82 /** Call to clean up portable font references. */
83 void release_portable_typefaces(); 83 void release_portable_typefaces();
84 84
85 /** 85 /**
86 * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims 86 * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims
87 * the pixels are colorType + alphaType 87 * the pixels are colorType + alphaType
88 */ 88 */
89 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA lphaType); 89 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA lphaType);
90 90
91 // private to sk_tool_utils 91 // private to sk_tool_utils
92 sk_sp<SkTypeface> create_font(const char* name, SkTypeface::Style); 92 SkTypeface* create_font(const char* name, SkTypeface::Style);
93 93
94 /** Returns a newly created CheckerboardShader. */ 94 /** Returns a newly created CheckerboardShader. */
95 sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size) ; 95 sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size) ;
96 96
97 /** Draw a checkerboard pattern in the current canvas, restricted to 97 /** Draw a checkerboard pattern in the current canvas, restricted to
98 the current clip, using SkXfermode::kSrc_Mode. */ 98 the current clip, using SkXfermode::kSrc_Mode. */
99 void draw_checkerboard(SkCanvas* canvas, 99 void draw_checkerboard(SkCanvas* canvas,
100 SkColor color1, 100 SkColor color1,
101 SkColor color2, 101 SkColor color2,
102 int checkSize); 102 int checkSize);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 int fID; 216 int fID;
217 int fOutputPos; 217 int fOutputPos;
218 bool fTempMark; 218 bool fTempMark;
219 219
220 SkTDArray<TopoTestNode*> fDependencies; 220 SkTDArray<TopoTestNode*> fDependencies;
221 }; 221 };
222 222
223 } // namespace sk_tool_utils 223 } // namespace sk_tool_utils
224 224
225 #endif // sk_tool_utils_DEFINED 225 #endif // sk_tool_utils_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698