Bug 816692 - Use the clipped imgIContainer when converting an nsDisplayBackgroundImage into a layer. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 10 Dec 2012 18:34:17 +1300
changeset 124567 bb0dbeb26f1d70f64940a07da8d9776fc28a6eab
parent 124566 222b76f9fa95b5932638c8aa63fa2aa3d72c770f
child 124568 1869f4cbee0b8b9b04b935564041dcf4bd1dac21
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs816692
milestone20.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 816692 - Use the clipped imgIContainer when converting an nsDisplayBackgroundImage into a layer. r=roc
layout/base/nsCSSRendering.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -4685,36 +4685,29 @@ nsImageRenderer::Draw(nsPresContext*    
     default:
       break;
   }
 }
 
 bool
 nsImageRenderer::IsRasterImage()
 {
-  if (mType != eStyleImageType_Image)
+  if (mType != eStyleImageType_Image || !mImageContainer)
     return false;
-  nsCOMPtr<imgIContainer> img;
-  if (NS_FAILED(mImage->GetImageData()->GetImage(getter_AddRefs(img))))
-    return false;
-  return img->GetType() == imgIContainer::TYPE_RASTER;
+  return mImageContainer->GetType() == imgIContainer::TYPE_RASTER;
 }
 
 already_AddRefed<mozilla::layers::ImageContainer>
 nsImageRenderer::GetContainer(LayerManager* aManager)
 {
-  if (mType != eStyleImageType_Image)
-    return nullptr;
-  nsCOMPtr<imgIContainer> img;
-  nsresult rv = mImage->GetImageData()->GetImage(getter_AddRefs(img));
-  if (NS_FAILED(rv))
+  if (mType != eStyleImageType_Image || !mImageContainer)
     return nullptr;
 
   nsRefPtr<ImageContainer> container;
-  rv = img->GetImageContainer(aManager, getter_AddRefs(container));
+  nsresult rv = mImageContainer->GetImageContainer(aManager, getter_AddRefs(container));
   NS_ENSURE_SUCCESS(rv, nullptr);
   return container.forget();
 }
 
 #define MAX_BLUR_RADIUS 300
 #define MAX_SPREAD_RADIUS 50
 
 static inline gfxIntSize