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

Side by Side Diff: tools/sk_tool_utils.h

Issue 1076593002: Start canonicalizing color for all A8 textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atcachemasks
Patch Set: nits Created 5 years, 8 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 | « src/gpu/GrAtlasTextContext.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
11 #include "SkColor.h" 11 #include "SkColor.h"
12 #include "SkImageEncoder.h" 12 #include "SkImageEncoder.h"
13 #include "SkImageInfo.h" 13 #include "SkImageInfo.h"
14 #include "SkPixelSerializer.h" 14 #include "SkPixelSerializer.h"
15 #include "SkTypeface.h" 15 #include "SkTypeface.h"
16 16
17 class SkBitmap; 17 class SkBitmap;
18 class SkCanvas; 18 class SkCanvas;
19 class SkPaint; 19 class SkPaint;
20 class SkShader; 20 class SkShader;
21 class SkTestFont; 21 class SkTestFont;
22 class SkTextBlobBuilder;
22 23
23 namespace sk_tool_utils { 24 namespace sk_tool_utils {
24 25
25 const char* colortype_name(SkColorType); 26 const char* colortype_name(SkColorType);
26 27
27 /** 28 /**
28 * Sets the paint to use a platform-independent text renderer. 29 * Sets the paint to use a platform-independent text renderer.
29 */ 30 */
30 void set_portable_typeface(SkPaint* paint, const char* name = NULL, 31 void set_portable_typeface(SkPaint* paint, const char* name = NULL,
31 SkTypeface::Style style = SkTypeface::kNormal); 32 SkTypeface::Style style = SkTypeface::kNormal);
(...skipping 30 matching lines...) Expand all
62 class PngPixelSerializer : public SkPixelSerializer { 63 class PngPixelSerializer : public SkPixelSerializer {
63 public: 64 public:
64 bool onUseEncodedData(const void*, size_t) override { return true; } 65 bool onUseEncodedData(const void*, size_t) override { return true; }
65 SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, 66 SkData* onEncodePixels(const SkImageInfo& info, const void* pixels,
66 size_t rowBytes) override { 67 size_t rowBytes) override {
67 return SkImageEncoder::EncodeData(info, pixels, rowBytes, 68 return SkImageEncoder::EncodeData(info, pixels, rowBytes,
68 SkImageEncoder::kPNG_Type, 100); 69 SkImageEncoder::kPNG_Type, 100);
69 } 70 }
70 }; 71 };
71 72
73 // A helper for inserting a drawtext call into a SkTextBlobBuilder
74 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk Paint& origPaint,
75 SkScalar x, SkScalar y);
76
72 } // namespace sk_tool_utils 77 } // namespace sk_tool_utils
73 78
74 #endif // sk_tool_utils_DEFINED 79 #endif // sk_tool_utils_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | tools/sk_tool_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698