https://bugs.webkit.org/show_bug.cgi?id=76889
Reviewed by Adam Roben.
Source/WebCore:
No new functionality so no new tests.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::shapeAndPlaceItem): Simple replacement.
(WebCore::UniscribeController::shape): Use the delayed allocation.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint): Fix a dc leak and use the dellayed allocation.
Source/WebKit2:
* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::paint): Fix a dc leak and use the dellayed allocation.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105756
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-24 David Levin <levin@chromium.org>
+
+ [windows] Convert usage of GetDC to HWndDC Part 3.
+ https://bugs.webkit.org/show_bug.cgi?id=76889
+
+ Reviewed by Adam Roben.
+
+ No new functionality so no new tests.
+
+ * platform/graphics/win/UniscribeController.cpp:
+ (WebCore::UniscribeController::shapeAndPlaceItem): Simple replacement.
+ (WebCore::UniscribeController::shape): Use the delayed allocation.
+ * platform/win/PopupMenuWin.cpp:
+ (WebCore::PopupMenuWin::paint): Fix a dc leak and use the dellayed allocation.
+
2012-01-24 Mario Sanchez Prada <msanchez@igalia.com>
[GTK] Refactor GTK's accessibilitity code to be more modular
#include "config.h"
#include "UniscribeController.h"
#include "Font.h"
+#include "HWndDC.h"
#include "SimpleFontData.h"
#include "TextRun.h"
#include <wtf/MathExtras.h>
if (placeResult == E_PENDING) {
// The script cache isn't primed with enough info yet. We need to select our HFONT into
// a DC and pass the DC in to ScriptPlace.
- HDC hdc = GetDC(0);
+ HWndDC hdc(0);
HFONT hfont = fontData->platformData().hfont();
HFONT oldFont = (HFONT)SelectObject(hdc, hfont);
placeResult = ScriptPlace(hdc, fontData->scriptCache(), glyphs.data(), glyphs.size(), visualAttributes.data(),
&item.a, advances.data(), offsets.data(), 0);
SelectObject(hdc, oldFont);
- ReleaseDC(0, hdc);
}
if (FAILED(placeResult) || glyphs.isEmpty())
Vector<WORD>& glyphs, Vector<WORD>& clusters,
Vector<SCRIPT_VISATTR>& visualAttributes)
{
- HDC hdc = 0;
+ HWndDC hdc;
HFONT oldFont = 0;
HRESULT shapeResult = E_PENDING;
int glyphCount = 0;
// The script cache isn't primed with enough info yet. We need to select our HFONT into
// a DC and pass the DC in to ScriptShape.
ASSERT(!hdc);
- hdc = GetDC(0);
+ hdc.setHWnd(0);
HFONT hfont = fontData->platformData().hfont();
oldFont = (HFONT)SelectObject(hdc, hfont);
} else if (shapeResult == E_OUTOFMEMORY) {
}
} while (shapeResult == E_PENDING || shapeResult == E_OUTOFMEMORY);
- if (hdc) {
+ if (hdc)
SelectObject(hdc, oldFont);
- ReleaseDC(0, hdc);
- }
if (FAILED(shapeResult))
return false;
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLNames.h"
+#include "HWndDC.h"
#include "HostWindow.h"
#include "Page.h"
#include "PlatformMouseEvent.h"
#include "SimpleFontData.h"
#include "TextRun.h"
#include "WebCoreInstanceHandle.h"
+
#include <windows.h>
#include <windowsx.h>
#if OS(WINCE)
return;
if (!m_DC) {
- m_DC = ::CreateCompatibleDC(::GetDC(m_popup));
+ m_DC = ::CreateCompatibleDC(HWndDC(m_popup));
if (!m_DC)
return;
}
if (m_scrollbar)
m_scrollbar->paint(&context, damageRect);
- HDC localDC = hdc ? hdc : ::GetDC(m_popup);
+ HWndDC hWndDC;
+ HDC localDC = hdc ? hdc : hWndDC.setHWnd(m_popup);
::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY);
-
- if (!hdc)
- ::ReleaseDC(m_popup, localDC);
}
int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const
+2012-01-24 David Levin <levin@chromium.org>
+
+ [windows] Convert usage of GetDC to HWndDC Part 3.
+ https://bugs.webkit.org/show_bug.cgi?id=76889
+
+ Reviewed by Adam Roben.
+
+ * UIProcess/win/WebPopupMenuProxyWin.cpp:
+ (WebKit::WebPopupMenuProxyWin::paint): Fix a dc leak and use the dellayed allocation.
+
2012-01-24 Sergio Villar Senin <svillar@igalia.com>
[WK2] [GTK] TestDownloads hitting an assertion in Debug builds
#include <WebCore/WebCoreInstanceHandle.h>
#include <WebCore/ScrollbarTheme.h>
#include <WebCore/BitmapInfo.h>
+#include <WebCore/HWndDC.h>
#include <WebCore/PlatformMouseEvent.h>
#include <windowsx.h>
return;
if (!m_DC) {
- m_DC = ::CreateCompatibleDC(::GetDC(m_popup));
+ m_DC = ::CreateCompatibleDC(HWndDC(m_popup));
if (!m_DC)
return;
}
if (m_scrollbar)
m_scrollbar->paint(&context, damageRect);
- HDC localDC = hdc ? hdc : ::GetDC(m_popup);
- ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY);
+ HWndDC hWndDC;
+ HDC localDC = hdc ? hdc : hWndDC.setHWnd(m_popup);
- if (!hdc)
- ::ReleaseDC(m_popup, localDC);
+ ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC, damageRect.x(), damageRect.y(), SRCCOPY);
}
bool WebPopupMenuProxyWin::setFocusedIndex(int i, bool hotTracking)