summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils_win.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 20:48:29 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 20:48:29 +0000
commit90d22e2aeeedb9e3084fba0773b6ca713021765b (patch)
treeea968c9a2c1d6d07a1bd0f2e508bda5029fc20a4 /skia/ext/skia_utils_win.h
parentfc78fd42b81a97d3d15419e679f3ff9e0f470d9c (diff)
downloadchromium_src-90d22e2aeeedb9e3084fba0773b6ca713021765b.zip
chromium_src-90d22e2aeeedb9e3084fba0773b6ca713021765b.tar.gz
chromium_src-90d22e2aeeedb9e3084fba0773b6ca713021765b.tar.bz2
Move base/gfx/skia_util to skia/ext/skia_util_win.
In a later pass, I will separate off the cross-platform part of this file into skia/ext/skia_util (only one function). Review URL: http://codereview.chromium.org/13101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/skia_utils_win.h')
-rw-r--r--skia/ext/skia_utils_win.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/skia/ext/skia_utils_win.h b/skia/ext/skia_utils_win.h
new file mode 100644
index 0000000..4ad7910
--- /dev/null
+++ b/skia/ext/skia_utils_win.h
@@ -0,0 +1,56 @@
+// 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_WIN_H_
+#define BASE_GFX_SKIA_UTILS_WIN_H_
+
+#include "SkColor.h"
+#include "SkShader.h"
+
+struct SkIRect;
+struct SkPoint;
+struct SkRect;
+typedef unsigned long DWORD;
+typedef DWORD COLORREF;
+typedef struct tagPOINT POINT;
+typedef struct tagRECT RECT;
+
+namespace gfx {
+
+// Converts a Skia point to a Windows POINT.
+POINT SkPointToPOINT(const SkPoint& point);
+
+// Converts a Windows RECT to a Skia rect.
+SkRect RECTToSkRect(const RECT& rect);
+
+// Converts a Windows RECT to a Skia rect.
+// Both use same in-memory format. Verified by COMPILE_ASSERT() in
+// skia_utils.cc.
+inline const SkIRect& RECTToSkIRect(const RECT& rect) {
+ return reinterpret_cast<const SkIRect&>(rect);
+}
+
+// Converts a Skia rect to a Windows RECT.
+// Both use same in-memory format. Verified by COMPILE_ASSERT() in
+// skia_utils.cc.
+inline const RECT& SkIRectToRECT(const SkIRect& rect) {
+ return reinterpret_cast<const RECT&>(rect);
+}
+
+// Creates a vertical gradient shader. The caller owns the shader.
+SkShader* CreateGradientShader(int start_point,
+ int end_point,
+ SkColor start_color,
+ SkColor end_color);
+
+// Converts COLORREFs (0BGR) to the ARGB layout Skia expects.
+SkColor COLORREFToSkColor(COLORREF color);
+
+// Converts ARGB to COLORREFs (0BGR).
+COLORREF SkColorToCOLORREF(SkColor color);
+
+} // namespace gfx
+
+#endif // SKIA_EXT_SKIA_UTILS_WIN_H_
+