# HG changeset patch # User Andrew Osmond # Date 1518175675 18000 # Node ID 4afd35f217c1bc90ecdd6b010d564852a59c5eca # Parent d9da3f3bf43203a0ad3de87adfd8298c5e5e85a2 Bug 1435456 - Remove asserts checking that downscale-on-decode is enabled. r=tnikkel These asserts are somewhat faulty given the image.downscale-during-decode.enabled preference is a live preference and thus can change at any time. Given the decision to downscale is made on the main thread, and it is asserted on a decoder thread, this will always be inherently racy. Most of the time this isn't a problem, but with our automated tests, we frequently flip this preference, and the assertion may fail unnecessarily with an unrelated image. The reftests themselves verify downscaling did or did not occur based upon comparison to the reference, and don't require the assert for verification. diff --git a/image/Downscaler.cpp b/image/Downscaler.cpp --- a/image/Downscaler.cpp +++ b/image/Downscaler.cpp @@ -22,18 +22,16 @@ namespace image { Downscaler::Downscaler(const nsIntSize& aTargetSize) : mTargetSize(aTargetSize) , mOutputBuffer(nullptr) , mWindowCapacity(0) , mHasAlpha(true) , mFlipVertically(false) { - MOZ_ASSERT(gfxPrefs::ImageDownscaleDuringDecodeEnabled(), - "Downscaling even though downscale-during-decode is disabled?"); MOZ_ASSERT(mTargetSize.width > 0 && mTargetSize.height > 0, "Invalid target size"); } Downscaler::~Downscaler() { ReleaseWindow(); } diff --git a/image/DownscalingFilter.h b/image/DownscalingFilter.h --- a/image/DownscalingFilter.h +++ b/image/DownscalingFilter.h @@ -93,20 +93,17 @@ class DownscalingFilter final : public S { public: DownscalingFilter() : mWindowCapacity(0) , mRowsInWindow(0) , mInputRow(0) , mOutputRow(0) , mHasAlpha(true) - { - MOZ_ASSERT(gfxPrefs::ImageDownscaleDuringDecodeEnabled(), - "Downscaling even though downscale-during-decode is disabled?"); - } + { } ~DownscalingFilter() { ReleaseWindow(); } template nsresult Configure(const DownscalingConfig& aConfig, Rest... aRest)