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-02 22:35:42 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 22:35:42 +0000
commit004a96a015b5dfcadaad4ea1b192c97c415b75de (patch)
treecb32d3809e4366c07e837416a106a3083d2690a5 /skia/ext/skia_utils_win.h
parentf8ed412acb7bcab9855d0ebd9d29f7e38a3a8f92 (diff)
downloadchromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.zip
chromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.tar.gz
chromium_src-004a96a015b5dfcadaad4ea1b192c97c415b75de.tar.bz2
Move convolver, image_operations, and skia_utils from base/gfx to skia/ext.
This changes the namespace in those files from "gfx" to "skia". I split skia_utils into two parts, the Windows specific part is now in a separate file called skia_utils_win. There were several obsolete includes of these headers which I removed. I also removed img_resize_perftest which isn't used and has bitrotted. Review URL: http://codereview.chromium.org/12842 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6248 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..297608a
--- /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 SKIA_EXT_SKIA_UTILS_WIN_H_
+#define SKIA_EXT_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 skia {
+
+// 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 skia
+
+#endif // SKIA_EXT_SKIA_UTILS_WIN_H_
+