| Differences between
and this patch
- WebCore/ChangeLog +15 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2009-06-17  Brent Fulgham  <bfulgham@webkit.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=26425
6
        Final refactorings, picking up a few places where BitmapInfo
7
        could be used.
8
9
        * page/win/FrameCGWin.cpp:
10
        (WebCore::imageFromRect):
11
        * platform/win/CursorWin.cpp:
12
        (WebCore::Cursor::Cursor):
13
        * platform/win/PopupMenuWin.cpp:
14
        (WebCore::PopupMenu::paint):
15
1
2009-06-18  Peter Kasting  <pkasting@google.com>
16
2009-06-18  Peter Kasting  <pkasting@google.com>
2
17
3
        Fix build bustage.
18
        Fix build bustage.
- WebCore/page/win/FrameCGWin.cpp -1 / +1 lines
Lines 55-61 static HBITMAP imageFromRect(const Frame WebCore/page/win/FrameCGWin.cpp_sec1
55
    HDC hdc = CreateCompatibleDC(0);
55
    HDC hdc = CreateCompatibleDC(0);
56
    int w = ir.width();
56
    int w = ir.width();
57
    int h = ir.height();
57
    int h = ir.height();
58
    BITMAPINFO bmp = { { sizeof(BITMAPINFOHEADER), w, h, 1, 32 } };
58
    BitmapInfo bmp = BitmapInfo::create(IntSize(w, h));
59
59
60
    HBITMAP hbmp = CreateDIBSection(0, &bmp, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0);
60
    HBITMAP hbmp = CreateDIBSection(0, &bmp, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0);
61
    HBITMAP hbmpOld = static_cast<HBITMAP>(SelectObject(hdc, hbmp));
61
    HBITMAP hbmpOld = static_cast<HBITMAP>(SelectObject(hdc, hbmp));
- WebCore/platform/win/CursorWin.cpp -7 / +3 lines
Lines 27-32 WebCore/platform/win/CursorWin.cpp_sec1
27
#include "config.h"
27
#include "config.h"
28
#include "Cursor.h"
28
#include "Cursor.h"
29
29
30
#include "BitmapInfo.h"
30
#include "Image.h"
31
#include "Image.h"
31
#include "IntPoint.h"
32
#include "IntPoint.h"
32
33
Lines 54-66 static inline bool supportsAlphaCursors( WebCore/platform/win/CursorWin.cpp_sec2
54
Cursor::Cursor(Image* img, const IntPoint& hotspot) 
55
Cursor::Cursor(Image* img, const IntPoint& hotspot) 
55
{ 
56
{ 
56
    static bool doAlpha = supportsAlphaCursors();
57
    static bool doAlpha = supportsAlphaCursors();
57
    BITMAPINFO cursorImage = {0};
58
    BitmapInfo cursorImage = BitmapInfo::create(IntSize(img->width(), img->height()));
58
    cursorImage.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
59
59
    cursorImage.bmiHeader.biWidth = img->width();
60
    cursorImage.bmiHeader.biHeight = img->height();
61
    cursorImage.bmiHeader.biPlanes = 1;
62
    cursorImage.bmiHeader.biBitCount = 32;
63
    cursorImage.bmiHeader.biCompression = BI_RGB;
64
    HDC dc = GetDC(0);
60
    HDC dc = GetDC(0);
65
    HDC workingDC = CreateCompatibleDC(dc);
61
    HDC workingDC = CreateCompatibleDC(dc);
66
    if (doAlpha) {
62
    if (doAlpha) {
- WebCore/platform/win/PopupMenuWin.cpp -1 / +1 lines
Lines 452-458 void PopupMenu::paint(const IntRect& dam WebCore/platform/win/PopupMenuWin.cpp_sec1
452
        }
452
        }
453
    }
453
    }
454
    if (!m_bmp) {
454
    if (!m_bmp) {
455
        BITMAPINFO bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
455
        BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
456
456
457
        void* pixels = 0;
457
        void* pixels = 0;
458
        m_bmp = ::CreateDIBSection(m_DC, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
458
        m_bmp = ::CreateDIBSection(m_DC, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
- WebKit/win/ChangeLog +15 lines
Lines 1-3 WebKit/win/ChangeLog_sec1
1
2009-06-18  Brent Fulgham  <bfulgham@gmail.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Remove some boilerplate using the BitmapInfo struct.
6
        https://bugs.webkit.org/show_bug.cgi?id=26425
7
8
        * WebIconDatabase.cpp:
9
        (createDIB):
10
        * WebKit.vcproj/WebKit.sln:
11
        * WebNodeHighlight.cpp:
12
        (WebNodeHighlight::update):
13
        * WebView.cpp:
14
        (WebView::ensureBackingStore):
15
1
2009-06-17  Steve Falkenburg  <sfalken@apple.com>
16
2009-06-17  Steve Falkenburg  <sfalken@apple.com>
2
17
3
        Consolidate WebKit COM interfaces.
18
        Consolidate WebKit COM interfaces.
- WebKit/win/WebIconDatabase.cpp -10 / +3 lines
Lines 32-37 WebKit/win/WebIconDatabase.cpp_sec1
32
#include "WebPreferences.h"
32
#include "WebPreferences.h"
33
#include "WebNotificationCenter.h"
33
#include "WebNotificationCenter.h"
34
#pragma warning(push, 0)
34
#pragma warning(push, 0)
35
#include <WebCore/BitmapInfo.h>
35
#include <WebCore/BString.h>
36
#include <WebCore/BString.h>
36
#include <WebCore/FileSystem.h>
37
#include <WebCore/FileSystem.h>
37
#include <WebCore/IconDatabase.h>
38
#include <WebCore/IconDatabase.h>
Lines 262-279 HRESULT STDMETHODCALLTYPE WebIconDatabas WebKit/win/WebIconDatabase.cpp_sec2
262
263
263
HBITMAP createDIB(LPSIZE size)
264
HBITMAP createDIB(LPSIZE size)
264
{
265
{
265
    HBITMAP result;
266
    BitmapInfo bmInfo = BitmapInfo::create(IntSize(*size));
266
267
    BITMAPINFO bmInfo = {0};
268
    bmInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
269
    bmInfo.bmiHeader.biWidth = size->cx;
270
    bmInfo.bmiHeader.biHeight = size->cy;
271
    bmInfo.bmiHeader.biPlanes = 1;
272
    bmInfo.bmiHeader.biBitCount = 32;
273
    bmInfo.bmiHeader.biCompression = BI_RGB;
274
267
275
    HDC dc = GetDC(0);
268
    HDC dc = GetDC(0);
276
    result = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
269
    HBITMAP result = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
277
    ReleaseDC(0, dc);
270
    ReleaseDC(0, dc);
278
271
279
    return result;
272
    return result;
- WebKit/win/WebNodeHighlight.cpp -12 / +2 lines
Lines 31-36 WebKit/win/WebNodeHighlight.cpp_sec1
31
31
32
#include "WebView.h"
32
#include "WebView.h"
33
#pragma warning(push, 0)
33
#pragma warning(push, 0)
34
#include <WebCore/BitmapInfo.h>
34
#include <WebCore/Color.h>
35
#include <WebCore/Color.h>
35
#include <WebCore/GraphicsContext.h>
36
#include <WebCore/GraphicsContext.h>
36
#include <WebCore/InspectorController.h>
37
#include <WebCore/InspectorController.h>
Lines 146-163 void WebNodeHighlight::update() WebKit/win/WebNodeHighlight.cpp_sec2
146
    size.cx = webViewRect.right - webViewRect.left;
147
    size.cx = webViewRect.right - webViewRect.left;
147
    size.cy = webViewRect.bottom - webViewRect.top;
148
    size.cy = webViewRect.bottom - webViewRect.top;
148
149
149
    BITMAPINFO bitmapInfo;
150
    BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));
150
    bitmapInfo.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);
151
    bitmapInfo.bmiHeader.biWidth         = size.cx;
152
    bitmapInfo.bmiHeader.biHeight        = -size.cy;
153
    bitmapInfo.bmiHeader.biPlanes        = 1;
154
    bitmapInfo.bmiHeader.biBitCount      = 32;
155
    bitmapInfo.bmiHeader.biCompression   = BI_RGB;
156
    bitmapInfo.bmiHeader.biSizeImage     = 0;
157
    bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
158
    bitmapInfo.bmiHeader.biYPelsPerMeter = 0;
159
    bitmapInfo.bmiHeader.biClrUsed       = 0;
160
    bitmapInfo.bmiHeader.biClrImportant  = 0;
161
151
162
    void* pixels = 0;
152
    void* pixels = 0;
163
    OwnPtr<HBITMAP> hbmp(::CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));
153
    OwnPtr<HBITMAP> hbmp(::CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0));
- WebKit/win/WebView.cpp -12 / +2 lines
Lines 53-58 WebKit/win/WebView.cpp_sec1
53
#pragma warning( push, 0 )
53
#pragma warning( push, 0 )
54
#include <WebCore/ApplicationCacheStorage.h>
54
#include <WebCore/ApplicationCacheStorage.h>
55
#include <WebCore/AXObjectCache.h>
55
#include <WebCore/AXObjectCache.h>
56
#include <WebCore/BitmapInfo.h>
56
#include <WebCore/BString.h>
57
#include <WebCore/BString.h>
57
#include <WebCore/Cache.h>
58
#include <WebCore/Cache.h>
58
#include <WebCore/ContextMenu.h>
59
#include <WebCore/ContextMenu.h>
Lines 687-704 bool WebView::ensureBackingStore() WebKit/win/WebView.cpp_sec2
687
688
688
        m_backingStoreSize.cx = width;
689
        m_backingStoreSize.cx = width;
689
        m_backingStoreSize.cy = height;
690
        m_backingStoreSize.cy = height;
690
        BITMAPINFO bitmapInfo;
691
        BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(m_backingStoreSize));
691
        bitmapInfo.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);
692
        bitmapInfo.bmiHeader.biWidth         = width; 
693
        bitmapInfo.bmiHeader.biHeight        = -height;
694
        bitmapInfo.bmiHeader.biPlanes        = 1;
695
        bitmapInfo.bmiHeader.biBitCount      = 32;
696
        bitmapInfo.bmiHeader.biCompression   = BI_RGB;
697
        bitmapInfo.bmiHeader.biSizeImage     = 0;
698
        bitmapInfo.bmiHeader.biXPelsPerMeter = 0;
699
        bitmapInfo.bmiHeader.biYPelsPerMeter = 0;
700
        bitmapInfo.bmiHeader.biClrUsed       = 0;
701
        bitmapInfo.bmiHeader.biClrImportant  = 0;
702
692
703
        void* pixels = NULL;
693
        void* pixels = NULL;
704
        m_backingStoreBitmap.set(::CreateDIBSection(NULL, &bitmapInfo, DIB_RGB_COLORS, &pixels, NULL, 0));
694
        m_backingStoreBitmap.set(::CreateDIBSection(NULL, &bitmapInfo, DIB_RGB_COLORS, &pixels, NULL, 0));

Return to Bug 26425