Changeset 105756 in webkit
- Timestamp:
- Jan 24, 2012, 10:51:50 AM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r105754 r105756 1 2012-01-24 David Levin <levin@chromium.org> 2 3 [windows] Convert usage of GetDC to HWndDC Part 3. 4 https://bugs.webkit.org/show_bug.cgi?id=76889 5 6 Reviewed by Adam Roben. 7 8 No new functionality so no new tests. 9 10 * platform/graphics/win/UniscribeController.cpp: 11 (WebCore::UniscribeController::shapeAndPlaceItem): Simple replacement. 12 (WebCore::UniscribeController::shape): Use the delayed allocation. 13 * platform/win/PopupMenuWin.cpp: 14 (WebCore::PopupMenuWin::paint): Fix a dc leak and use the dellayed allocation. 15 1 16 2012-01-24 Mario Sanchez Prada <msanchez@igalia.com> 2 17 -
trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp
r96404 r105756 27 27 #include "UniscribeController.h" 28 28 #include "Font.h" 29 #include "HWndDC.h" 29 30 #include "SimpleFontData.h" 30 31 #include "TextRun.h" … … 249 250 // The script cache isn't primed with enough info yet. We need to select our HFONT into 250 251 // a DC and pass the DC in to ScriptPlace. 251 H DC hdc = GetDC(0);252 HWndDC hdc(0); 252 253 HFONT hfont = fontData->platformData().hfont(); 253 254 HFONT oldFont = (HFONT)SelectObject(hdc, hfont); … … 255 256 &item.a, advances.data(), offsets.data(), 0); 256 257 SelectObject(hdc, oldFont); 257 ReleaseDC(0, hdc);258 258 } 259 259 … … 381 381 Vector<SCRIPT_VISATTR>& visualAttributes) 382 382 { 383 H DC hdc = 0;383 HWndDC hdc; 384 384 HFONT oldFont = 0; 385 385 HRESULT shapeResult = E_PENDING; … … 392 392 // a DC and pass the DC in to ScriptShape. 393 393 ASSERT(!hdc); 394 hdc = GetDC(0);394 hdc.setHWnd(0); 395 395 HFONT hfont = fontData->platformData().hfont(); 396 396 oldFont = (HFONT)SelectObject(hdc, hfont); … … 402 402 } while (shapeResult == E_PENDING || shapeResult == E_OUTOFMEMORY); 403 403 404 if (hdc) {404 if (hdc) 405 405 SelectObject(hdc, oldFont); 406 ReleaseDC(0, hdc);407 }408 406 409 407 if (FAILED(shapeResult)) -
trunk/Source/WebCore/platform/win/PopupMenuWin.cpp
r99493 r105756 32 32 #include "GraphicsContext.h" 33 33 #include "HTMLNames.h" 34 #include "HWndDC.h" 34 35 #include "HostWindow.h" 35 36 #include "Page.h" … … 43 44 #include "TextRun.h" 44 45 #include "WebCoreInstanceHandle.h" 46 45 47 #include <windows.h> 46 48 #include <windowsx.h> … … 567 569 568 570 if (!m_DC) { 569 m_DC = ::CreateCompatibleDC( ::GetDC(m_popup));571 m_DC = ::CreateCompatibleDC(HWndDC(m_popup)); 570 572 if (!m_DC) 571 573 return; … … 661 663 m_scrollbar->paint(&context, damageRect); 662 664 663 HDC localDC = hdc ? hdc : ::GetDC(m_popup); 665 HWndDC hWndDC; 666 HDC localDC = hdc ? hdc : hWndDC.setHWnd(m_popup); 664 667 665 668 ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY); 666 667 if (!hdc)668 ::ReleaseDC(m_popup, localDC);669 669 } 670 670 -
trunk/Source/WebKit2/ChangeLog
r105746 r105756 1 2012-01-24 David Levin <levin@chromium.org> 2 3 [windows] Convert usage of GetDC to HWndDC Part 3. 4 https://bugs.webkit.org/show_bug.cgi?id=76889 5 6 Reviewed by Adam Roben. 7 8 * UIProcess/win/WebPopupMenuProxyWin.cpp: 9 (WebKit::WebPopupMenuProxyWin::paint): Fix a dc leak and use the dellayed allocation. 10 1 11 2012-01-24 Sergio Villar Senin <svillar@igalia.com> 2 12 -
trunk/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
r103409 r105756 35 35 #include <WebCore/ScrollbarTheme.h> 36 36 #include <WebCore/BitmapInfo.h> 37 #include <WebCore/HWndDC.h> 37 38 #include <WebCore/PlatformMouseEvent.h> 38 39 #include <windowsx.h> … … 809 810 810 811 if (!m_DC) { 811 m_DC = ::CreateCompatibleDC( ::GetDC(m_popup));812 m_DC = ::CreateCompatibleDC(HWndDC(m_popup)); 812 813 if (!m_DC) 813 814 return; … … 849 850 m_scrollbar->paint(&context, damageRect); 850 851 851 HDC localDC = hdc ? hdc : ::GetDC(m_popup); 852 853 HWndDC hWndDC; 854 HDC localDC = hdc ? hdc : hWndDC.setHWnd(m_popup); 852 855 853 856 ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY); 854 855 if (!hdc)856 ::ReleaseDC(m_popup, localDC);857 857 } 858 858
Note:
See TracChangeset
for help on using the changeset viewer.