Bug 913586 (Part 5) - Update Maybe users in image. r=tn

--HG--
extra : rebase_source : 694928307fd724af821f51374bcf6fefb28fef5f
This commit is contained in:
Seth Fowler 2014-08-13 15:39:41 -07:00
Родитель 0fd6e994ae
Коммит 1dda1c5358
2 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -40,7 +40,7 @@ public:
{
MOZ_ASSERT(mSurface, "Must have a valid surface");
if (aSVGContext) {
mSVGContext.construct(*aSVGContext);
mSVGContext.emplace(*aSVGContext);
}
}
@ -49,8 +49,8 @@ public:
float aFrame,
uint32_t aFlags)
{
bool matchesSVGContext = (!aSVGContext && mSVGContext.empty()) ||
*aSVGContext == mSVGContext.ref();
bool matchesSVGContext = (!aSVGContext && !mSVGContext) ||
(*aSVGContext == *mSVGContext);
return mViewportSize == aViewportSize &&
matchesSVGContext &&
mFrame == aFrame &&
@ -128,13 +128,13 @@ ClippedImage::ShouldClip()
// once they're available to determine if it's valid and whether we actually
// need to do any work. We may fail if the image's width and height aren't
// available yet, in which case we'll try again later.
if (mShouldClip.empty()) {
if (mShouldClip.isNothing()) {
int32_t width, height;
nsRefPtr<imgStatusTracker> innerImageStatusTracker =
InnerImage()->GetStatusTracker();
if (InnerImage()->HasError()) {
// If there's a problem with the inner image we'll let it handle everything.
mShouldClip.construct(false);
mShouldClip.emplace(false);
} else if (NS_SUCCEEDED(InnerImage()->GetWidth(&width)) && width > 0 &&
NS_SUCCEEDED(InnerImage()->GetHeight(&height)) && height > 0) {
// Clamp the clipping region to the size of the underlying image.
@ -142,7 +142,7 @@ ClippedImage::ShouldClip()
// If the clipping region is the same size as the underlying image we
// don't have to do anything.
mShouldClip.construct(!mClip.IsEqualInterior(nsIntRect(0, 0, width, height)));
mShouldClip.emplace(!mClip.IsEqualInterior(nsIntRect(0, 0, width, height)));
} else if (innerImageStatusTracker &&
innerImageStatusTracker->IsLoading()) {
// The image just hasn't finished loading yet. We don't yet know whether
@ -152,12 +152,12 @@ ClippedImage::ShouldClip()
} else {
// We have a fully loaded image without a clearly defined width and
// height. This can happen with SVG images.
mShouldClip.construct(false);
mShouldClip.emplace(false);
}
}
MOZ_ASSERT(!mShouldClip.empty(), "Should have computed a result");
return mShouldClip.ref();
MOZ_ASSERT(mShouldClip.isSome(), "Should have computed a result");
return *mShouldClip;
}
NS_IMPL_ISUPPORTS_INHERITED0(ClippedImage, ImageWrapper)

Просмотреть файл

@ -48,16 +48,16 @@ public:
void SetSize(int32_t width, int32_t height, Orientation orientation)
{
mSize.construct(nsIntSize(width, height));
mOrientation.construct(orientation);
mSize.emplace(nsIntSize(width, height));
mOrientation.emplace(orientation);
}
bool HasSize() const { return !mSize.empty(); }
bool HasOrientation() const { return !mOrientation.empty(); }
bool HasSize() const { return mSize.isSome(); }
bool HasOrientation() const { return mOrientation.isSome(); }
int32_t GetWidth() const { return mSize.ref().width; }
int32_t GetHeight() const { return mSize.ref().height; }
Orientation GetOrientation() const { return mOrientation.ref(); }
int32_t GetWidth() const { return mSize->width; }
int32_t GetHeight() const { return mSize->height; }
Orientation GetOrientation() const { return *mOrientation; }
private:
// The hotspot found on cursors, or -1 if none was found.