diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
commit | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch) | |
tree | 8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit/win/FullscreenVideoController.cpp | |
parent | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff) | |
download | qtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz |
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit/win/FullscreenVideoController.cpp')
-rw-r--r-- | Source/WebKit/win/FullscreenVideoController.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/WebKit/win/FullscreenVideoController.cpp b/Source/WebKit/win/FullscreenVideoController.cpp index 30405c67d..29ffacd0e 100644 --- a/Source/WebKit/win/FullscreenVideoController.cpp +++ b/Source/WebKit/win/FullscreenVideoController.cpp @@ -37,11 +37,14 @@ #include <WebCore/Font.h> #include <WebCore/FontSelector.h> #include <WebCore/GraphicsContext.h> +#include <WebCore/HWndDC.h> #include <WebCore/Page.h> #include <WebCore/PlatformCALayer.h> #include <WebCore/TextRun.h> #include <WebKitSystemInterface/WebKitSystemInterface.h> #include <windowsx.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> #include <wtf/StdLibExtras.h> using namespace std; @@ -192,6 +195,7 @@ private: virtual bool platformCALayerContentsOpaque() const { return false; } virtual bool platformCALayerDrawsContent() const { return false; } virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { } + virtual void platformCALayerDidCreateTiles() { } FullscreenVideoController* m_parent; }; @@ -482,12 +486,10 @@ static String timeToString(float time) void FullscreenVideoController::draw() { - HDC windowDC = GetDC(m_hudWindow); - HDC bitmapDC = CreateCompatibleDC(windowDC); - ::ReleaseDC(m_hudWindow, windowDC); - HGDIOBJ oldBitmap = SelectObject(bitmapDC, m_bitmap.get()); + OwnPtr<HDC> bitmapDC = adoptPtr(CreateCompatibleDC(HWndDC(m_hudWindow))); + HGDIOBJ oldBitmap = SelectObject(bitmapDC.get(), m_bitmap.get()); - GraphicsContext context(bitmapDC, true); + GraphicsContext context(bitmapDC.get(), true); context.save(); @@ -549,12 +551,11 @@ void FullscreenVideoController::draw() SIZE size = { windowWidth, windowHeight }; POINT sourcePoint = {0, 0}; POINT destPoint = { m_hudPosition.x(), m_hudPosition.y() }; - BOOL result = UpdateLayeredWindow(m_hudWindow, 0, &destPoint, &size, bitmapDC, &sourcePoint, 0, &blendFunction, ULW_ALPHA); + BOOL result = UpdateLayeredWindow(m_hudWindow, 0, &destPoint, &size, bitmapDC.get(), &sourcePoint, 0, &blendFunction, ULW_ALPHA); context.restore(); - ::SelectObject(bitmapDC, oldBitmap); - ::DeleteDC(bitmapDC); + ::SelectObject(bitmapDC.get(), oldBitmap); } LRESULT FullscreenVideoController::hudWndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam) |