Bug 963962 - Fix use of CreateDrawTargetForData in CanvasLayerD3D9/10. r=Bas
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 07 Apr 2014 10:24:14 -0400
changeset 195799 0ac3e117921102e3a80102032c5ba9d07a252717
parent 195798 1cdcddd3c65646b7ed8fe7c1fed749cb1ffec388
child 195800 efd2b6b51237e5017967b5e6e5b8db342881f3c1
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas
bugs963962
milestone31.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 963962 - Fix use of CreateDrawTargetForData in CanvasLayerD3D9/10. r=Bas
gfx/layers/d3d10/CanvasLayerD3D10.cpp
gfx/layers/d3d9/CanvasLayerD3D9.cpp
--- a/gfx/layers/d3d10/CanvasLayerD3D10.cpp
+++ b/gfx/layers/d3d10/CanvasLayerD3D10.cpp
@@ -140,19 +140,20 @@ CanvasLayerD3D10::UpdateSurface()
         if (FAILED(hr)) {
           NS_WARNING("Failed to map CanvasLayer texture.");
           return;
         }
 
         DataSourceSurface* frameData = shareSurf->GetData();
         // Scope for DrawTarget, so it's destroyed before Unmap.
         {
+          IntSize boundsSize(mBounds.width, mBounds.height);
           RefPtr<DrawTarget> mapDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
                                                                       (uint8_t*)map.pData,
-                                                                      frameData->GetSize(),
+                                                                      boundsSize,
                                                                       map.RowPitch,
                                                                       SurfaceFormat::B8G8R8A8);
 
           Rect drawRect(0, 0, frameData->GetSize().width, frameData->GetSize().height);
           mapDt->DrawSurface(frameData, drawRect, drawRect,
                              DrawSurfaceOptions(),  DrawOptions(1.0F, CompositionOp::OP_SOURCE));
           mapDt->Flush();
         }
--- a/gfx/layers/d3d9/CanvasLayerD3D9.cpp
+++ b/gfx/layers/d3d9/CanvasLayerD3D9.cpp
@@ -93,19 +93,20 @@ CanvasLayerD3D9::UpdateSurface()
   // WebGL reads entire surface.
   LockTextureRectD3D9 textureLock(mTexture);
   if (!textureLock.HasLock()) {
     NS_WARNING("Failed to lock CanvasLayer texture.");
     return;
   }
 
   D3DLOCKED_RECT rect = textureLock.GetLockRect();
+  IntSize boundsSize(mBounds.width, mBounds.height);
   RefPtr<DrawTarget> rectDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
                                                                (uint8_t*)rect.pBits,
-                                                               surface->GetSize(),
+                                                               boundsSize,
                                                                rect.Pitch,
                                                                SurfaceFormat::B8G8R8A8);
 
   Rect drawRect(0, 0, surface->GetSize().width, surface->GetSize().height);
   rectDt->DrawSurface(surface, drawRect, drawRect,
                       DrawSurfaceOptions(),  DrawOptions(1.0F, CompositionOp::OP_SOURCE));
   rectDt->Flush();
 }