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

Side by Side Diff: ui/gfx/gdi_util.h

Issue 10662037: basic nc paint, moving, resizing for views_examples_exe on win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetHwnd->hwnd Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/gdi_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_GFX_GDI_UTIL_H_ 5 #ifndef UI_GFX_GDI_UTIL_H_
6 #define UI_GFX_GDI_UTIL_H_ 6 #define UI_GFX_GDI_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 #include <windows.h> 10 #include <windows.h>
11 11
12 #include "ui/base/ui_export.h" 12 #include "ui/base/ui_export.h"
13 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/path.h"
14 15
15 namespace gfx { 16 namespace gfx {
16 17
17 // Creates a BITMAPINFOHEADER structure given the bitmap's size. 18 // Creates a BITMAPINFOHEADER structure given the bitmap's size.
18 UI_EXPORT void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); 19 UI_EXPORT void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
19 20
20 // Creates a BITMAPINFOHEADER structure given the bitmap's size and 21 // Creates a BITMAPINFOHEADER structure given the bitmap's size and
21 // color depth in bits per pixel. 22 // color depth in bits per pixel.
22 void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth, 23 void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
23 BITMAPINFOHEADER* hdr); 24 BITMAPINFOHEADER* hdr);
24 25
25 // Creates a BITMAPV4HEADER structure given the bitmap's size. You probably 26 // Creates a BITMAPV4HEADER structure given the bitmap's size. You probably
26 // only need to use BMP V4 if you need transparency (alpha channel). This 27 // only need to use BMP V4 if you need transparency (alpha channel). This
27 // function sets the AlphaMask to 0xff000000. 28 // function sets the AlphaMask to 0xff000000.
28 UI_EXPORT void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr); 29 UI_EXPORT void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr);
29 30
30 // Creates a monochrome bitmap header. 31 // Creates a monochrome bitmap header.
31 void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr); 32 void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
32 33
33 // Modify the given hrgn by subtracting the given rectangles. 34 // Modify the given hrgn by subtracting the given rectangles.
34 UI_EXPORT void SubtractRectanglesFromRegion( 35 UI_EXPORT void SubtractRectanglesFromRegion(
35 HRGN hrgn, 36 HRGN hrgn,
36 const std::vector<gfx::Rect>& cutouts); 37 const std::vector<gfx::Rect>& cutouts);
37 38
39 UI_EXPORT HRGN ConvertPathToHRGN(const gfx::Path& path);
40
38 // Calculate scale to fit an entire page on DC. 41 // Calculate scale to fit an entire page on DC.
39 UI_EXPORT double CalculatePageScale(HDC dc, int page_width, int page_height); 42 UI_EXPORT double CalculatePageScale(HDC dc, int page_width, int page_height);
40 43
41 // Apply scaling to the DC. 44 // Apply scaling to the DC.
42 UI_EXPORT bool ScaleDC(HDC dc, double scale_factor); 45 UI_EXPORT bool ScaleDC(HDC dc, double scale_factor);
43 46
44 } // namespace gfx 47 } // namespace gfx
45 48
46 #endif // UI_GFX_GDI_UTIL_H_ 49 #endif // UI_GFX_GDI_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/gdi_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698