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

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

Issue 2182083002: Remove BitmapPlatformDevice from NativeThemeWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update calling convention Created 4 years, 4 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 #include "third_party/skia/include/core/SkMatrix.h" 10 #include "third_party/skia/include/core/SkMatrix.h"
11 #include "third_party/skia/include/core/SkRefCnt.h"
10 12
11 #include "build/build_config.h" 13 #include "build/build_config.h"
12 #include <windows.h> 14 #include <windows.h>
13 15
14 struct SkIRect; 16 struct SkIRect;
15 struct SkPoint; 17 struct SkPoint;
16 struct SkRect; 18 struct SkRect;
19 class SkSurface;
17 typedef unsigned long DWORD; 20 typedef unsigned long DWORD;
18 typedef DWORD COLORREF; 21 typedef DWORD COLORREF;
19 typedef struct tagPOINT POINT; 22 typedef struct tagPOINT POINT;
20 typedef struct tagRECT RECT; 23 typedef struct tagRECT RECT;
21 24
22 namespace skia { 25 namespace skia {
23 26
24 // Converts a Skia point to a Windows POINT. 27 // Converts a Skia point to a Windows POINT.
25 POINT SkPointToPOINT(const SkPoint& point); 28 POINT SkPointToPOINT(const SkPoint& point);
26 29
(...skipping 26 matching lines...) Expand all
53 // Converts scale, skew, and translation to Windows format and sets it on the 56 // Converts scale, skew, and translation to Windows format and sets it on the
54 // HDC. 57 // HDC.
55 SK_API void LoadTransformToDC(HDC dc, const SkMatrix& matrix); 58 SK_API void LoadTransformToDC(HDC dc, const SkMatrix& matrix);
56 59
57 // Copies |src_rect| from source into destination. 60 // Copies |src_rect| from source into destination.
58 // Takes a potentially-slower path if |is_opaque| is false. 61 // Takes a potentially-slower path if |is_opaque| is false.
59 // Sets |transform| on source afterwards! 62 // Sets |transform| on source afterwards!
60 SK_API void CopyHDC(HDC source, HDC destination, int x, int y, bool is_opaque, 63 SK_API void CopyHDC(HDC source, HDC destination, int x, int y, bool is_opaque,
61 const RECT& src_rect, const SkMatrix& transform); 64 const RECT& src_rect, const SkMatrix& transform);
62 65
66 // Creates a surface writing to the pixels backing the HDC's bitmap.
Peter Kasting 2016/08/03 01:40:25 Tiny nit: I would say "|context|'s" rather than "t
tomhudson 2016/08/03 12:55:03 Done.
67 // Returns nullptr on error.
Peter Kasting 2016/08/03 01:40:25 Nit: I think we typically just say "null" in comme
tomhudson 2016/08/03 12:55:03 Done.
68 SK_API sk_sp<SkSurface> MapPlatformSurface(HDC context);
69
70 // Creates a bitmap backed by the same pixels backing the HDC's bitmap.
71 // Returns an empty bitmap on error.
72 SK_API SkBitmap MapPlatformBitmap(HDC context);
73
74 // Creates an offscreen HDC suitable for writing to via MapPlatformSurface().
75 // Caller is responsible for calling DeleteDC() when done.
76 // Will return null if any errors are encountered.
77 SK_API HDC CreateOffscreenSurface(int width, int height);
Peter Kasting 2016/08/03 01:40:25 Nit: Might want a "TODO(tomhudson): Return a Scope
tomhudson 2016/08/03 12:55:03 TODO(fmalita) for now.
78
63 // Fills in a BITMAPINFOHEADER structure given the bitmap's size. 79 // Fills in a BITMAPINFOHEADER structure given the bitmap's size.
64 SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); 80 SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
65 81
66 SK_API HBITMAP CreateHBitmap(int width, int height, bool is_opaque, 82 SK_API HBITMAP CreateHBitmap(int width, int height, bool is_opaque,
67 HANDLE shared_section = nullptr, 83 HANDLE shared_section = nullptr,
68 void** data = nullptr); 84 void** data = nullptr);
69 85
70 } // namespace skia 86 } // namespace skia
71 87
72 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ 88 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_
73 89
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