1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SKIA_EXT_SKIA_UTILS_WIN_H_
6 #define SKIA_EXT_SKIA_UTILS_WIN_H_
9 #include "third_party/skia/include/core/SkColor.h"
14 typedef unsigned long DWORD
;
15 typedef DWORD COLORREF
;
16 typedef struct tagPOINT POINT
;
17 typedef struct tagRECT RECT
;
21 // Converts a Skia point to a Windows POINT.
22 POINT
SkPointToPOINT(const SkPoint
& point
);
24 // Converts a Windows RECT to a Skia rect.
25 SkRect
RECTToSkRect(const RECT
& rect
);
27 // Converts a Windows RECT to a Skia rect.
28 // Both use same in-memory format. Verified by COMPILE_ASSERT() in
30 inline const SkIRect
& RECTToSkIRect(const RECT
& rect
) {
31 return reinterpret_cast<const SkIRect
&>(rect
);
34 // Converts a Skia rect to a Windows RECT.
35 // Both use same in-memory format. Verified by COMPILE_ASSERT() in
37 inline const RECT
& SkIRectToRECT(const SkIRect
& rect
) {
38 return reinterpret_cast<const RECT
&>(rect
);
41 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects.
42 SK_API SkColor
COLORREFToSkColor(COLORREF color
);
44 // Converts ARGB to COLORREFs (0BGR).
45 SK_API COLORREF
SkColorToCOLORREF(SkColor color
);
49 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_