mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Bug 1006123, part 1: Revert bug 929513's imagelib changes to go back to using double-based gfxSize (instead of float-based gfx::Size) in RasterImage. r=seth
This commit is contained in:
parent
b5369087ad
commit
bdc7c67bb6
@ -182,7 +182,7 @@ DiscardingEnabled()
|
|||||||
class ScaleRequest
|
class ScaleRequest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScaleRequest(RasterImage* aImage, const gfx::Size& aScale, imgFrame* aSrcFrame)
|
ScaleRequest(RasterImage* aImage, const gfxSize& aScale, imgFrame* aSrcFrame)
|
||||||
: scale(aScale)
|
: scale(aScale)
|
||||||
, dstLocked(false)
|
, dstLocked(false)
|
||||||
, done(false)
|
, done(false)
|
||||||
@ -276,7 +276,7 @@ public:
|
|||||||
nsRefPtr<gfxImageSurface> dstSurface;
|
nsRefPtr<gfxImageSurface> dstSurface;
|
||||||
|
|
||||||
// Below are the values that may be touched on the scaling thread.
|
// Below are the values that may be touched on the scaling thread.
|
||||||
gfx::Size scale;
|
gfxSize scale;
|
||||||
uint8_t* srcData;
|
uint8_t* srcData;
|
||||||
uint8_t* dstData;
|
uint8_t* dstData;
|
||||||
nsIntRect srcRect;
|
nsIntRect srcRect;
|
||||||
@ -327,7 +327,7 @@ private: /* members */
|
|||||||
class ScaleRunner : public nsRunnable
|
class ScaleRunner : public nsRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScaleRunner(RasterImage* aImage, const gfx::Size& aScale, imgFrame* aSrcFrame)
|
ScaleRunner(RasterImage* aImage, const gfxSize& aScale, imgFrame* aSrcFrame)
|
||||||
{
|
{
|
||||||
nsAutoPtr<ScaleRequest> request(new ScaleRequest(aImage, aScale, aSrcFrame));
|
nsAutoPtr<ScaleRequest> request(new ScaleRequest(aImage, aScale, aSrcFrame));
|
||||||
|
|
||||||
@ -2510,7 +2510,7 @@ RasterImage::SyncDecode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
RasterImage::CanQualityScale(const gfx::Size& scale)
|
RasterImage::CanQualityScale(const gfxSize& scale)
|
||||||
{
|
{
|
||||||
// If target size is 1:1 with original, don't scale.
|
// If target size is 1:1 with original, don't scale.
|
||||||
if (scale.width == 1.0 && scale.height == 1.0)
|
if (scale.width == 1.0 && scale.height == 1.0)
|
||||||
@ -2528,7 +2528,7 @@ RasterImage::CanQualityScale(const gfx::Size& scale)
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
RasterImage::CanScale(GraphicsFilter aFilter,
|
RasterImage::CanScale(GraphicsFilter aFilter,
|
||||||
gfx::Size aScale, uint32_t aFlags)
|
gfxSize aScale, uint32_t aFlags)
|
||||||
{
|
{
|
||||||
// The high-quality scaler requires Skia.
|
// The high-quality scaler requires Skia.
|
||||||
#ifdef MOZ_ENABLE_SKIA
|
#ifdef MOZ_ENABLE_SKIA
|
||||||
@ -2604,7 +2604,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(imgFrame *aFrame,
|
|||||||
gfxMatrix userSpaceToImageSpace = aUserSpaceToImageSpace;
|
gfxMatrix userSpaceToImageSpace = aUserSpaceToImageSpace;
|
||||||
gfxMatrix imageSpaceToUserSpace = aUserSpaceToImageSpace;
|
gfxMatrix imageSpaceToUserSpace = aUserSpaceToImageSpace;
|
||||||
imageSpaceToUserSpace.Invert();
|
imageSpaceToUserSpace.Invert();
|
||||||
gfx::Size scale = ToSize(imageSpaceToUserSpace.ScaleFactors(true));
|
gfxSize scale = imageSpaceToUserSpace.ScaleFactors(true);
|
||||||
nsIntRect subimage = aSubimage;
|
nsIntRect subimage = aSubimage;
|
||||||
nsRefPtr<gfxASurface> surf;
|
nsRefPtr<gfxASurface> surf;
|
||||||
|
|
||||||
|
@ -733,8 +733,8 @@ private: // data
|
|||||||
bool IsDecodeFinished();
|
bool IsDecodeFinished();
|
||||||
TimeStamp mDrawStartTime;
|
TimeStamp mDrawStartTime;
|
||||||
|
|
||||||
inline bool CanQualityScale(const gfx::Size& scale);
|
inline bool CanQualityScale(const gfxSize& scale);
|
||||||
inline bool CanScale(GraphicsFilter aFilter, gfx::Size aScale, uint32_t aFlags);
|
inline bool CanScale(GraphicsFilter aFilter, gfxSize aScale, uint32_t aFlags);
|
||||||
|
|
||||||
struct ScaleResult
|
struct ScaleResult
|
||||||
{
|
{
|
||||||
@ -742,7 +742,7 @@ private: // data
|
|||||||
: status(SCALE_INVALID)
|
: status(SCALE_INVALID)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
gfx::Size scale;
|
gfxSize scale;
|
||||||
nsAutoPtr<imgFrame> frame;
|
nsAutoPtr<imgFrame> frame;
|
||||||
ScaleStatus status;
|
ScaleStatus status;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user