Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: skia/ext/skia_utils_win.h

Issue 1492353002: Consolidate Windows bitmap and DC code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-printing-dc-from-device
Patch Set: remove !_WIN64 restriction on error reporting Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SKIA_EXT_SKIA_UTILS_WIN_H_ 5 #ifndef SKIA_EXT_SKIA_UTILS_WIN_H_
6 #define SKIA_EXT_SKIA_UTILS_WIN_H_ 6 #define SKIA_EXT_SKIA_UTILS_WIN_H_
7 7
8 #include "third_party/skia/include/core/SkBitmap.h"
8 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 #include "third_party/skia/include/core/SkRefCnt.h"
9 11
10 #include "build/build_config.h" 12 #include "build/build_config.h"
11 #include <windows.h> 13 #include <windows.h>
12 14
13 struct SkIRect; 15 struct SkIRect;
14 struct SkPoint; 16 struct SkPoint;
15 struct SkRect; 17 struct SkRect;
18 class SkSurface;
16 typedef unsigned long DWORD; 19 typedef unsigned long DWORD;
17 typedef DWORD COLORREF; 20 typedef DWORD COLORREF;
18 typedef struct tagPOINT POINT; 21 typedef struct tagPOINT POINT;
19 typedef struct tagRECT RECT; 22 typedef struct tagRECT RECT;
20 23
21 namespace skia { 24 namespace skia {
22 25
23 // Converts a Skia point to a Windows POINT. 26 // Converts a Skia point to a Windows POINT.
24 POINT SkPointToPOINT(const SkPoint& point); 27 POINT SkPointToPOINT(const SkPoint& point);
25 28
(...skipping 16 matching lines...) Expand all
42 45
43 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects. 46 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects.
44 SK_API SkColor COLORREFToSkColor(COLORREF color); 47 SK_API SkColor COLORREFToSkColor(COLORREF color);
45 48
46 // Converts ARGB to COLORREFs (0BGR). 49 // Converts ARGB to COLORREFs (0BGR).
47 SK_API COLORREF SkColorToCOLORREF(SkColor color); 50 SK_API COLORREF SkColorToCOLORREF(SkColor color);
48 51
49 // Initializes the default settings and colors in a device context. 52 // Initializes the default settings and colors in a device context.
50 SK_API void InitializeDC(HDC context); 53 SK_API void InitializeDC(HDC context);
51 54
55 // Creates a surface writing to the pixels backing the HDC's bitmap.
56 // Returns nullptr on error.
57 SK_API sk_sp<SkSurface> MapPlatformSurface(HDC context);
58
59 // Creates a bitmap backed by the same pixels backing the HDC's bitmap.
60 // Returns an empty bitmap on error.
61 SK_API SkBitmap MapPlatformBitmap(HDC context);
62
63 // Creates an offscreen HDC suitable for writing to via MapPlatformSurface().
64 // Caller is responsible for calling DeleteDC() when done.
65 SK_API HDC CreateOffscreenSurface(int width, int height);
66
67 // Creates a BITMAPINFOHEADER structure given the bitmap's size.
68 SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
69
52 } // namespace skia 70 } // namespace skia
53 71
54 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ 72 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_
55 73
OLDNEW
« no previous file with comments | « printing/emf_win.cc ('k') | skia/ext/skia_utils_win.cc » ('j') | skia/ext/skia_utils_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698