diff options
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) |