Bug 943204. Fix transparent windows with the basic compositor. r=dvander
authorNicholas Cameron <ncameron@mozilla.com>
Wed, 04 Dec 2013 11:56:11 +1300
changeset 174311 27a9c236606b61daab8ead8ecfea7d523c3d3414
parent 174310 5f07f8e8583162a1f06b427e167997583eca8330
child 174312 e52c27213bb7d7c266ab9b8adf3c6ff07a144bd6
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs943204
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 943204. Fix transparent windows with the basic compositor. r=dvander
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -3510,41 +3510,43 @@ nsWindow::OverrideSystemMouseScrollSpeed
   return NS_OK;
 }
 
 mozilla::TemporaryRef<mozilla::gfx::DrawTarget>
 nsWindow::StartRemoteDrawing()
 {
   MOZ_ASSERT(!mCompositeDC);
 
-  HDC dc = GetDC(mWnd);
+  HDC dc = (HDC)GetNativeData(NS_NATIVE_GRAPHIC);
   if (!dc) {
     return nullptr;
   }
 
   uint32_t flags = (mTransparencyMode == eTransparencyOpaque) ? 0 :
       gfxWindowsSurface::FLAG_IS_TRANSPARENT;
   nsRefPtr<gfxASurface> surf = new gfxWindowsSurface(dc, flags);
 
   mozilla::gfx::IntSize size(surf->GetSize().width, surf->GetSize().height);
   if (size.width <= 0 || size.height <= 0) {
-    ReleaseDC(mWnd, dc);
+    FreeNativeData(dc, NS_NATIVE_GRAPHIC);
     return nullptr;
   }
 
   MOZ_ASSERT(!mCompositeDC);
   mCompositeDC = dc;
 
   return mozilla::gfx::Factory::CreateDrawTargetForCairoSurface(surf->CairoSurface(), size);
 }
 
 void
 nsWindow::EndRemoteDrawing()
 {
-  ReleaseDC(mWnd, mCompositeDC);
+  MOZ_ASSERT(mCompositeDC);
+  UpdateTranslucentWindow();
+  FreeNativeData(mCompositeDC, NS_NATIVE_GRAPHIC);
   mCompositeDC = nullptr;
 }
 
 /**************************************************************
  **************************************************************
  **
  ** BLOCK: Moz Events
  **