Bug 990683 - Stop calling DeprecatedGetCurrentAsSurface in nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,...). (Moz2D migration.) r=mattwoodrow
authorJonathan Watt <jwatt@jwatt.org>
Wed, 02 Apr 2014 12:32:24 +0100
changeset 195192 d8f57bd2d2f47275f8f06a14e4a81ccb82d4ab05
parent 195191 1b93e18997b54b88aa1e6d88c4b81dd08f965e38
child 195193 9a165f00b45a4c5238f3523719ea0efe8e0bb8b9
push idunknown
push userunknown
push dateunknown
reviewersmattwoodrow
bugs990683
milestone31.0a1
Bug 990683 - Stop calling DeprecatedGetCurrentAsSurface in nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,...). (Moz2D migration.) r=mattwoodrow
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5341,21 +5341,20 @@ nsLayoutUtils::SurfaceFromElement(HTMLVi
   if (!principal)
     return result;
 
   ImageContainer *container = aElement->GetImageContainer();
   if (!container)
     return result;
 
   mozilla::gfx::IntSize size;
-  nsRefPtr<gfxASurface> surf = container->DeprecatedGetCurrentAsSurface(&size);
-  if (!surf)
+  result.mSourceSurface = container->GetCurrentAsSourceSurface(&size);
+  if (!result.mSourceSurface)
     return result;
 
-  result.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(aTarget, surf);
   result.mCORSUsed = aElement->GetCORSMode() != CORS_NONE;
   result.mSize = ThebesIntSize(size);
   result.mPrincipal = principal.forget();
   result.mIsWriteOnly = false;
 
   return result;
 }