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

Side by Side Diff: tools/sk_tool_utils.h

Issue 1512333002: SkPixelSerializer: remove deprecated virtual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/ImageTest.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 117 // Encodes to PNG, unless there is already encoded data, in which case that gets
118 // used. 118 // used.
119 class PngPixelSerializer : public SkPixelSerializer { 119 class PngPixelSerializer : public SkPixelSerializer {
120 public: 120 public:
121 bool onUseEncodedData(const void*, size_t) override { return true; } 121 bool onUseEncodedData(const void*, size_t) override;
122 SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, 122 SkData* onEncode(const SkPixmap&) override;
123 size_t rowBytes) override {
124 return SkImageEncoder::EncodeData(info, pixels, rowBytes,
125 SkImageEncoder::kPNG_Type, 100);
126 }
127 }; 123 };
128 124
129 // A helper for inserting a drawtext call into a SkTextBlobBuilder 125 // A helper for inserting a drawtext call into a SkTextBlobBuilder
130 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk Paint& origPaint, 126 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk Paint& origPaint,
131 SkScalar x, SkScalar y); 127 SkScalar x, SkScalar y);
132 128
133 void create_hemi_normal_map(SkBitmap* bm, const SkIRect& dst); 129 void create_hemi_normal_map(SkBitmap* bm, const SkIRect& dst);
134 130
135 void create_frustum_normal_map(SkBitmap* bm, const SkIRect& dst); 131 void create_frustum_normal_map(SkBitmap* bm, const SkIRect& dst);
136 132
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 int fID; 224 int fID;
229 int fOutputPos; 225 int fOutputPos;
230 bool fTempMark; 226 bool fTempMark;
231 227
232 SkTDArray<TopoTestNode*> fDependencies; 228 SkTDArray<TopoTestNode*> fDependencies;
233 }; 229 };
234 230
235 } // namespace sk_tool_utils 231 } // namespace sk_tool_utils
236 232
237 #endif // sk_tool_utils_DEFINED 233 #endif // sk_tool_utils_DEFINED
OLDNEW
« no previous file with comments | « tests/ImageTest.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698