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

Unified Diff: ui/gfx/gdi_util.cc

Issue 637023002: Misc. cleanup, primarily removing unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove macros.h change Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/gdi_util.cc
diff --git a/ui/gfx/gdi_util.cc b/ui/gfx/gdi_util.cc
index dc7d83f37cf64f843de3e06181defe1b7acc357a..59401affb59b1dda9a2d808209c20b168e4ba7db 100644
--- a/ui/gfx/gdi_util.cc
+++ b/ui/gfx/gdi_util.cc
@@ -7,13 +7,11 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-namespace gfx {
-
-void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
- CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
-}
+namespace {
-void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
+void CreateBitmapHeaderWithColorDepth(LONG width,
+ LONG height,
+ WORD color_depth,
BITMAPINFOHEADER* hdr) {
// These values are shared with gfx::PlatformDevice
hdr->biSize = sizeof(BITMAPINFOHEADER);
@@ -29,6 +27,14 @@ void CreateBitmapHeaderWithColorDepth(int width, int height, int color_depth,
hdr->biClrImportant = 0;
}
+} // namespace
+
+namespace gfx {
+
+void CreateBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr) {
+ CreateBitmapHeaderWithColorDepth(width, height, 32, hdr);
+}
+
void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr) {
// Because bmp v4 header is just an extension, we just create a v3 header and
// copy the bits over to the v4 header.
@@ -49,17 +55,7 @@ void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr) {
void CreateMonochromeBitmapHeader(int width,
int height,
BITMAPINFOHEADER* hdr) {
- hdr->biSize = sizeof(BITMAPINFOHEADER);
- hdr->biWidth = width;
- hdr->biHeight = -height;
- hdr->biPlanes = 1;
- hdr->biBitCount = 1;
- hdr->biCompression = BI_RGB;
- hdr->biSizeImage = 0;
- hdr->biXPelsPerMeter = 1;
- hdr->biYPelsPerMeter = 1;
- hdr->biClrUsed = 0;
- hdr->biClrImportant = 0;
+ CreateBitmapHeaderWithColorDepth(width, height, 1, hdr);
}
void SubtractRectanglesFromRegion(HRGN hrgn,
« net/spdy/spdy_frame_builder.cc ('K') | « ui/gfx/gdi_util.h ('k') | ui/gfx/win/hwnd_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698