| OLD | NEW |
| 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/SkBitmap.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "third_party/skia/include/core/SkMatrix.h" | 10 #include "third_party/skia/include/core/SkMatrix.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const RECT& src_rect, const SkMatrix& transform); | 64 const RECT& src_rect, const SkMatrix& transform); |
| 65 | 65 |
| 66 // Creates a surface writing to the pixels backing |context|'s bitmap. | 66 // Creates a surface writing to the pixels backing |context|'s bitmap. |
| 67 // Returns null on error. | 67 // Returns null on error. |
| 68 SK_API sk_sp<SkSurface> MapPlatformSurface(HDC context); | 68 SK_API sk_sp<SkSurface> MapPlatformSurface(HDC context); |
| 69 | 69 |
| 70 // Creates a bitmap backed by the same pixels backing the HDC's bitmap. | 70 // Creates a bitmap backed by the same pixels backing the HDC's bitmap. |
| 71 // Returns an empty bitmap on error. | 71 // Returns an empty bitmap on error. |
| 72 SK_API SkBitmap MapPlatformBitmap(HDC context); | 72 SK_API SkBitmap MapPlatformBitmap(HDC context); |
| 73 | 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 // TODO(fmalita): consider returning ScopedCreateDC() when that type is | |
| 78 // returnable (https://crbug.com/622442) | |
| 79 SK_API HDC CreateOffscreenSurface(int width, int height); | |
| 80 | |
| 81 // Fills in a BITMAPINFOHEADER structure given the bitmap's size. | 74 // Fills in a BITMAPINFOHEADER structure given the bitmap's size. |
| 82 SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); | 75 SK_API void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); |
| 83 | 76 |
| 84 SK_API HBITMAP CreateHBitmap(int width, int height, bool is_opaque, | 77 SK_API HBITMAP CreateHBitmap(int width, int height, bool is_opaque, |
| 85 HANDLE shared_section = nullptr, | 78 HANDLE shared_section = nullptr, |
| 86 void** data = nullptr); | 79 void** data = nullptr); |
| 87 | 80 |
| 88 } // namespace skia | 81 } // namespace skia |
| 89 | 82 |
| 90 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ | 83 #endif // SKIA_EXT_SKIA_UTILS_WIN_H_ |
| 91 | 84 |
| OLD | NEW |