Bug 58862 - [Windows, WinCairo] Teach DIBPixelData to Write to a file
Summary: [Windows, WinCairo] Teach DIBPixelData to Write to a file
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 19:57 PDT by Brent Fulgham
Modified: 2011-04-19 10:01 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.93 KB, patch)
2011-04-18 23:01 PDT, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (3.04 KB, patch)
2011-04-18 23:08 PDT, Brent Fulgham
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2011-04-18 19:57:26 PDT
The attached patch extends the DIBPixelData class with a utility function to dump the bitmap to disk.  I found this extremely helpful when working on some recent Windows development.
Comment 1 Brent Fulgham 2011-04-18 23:01:34 PDT
Created attachment 90149 [details]
Patch
Comment 2 WebKit Review Bot 2011-04-18 23:04:48 PDT
Attachment 90149 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/platform/graphics/win/DIBPixelData.cpp:32:  One space before end of line comments  [whitespace/comments] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2011-04-18 23:08:37 PDT
Created attachment 90150 [details]
Patch
Comment 4 Adam Roben (:aroben) 2011-04-19 09:24:35 PDT
Comment on attachment 90150 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=90150&action=review

> Source/WebCore/platform/graphics/win/DIBPixelData.cpp:32
> +const WORD s_bitmapType = 0x4d42;
> +const WORD s_bitmapPixelsPerMeter = 2834; // 72 dpi

No need for the s_ prefixes here. But you should mark them "static".

> Source/WebCore/platform/graphics/win/DIBPixelData.h:52
> +        void writeToFile(LPCWSTR);

Maybe this function should be wrapped in #ifndef NDEBUG?
Comment 5 Brent Fulgham 2011-04-19 10:01:47 PDT
Landed in http://trac.webkit.org/changeset/84261.