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

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: Created 4 years, 10 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
« no previous file with comments | « no previous file | skia/ext/skia_utils_win.cc » ('j') | skia/ext/skia_utils_win.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
9 10
10 #include "build/build_config.h" 11 #include "build/build_config.h"
11 #include <windows.h> 12 #include <windows.h>
12 13
13 struct SkIRect; 14 struct SkIRect;
14 struct SkPoint; 15 struct SkPoint;
15 struct SkRect; 16 struct SkRect;
17 class SkSurface;
16 typedef unsigned long DWORD; 18 typedef unsigned long DWORD;
17 typedef DWORD COLORREF; 19 typedef DWORD COLORREF;
18 typedef struct tagPOINT POINT; 20 typedef struct tagPOINT POINT;
19 typedef struct tagRECT RECT; 21 typedef struct tagRECT RECT;
20 22
21 namespace skia { 23 namespace skia {
22 24
23 // Converts a Skia point to a Windows POINT. 25 // Converts a Skia point to a Windows POINT.
24 POINT SkPointToPOINT(const SkPoint& point); 26 POINT SkPointToPOINT(const SkPoint& point);
25 27
(...skipping 16 matching lines...) Expand all
42 44
43 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects. 45 // Converts COLORREFs (0BGR) to the ARGB layout Skia expects.
44 SK_API SkColor COLORREFToSkColor(COLORREF color); 46 SK_API SkColor COLORREFToSkColor(COLORREF color);
45 47
46 // Converts ARGB to COLORREFs (0BGR). 48 // Converts ARGB to COLORREFs (0BGR).
47 SK_API COLORREF SkColorToCOLORREF(SkColor color); 49 SK_API COLORREF SkColorToCOLORREF(SkColor color);
48 50
49 // Initializes the default settings and colors in a device context. 51 // Initializes the default settings and colors in a device context.
50 SK_API void InitializeDC(HDC context); 52 SK_API void InitializeDC(HDC context);
51 53
54 // Creates a surface writing to the pixels backing the HDC's bitmap.
55 // Returns NULL on error.
Peter Kasting 2016/02/16 21:12:10 Nit: NULL -> null (since this actually returns nul
tomhudson 2016/06/21 22:20:22 "nullptr", or "null"?
Peter Kasting 2016/06/22 02:23:33 "null" -- that reads better in comments than actua
56 SK_API SkSurface* MapPlatformSurface(HDC context);
57
58 // Creates a bitmap backed by the same pixels backing the HDC's bitmap.
59 // Returns an empty bitmap on error.
60 SK_API SkBitmap MapPlatformBitmap(HDC context);
61
62 // Creates an offscreen HDC suitable for writing to via MapPlatformSurface().
63 // Caller is responsible for calling DeleteDC() when done.
64 SK_API HDC CreateOffscreenSurface(int width, int height);
65
52 } // namespace skia 66 } // namespace skia
53 67
54 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ 68 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_
55 69
OLDNEW
« no previous file with comments | « no previous file | skia/ext/skia_utils_win.cc » ('j') | skia/ext/skia_utils_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698