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

Side by Side Diff: tools/sk_tool_utils.h

Issue 1507123002: default SkPixelSerializer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-10 (Thursday) 13:15:57 EST Created 5 years 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 | « tests/PictureTest.cpp ('k') | tools/sk_tool_utils.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 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 int checkSize); 107 int checkSize);
108 108
109 /** A default checkerboard. */ 109 /** A default checkerboard. */
110 inline void draw_checkerboard(SkCanvas* canvas) { 110 inline void draw_checkerboard(SkCanvas* canvas) {
111 sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, 0xFF666666, 8); 111 sk_tool_utils::draw_checkerboard(canvas, 0xFF999999, 0xFF666666, 8);
112 } 112 }
113 113
114 SkBitmap create_string_bitmap(int w, int h, SkColor c, int x, int y, 114 SkBitmap create_string_bitmap(int w, int h, SkColor c, int x, int y,
115 int textSize, const char* str); 115 int textSize, const char* str);
116 116
117 // Encodes to PNG, unless there is already encoded data, in which case that gets
118 // used.
119 class PngPixelSerializer : public SkPixelSerializer {
120 public:
121 bool onUseEncodedData(const void*, size_t) override;
122 SkData* onEncode(const SkPixmap&) override;
123 };
124
125 // A helper for inserting a drawtext call into a SkTextBlobBuilder 117 // A helper for inserting a drawtext call into a SkTextBlobBuilder
126 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk Paint& origPaint, 118 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk Paint& origPaint,
127 SkScalar x, SkScalar y); 119 SkScalar x, SkScalar y);
128 120
129 void create_hemi_normal_map(SkBitmap* bm, const SkIRect& dst); 121 void create_hemi_normal_map(SkBitmap* bm, const SkIRect& dst);
130 122
131 void create_frustum_normal_map(SkBitmap* bm, const SkIRect& dst); 123 void create_frustum_normal_map(SkBitmap* bm, const SkIRect& dst);
132 124
133 void create_tetra_normal_map(SkBitmap* bm, const SkIRect& dst); 125 void create_tetra_normal_map(SkBitmap* bm, const SkIRect& dst);
134 126
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 int fID; 216 int fID;
225 int fOutputPos; 217 int fOutputPos;
226 bool fTempMark; 218 bool fTempMark;
227 219
228 SkTDArray<TopoTestNode*> fDependencies; 220 SkTDArray<TopoTestNode*> fDependencies;
229 }; 221 };
230 222
231 } // namespace sk_tool_utils 223 } // namespace sk_tool_utils
232 224
233 #endif // sk_tool_utils_DEFINED 225 #endif // sk_tool_utils_DEFINED
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698