blob: 151325d7d1312ec72f63f14c34105b4a5a5817d2 [file] [log] [blame]
commit-bot@chromium.org4cd9e212014-03-07 03:25:16 +00001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef sk_tool_utils_DEFINED
9#define sk_tool_utils_DEFINED
10
caryclark5fb6bd42014-06-23 11:25:00 -070011#include "SkBitmap.h"
12#include "SkCanvas.h"
tfarina20108912014-06-21 10:54:17 -070013#include "SkImageInfo.h"
caryclark5fb6bd42014-06-23 11:25:00 -070014#include "SkPaint.h"
15#include "SkTypeface.h"
commit-bot@chromium.org4cd9e212014-03-07 03:25:16 +000016
17namespace sk_tool_utils {
skia.committer@gmail.comdb0c8752014-03-18 03:02:11 +000018
caryclark5fb6bd42014-06-23 11:25:00 -070019 extern bool gEnablePortableTypeface;
20
commit-bot@chromium.orga713f9c2014-03-17 21:31:26 +000021 const char* colortype_name(SkColorType);
commit-bot@chromium.org4cd9e212014-03-07 03:25:16 +000022
23 /**
caryclark5fb6bd42014-06-23 11:25:00 -070024 * Sets the paint to use a platform-independent text renderer.
25 */
26 void set_portable_typeface(SkPaint* paint, SkTypeface::Style style = SkTypeface::kNormal);
27
28 /**
commit-bot@chromium.org4cd9e212014-03-07 03:25:16 +000029 * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims
30 * the pixels are colorType + alphaType
31 */
32 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkAlphaType);
commit-bot@chromium.org4cd9e212014-03-07 03:25:16 +000033
tfarina20108912014-06-21 10:54:17 -070034} // namespace sk_tool_utils
35
36#endif // sk_tool_utils_DEFINED