summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 21:28:33 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 21:28:33 +0000
commit05b7f994c66470750905eabb12acf1643099f9b7 (patch)
treed9411a629dfb1e8dc4885374d5f788bcff47ea86 /skia/ext/skia_utils.h
parent9ed68c36cad4f5d70a378be96d303710053eed65 (diff)
downloadchromium_src-05b7f994c66470750905eabb12acf1643099f9b7.zip
chromium_src-05b7f994c66470750905eabb12acf1643099f9b7.tar.gz
chromium_src-05b7f994c66470750905eabb12acf1643099f9b7.tar.bz2
Split the cross-platform part of skia_utils_win into skia_utils. Use this new
function when possible. Add a little documentation. This does not change the Mac build, I'll do that in a separate pass, and the function moved is never used on the mac). Review URL: http://codereview.chromium.org/12917 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/skia_utils.h')
-rw-r--r--skia/ext/skia_utils.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/skia/ext/skia_utils.h b/skia/ext/skia_utils.h
new file mode 100644
index 0000000..d2ed5db
--- /dev/null
+++ b/skia/ext/skia_utils.h
@@ -0,0 +1,27 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_GFX_SKIA_UTILS_H_
+#define BASE_GFX_SKIA_UTILS_H_
+
+#include "SkColor.h"
+#include "SkShader.h"
+
+namespace gfx {
+
+// Creates a vertical gradient shader. The caller owns the shader.
+// Example usage to avoid leaks:
+// paint.setShader(gfx::CreateGradientShader(0, 10, red, blue))->safeUnref();
+//
+// (The old shader in the paint, if any, needs to be freed, and safeUnref will
+// handle the NULL case.)
+SkShader* CreateGradientShader(int start_point,
+ int end_point,
+ SkColor start_color,
+ SkColor end_color);
+
+} // namespace gfx
+
+#endif // SKIA_EXT_SKIA_UTILS_H_
+