Bug 1162350 - Define and use DownscalerInvalidRect for non-skia builds. r=seth

This commit is contained in:
Steve Singer 2015-05-07 20:36:00 +02:00
parent 95e04ef470
commit 7071d6a9b8

View File

@ -15,7 +15,6 @@
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "nsRect.h" #include "nsRect.h"
#ifdef MOZ_ENABLE_SKIA
namespace skia { namespace skia {
class ConvolutionFilter1D; class ConvolutionFilter1D;
@ -34,6 +33,8 @@ struct DownscalerInvalidRect
nsIntRect mTargetSizeRect; nsIntRect mTargetSizeRect;
}; };
#ifdef MOZ_ENABLE_SKIA
/** /**
* Downscaler is a high-quality, streaming image downscaler based upon Skia's * Downscaler is a high-quality, streaming image downscaler based upon Skia's
* scaling implementation. * scaling implementation.
@ -119,21 +120,13 @@ private:
bool mHasAlpha; bool mHasAlpha;
}; };
} // namespace image
} // namespace mozilla
#else #else
/** /**
* Downscaler requires Skia to work, so we provide a dummy implementation if * Downscaler requires Skia to work, so we provide a dummy implementation if
* Skia is disabled that asserts if constructed. * Skia is disabled that asserts if constructed.
*/ */
namespace mozilla {
namespace image {
class Downscaler class Downscaler
{ {
public: public:
@ -144,6 +137,7 @@ public:
const nsIntSize& OriginalSize() const { return nsIntSize(); } const nsIntSize& OriginalSize() const { return nsIntSize(); }
const nsIntSize& TargetSize() const { return nsIntSize(); } const nsIntSize& TargetSize() const { return nsIntSize(); }
const gfxSize& Scale() const { return gfxSize(1.0, 1.0); }
nsresult BeginFrame(const nsIntSize&, uint8_t*, bool) nsresult BeginFrame(const nsIntSize&, uint8_t*, bool)
{ {
@ -153,14 +147,13 @@ public:
uint8_t* RowBuffer() { return nullptr; } uint8_t* RowBuffer() { return nullptr; }
void CommitRow() { } void CommitRow() { }
bool HasInvalidation() const { return false; } bool HasInvalidation() const { return false; }
nsIntRect TakeInvalidRect() { return nsIntRect(); } DownscalerInvalidRect TakeInvalidRect() { return DownscalerInvalidRect(); }
void ResetForNextProgressivePass() { } void ResetForNextProgressivePass() { }
}; };
#endif // MOZ_ENABLE_SKIA
} // namespace image } // namespace image
} // namespace mozilla } // namespace mozilla
#endif // MOZ_ENABLE_SKIA
#endif // mozilla_image_src_Downscaler_h #endif // mozilla_image_src_Downscaler_h