Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 30 Jun 2016 10:24:27 -0700
changeset 303311 a7d76de3b61befc41c027e64178af57a21efba23
parent 303310 bb16dc5e693602f19ade6b212d8babd6d038b918
child 303312 02fe9f94bde1e323cfabcc2e679ba431fdb9dea8
push id30386
push usercbook@mozilla.com
push dateFri, 01 Jul 2016 09:17:55 +0000
treeherdermozilla-central@fdcee57b4e4f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1282670
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth I found these issues locally by moving all of imagelib's .cpp files to SOURCES instead of UNIFIED_SOURCES. (That change isn't part of this patch, though.) MozReview-Commit-ID: 97Xpfu8eFE6
image/Downscaler.cpp
image/Downscaler.h
image/FrozenImage.cpp
image/ImageCacheKey.h
image/ImageWrapper.cpp
image/MultipartImage.cpp
image/SurfacePipe.h
image/decoders/nsICODecoder.h
image/imgFrame.cpp
--- a/image/Downscaler.cpp
+++ b/image/Downscaler.cpp
@@ -5,25 +5,29 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Downscaler.h"
 
 #include <algorithm>
 #include <ctime>
 #include "gfxPrefs.h"
 #include "image_operations.h"
+#include "mozilla/gfx/2D.h"
 #include "mozilla/SSE.h"
 #include "mozilla/mips.h"
 #include "convolver.h"
 #include "skia/include/core/SkTypes.h"
 
 using std::max;
 using std::swap;
 
 namespace mozilla {
+
+using gfx::IntRect;
+
 namespace image {
 
 Downscaler::Downscaler(const nsIntSize& aTargetSize)
   : mTargetSize(aTargetSize)
   , mOutputBuffer(nullptr)
   , mXFilter(MakeUnique<skia::ConvolutionFilter1D>())
   , mYFilter(MakeUnique<skia::ConvolutionFilter1D>())
   , mWindowCapacity(0)
--- a/image/Downscaler.h
+++ b/image/Downscaler.h
@@ -9,16 +9,17 @@
  * scaling implementation.
  */
 
 #ifndef mozilla_image_Downscaler_h
 #define mozilla_image_Downscaler_h
 
 #include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
+#include "gfxPoint.h"
 #include "nsRect.h"
 
 namespace skia {
   class ConvolutionFilter1D;
 } // namespace skia
 
 namespace mozilla {
 namespace image {
--- a/image/FrozenImage.cpp
+++ b/image/FrozenImage.cpp
@@ -3,16 +3,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "FrozenImage.h"
 
 namespace mozilla {
 
 using namespace gfx;
+using layers::ImageContainer;
+using layers::LayerManager;
 
 namespace image {
 
 NS_IMPL_ISUPPORTS_INHERITED0(FrozenImage, ImageWrapper)
 
 void
 FrozenImage::IncrementAnimationConsumers()
 {
--- a/image/ImageCacheKey.h
+++ b/image/ImageCacheKey.h
@@ -6,16 +6,17 @@
 /**
  * ImageCacheKey is the key type for the image cache (see imgLoader.h).
  */
 
 #ifndef mozilla_image_src_ImageCacheKey_h
 #define mozilla_image_src_ImageCacheKey_h
 
 #include "mozilla/Maybe.h"
+#include "mozilla/RefPtr.h"
 
 class nsIDocument;
 class nsIURI;
 
 namespace mozilla {
 namespace image {
 
 class ImageURL;
--- a/image/ImageWrapper.cpp
+++ b/image/ImageWrapper.cpp
@@ -8,16 +8,17 @@
 #include "mozilla/RefPtr.h"
 #include "Orientation.h"
 
 #include "mozilla/MemoryReporting.h"
 
 namespace mozilla {
 
 using gfx::DataSourceSurface;
+using gfx::IntSize;
 using gfx::SamplingFilter;
 using gfx::SourceSurface;
 using layers::LayerManager;
 using layers::ImageContainer;
 
 namespace image {
 
 // Inherited methods from Image.
--- a/image/MultipartImage.cpp
+++ b/image/MultipartImage.cpp
@@ -3,16 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MultipartImage.h"
 
 #include "imgINotificationObserver.h"
 
 namespace mozilla {
+
+using gfx::IntSize;
+using gfx::SourceSurface;
+
 namespace image {
 
 ///////////////////////////////////////////////////////////////////////////////
 // Helpers
 ///////////////////////////////////////////////////////////////////////////////
 
 class NextPartObserver : public IProgressObserver
 {
--- a/image/SurfacePipe.h
+++ b/image/SurfacePipe.h
@@ -19,16 +19,18 @@
  * underlying surface.
  */
 
 #ifndef mozilla_image_SurfacePipe_h
 #define mozilla_image_SurfacePipe_h
 
 #include <stdint.h>
 
+#include "nsDebug.h"
+
 #include "mozilla/Likely.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Move.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/unused.h"
 #include "mozilla/Variant.h"
 #include "mozilla/gfx/2D.h"
 
--- a/image/decoders/nsICODecoder.h
+++ b/image/decoders/nsICODecoder.h
@@ -8,16 +8,17 @@
 #define mozilla_image_decoders_nsICODecoder_h
 
 #include "StreamingLexer.h"
 #include "Decoder.h"
 #include "imgFrame.h"
 #include "nsBMPDecoder.h"
 #include "nsPNGDecoder.h"
 #include "ICOFileHeaders.h"
+#include "mozilla/gfx/2D.h"
 
 namespace mozilla {
 namespace image {
 
 class RasterImage;
 
 enum class ICOState
 {
@@ -109,18 +110,18 @@ private:
   LexerTransition<ICOState> FinishMask();
   LexerTransition<ICOState> FinishResource();
 
   StreamingLexer<ICOState, 32> mLexer; // The lexer.
   RefPtr<Decoder> mContainedDecoder; // Either a BMP or PNG decoder.
   UniquePtr<uint8_t[]> mMaskBuffer;    // A temporary buffer for the alpha mask.
   char mBIHraw[bmp::InfoHeaderLength::WIN_ICO]; // The bitmap information header.
   IconDirEntry mDirEntry;              // The dir entry for the selected resource.
-  IntSize mBiggestResourceSize;        // Used to select the intrinsic size.
-  IntSize mBiggestResourceHotSpot;     // Used to select the intrinsic size.
+  gfx::IntSize mBiggestResourceSize;   // Used to select the intrinsic size.
+  gfx::IntSize mBiggestResourceHotSpot; // Used to select the intrinsic size.
   uint16_t mBiggestResourceColorDepth; // Used to select the intrinsic size.
   int32_t mBestResourceDelta;          // Used to select the best resource.
   uint16_t mBestResourceColorDepth;    // Used to select the best resource.
   uint16_t mNumIcons; // Stores the number of icons in the ICO file.
   uint16_t mCurrIcon; // Stores the current dir entry index we are processing.
   uint16_t mBPP;      // The BPP of the resource we're decoding.
   uint32_t mMaskRowSize;  // The size in bytes of each row in the BMP alpha mask.
   uint32_t mCurrMaskLine; // The line of the BMP alpha mask we're processing.
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -7,16 +7,17 @@
 #include "imgFrame.h"
 #include "ImageRegion.h"
 #include "ShutdownTracker.h"
 
 #include "prenv.h"
 
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"
+#include "gfxPrefs.h"
 #include "gfxUtils.h"
 #include "gfxAlphaRecovery.h"
 
 #include "GeckoProfiler.h"
 #include "MainThreadUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/gfx/Tools.h"
 #include "mozilla/Likely.h"