зеркало из https://github.com/mozilla/gecko-dev.git
Bug 826093 (Part 3) - Use ClippedImage instead of ExtractFrame for -moz-image-rect. r=bz
--HG-- extra : rebase_source : 7abecbcfcda5666e6b23895dbf6cd42991044914
This commit is contained in:
Родитель
a6687427e7
Коммит
2c0c4892e2
|
@ -30,6 +30,7 @@
|
|||
#include "nsIScrollableFrame.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "ImageOps.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsCSSColorUtils.h"
|
||||
#include "nsITheme.h"
|
||||
|
@ -60,6 +61,7 @@
|
|||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::css;
|
||||
using mozilla::image::ImageOps;
|
||||
|
||||
static int gFrameTreeLockCount = 0;
|
||||
|
||||
|
@ -4293,18 +4295,7 @@ nsImageRenderer::PrepareImage()
|
|||
// The cropped image is identical to the source image
|
||||
mImageContainer.swap(srcImage);
|
||||
} else {
|
||||
nsCOMPtr<imgIContainer> subImage;
|
||||
uint32_t aExtractFlags = (mFlags & FLAG_SYNC_DECODE_IMAGES)
|
||||
? (uint32_t) imgIContainer::FLAG_SYNC_DECODE
|
||||
: (uint32_t) imgIContainer::FLAG_NONE;
|
||||
nsresult rv = srcImage->ExtractFrame(imgIContainer::FRAME_CURRENT,
|
||||
actualCropRect, aExtractFlags,
|
||||
getter_AddRefs(subImage));
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("The cropped image contains no pixels to draw; "
|
||||
"maybe the crop rect is outside the image frame rect");
|
||||
return false;
|
||||
}
|
||||
nsCOMPtr<imgIContainer> subImage = ImageOps::Clip(srcImage, actualCropRect);
|
||||
mImageContainer.swap(subImage);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ random-if(bug685516) asserts(0-2) == background-draw-nothing-malformed-images.ht
|
|||
random-if(bug685516) == background-monster-rect.html background-monster-rect-ref.html
|
||||
random-if(bug685516) == background-over-size-rect.html background-over-size-rect-ref.html
|
||||
random-if(bug685516) == background-test-parser.html background-test-parser-ref.html
|
||||
random-if(bug685516) == background-with-other-properties.html background-with-other-properties-ref.html
|
||||
random-if(bug685516) fuzzy-if(Android||B2G,113,124) == background-with-other-properties.html background-with-other-properties-ref.html
|
||||
random-if(bug685516) == background-zoom-1.html background-zoom-1-ref.html
|
||||
random-if(bug685516) == background-zoom-2.html background-zoom-2-ref.html
|
||||
random-if(bug685516) == background-zoom-3.html background-zoom-3-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче