Bug 1321877. Fix compiler warnings in Downscaler.h when skia is not enabled. r=tnikkel
author<tharvik@gmail.com>
Thu, 08 Dec 2016 18:20:12 -0600
changeset 325461 5cebfb1902a202b578c35d65575096348cdedf2b
parent 325460 8faf0055fb54eb3b5394b5a92e7fbc121a0897b5
child 325462 d8f60ae71774924b84fb6347057c7fd45394ed03
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerstnikkel
bugs1321877
milestone53.0a1
Bug 1321877. Fix compiler warnings in Downscaler.h when skia is not enabled. r=tnikkel
image/Downscaler.h
--- a/image/Downscaler.h
+++ b/image/Downscaler.h
@@ -149,39 +149,42 @@ private:
 /**
  * Downscaler requires Skia to work, so we provide a dummy implementation if
  * Skia is disabled that asserts if constructed.
  */
 
 class Downscaler
 {
 public:
-  explicit Downscaler(const nsIntSize&)
+  explicit Downscaler(const nsIntSize&) : mScale(1.0, 1.0)
   {
     MOZ_RELEASE_ASSERT(false, "Skia is not enabled");
   }
 
-  const nsIntSize& OriginalSize() const { return nsIntSize(); }
-  const nsIntSize& TargetSize() const { return nsIntSize(); }
-  const gfxSize& Scale() const { return gfxSize(1.0, 1.0); }
+  const nsIntSize& OriginalSize() const { return mSize; }
+  const nsIntSize& TargetSize() const { return mSize; }
+  const gfxSize& Scale() const { return mScale; }
 
   nsresult BeginFrame(const nsIntSize&, const Maybe<nsIntRect>&, uint8_t*, bool, bool = false)
   {
     return NS_ERROR_FAILURE;
   }
 
   bool IsFrameComplete() const { return false; }
   uint8_t* RowBuffer() { return nullptr; }
   void ClearRow() { }
   void ClearRestOfRow(uint32_t) { }
   void CommitRow() { }
   bool HasInvalidation() const { return false; }
   DownscalerInvalidRect TakeInvalidRect() { return DownscalerInvalidRect(); }
   void ResetForNextProgressivePass() { }
   const nsIntSize FrameSize() const { return nsIntSize(0, 0); }
+private:
+  nsIntSize mSize;
+  gfxSize mScale;
 };
 
 #endif // MOZ_ENABLE_SKIA
 
 
 
 } // namespace image
 } // namespace mozilla