Bug 877115 - Moz2Dify CanvasLayerD3D10 drawing shared surface into D3D10_MAPPED_TEXTURE2D. r=nical
☠☠ backed out by 456104e27a9a ☠ ☠
authorAndreas Pehrson <pehrsons@gmail.com>
Mon, 13 Jan 2014 15:27:02 +0100
changeset 163191 bfd0864f189d666e851c82c6d8a6257b6cccf014
parent 163190 dba042cbc38138ddeef714c16822da1d843896d8
child 163192 e8366701a51b0dab44b679894d8b4de4b6533aee
push id25984
push userryanvm@gmail.com
push dateMon, 13 Jan 2014 22:44:31 +0000
treeherdermozilla-central@425579efbac3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs877115
milestone29.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 877115 - Moz2Dify CanvasLayerD3D10 drawing shared surface into D3D10_MAPPED_TEXTURE2D. r=nical
gfx/layers/d3d10/CanvasLayerD3D10.cpp
--- a/gfx/layers/d3d10/CanvasLayerD3D10.cpp
+++ b/gfx/layers/d3d10/CanvasLayerD3D10.cpp
@@ -161,35 +161,27 @@ CanvasLayerD3D10::UpdateSurface()
         HRESULT hr = mTexture->Map(0, D3D10_MAP_WRITE_DISCARD, 0, &map);
 
         if (FAILED(hr)) {
           NS_WARNING("Failed to map CanvasLayer texture.");
           return;
         }
 
         DataSourceSurface* frameData = shareSurf->GetData();
-        // Scope for gfxContext, so it's destroyed before Unmap.
+        // Scope for DrawTarget, so it's destroyed before Unmap.
         {
           RefPtr<DrawTarget> mapDt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
                                                                       (uint8_t*)map.pData,
-                                                                      shareSurf->Size(),
+                                                                      frameData->GetSize(),
                                                                       map.RowPitch,
                                                                       SurfaceFormat::B8G8R8A8);
 
-          nsRefPtr<gfxImageSurface> thebesFrameData =
-              new gfxImageSurface(frameData->GetData(),
-                                  ThebesIntSize(frameData->GetSize()),
-                                  frameData->Stride(),
-                                  SurfaceFormatToImageFormat(frameData->GetFormat()));
-
-          nsRefPtr<gfxContext> ctx = new gfxContext(mapDt);
-          ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
-          ctx->SetSource(thebesFrameData);
-          ctx->Paint();
-
+          Rect drawRect(0, 0, frameData->GetSize().width, frameData->GetSize().height);
+          mapDt->DrawSurface(frameData, drawRect, drawRect,
+                             DrawSurfaceOptions(),  DrawOptions(1.0F, OP_SOURCE));
           mapDt->Flush();
         }
 
         mTexture->Unmap(0);
         mSRView = mUploadSRView;
         break;
       }