| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |