Bug 903819 - Don't include Layers.h everywhere, part 4 r=nrc
authorDavid Zbarsky <dzbarsky@gmail.com>
Tue, 20 Aug 2013 15:45:30 -0400
changeset 143254 501af2a0ca170a19c5b49ecfda3602d79a3a8f50
parent 143253 cb767d718f4bf042ab399387a7635b15d1ea5305
child 143255 395ba08436fdc7187c73c9ae80a1b07f9ef89d92
push id32683
push userdzbarsky@gmail.com
push dateTue, 20 Aug 2013 19:44:07 +0000
treeherdermozilla-inbound@501af2a0ca17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnrc
bugs903819
milestone26.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 903819 - Don't include Layers.h everywhere, part 4 r=nrc
content/html/content/src/HTMLAnchorElement.h
content/media/MediaDecoderReader.h
content/media/dash/DASHRepDecoder.h
dom/ipc/ContentParent.h
gfx/ipc/GfxMessageUtils.h
gfx/layers/Compositor.h
gfx/layers/ImageLayers.h
gfx/layers/LayerTreeInvalidation.cpp
gfx/layers/LayersTypes.h
gfx/layers/YCbCrImageDataSerializer.h
gfx/layers/ipc/LayerTransaction.ipdlh
layout/generic/nsObjectFrame.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
view/src/nsViewManager.cpp
--- a/content/html/content/src/HTMLAnchorElement.h
+++ b/content/html/content/src/HTMLAnchorElement.h
@@ -4,16 +4,17 @@
  * 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/. */
 
 #ifndef mozilla_dom_HTMLAnchorElement_h
 #define mozilla_dom_HTMLAnchorElement_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Link.h"
+#include "nsContentUtils.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMHTMLAnchorElement.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLAnchorElement MOZ_FINAL : public nsGenericHTMLElement,
                                     public nsIDOMHTMLAnchorElement,
--- a/content/media/MediaDecoderReader.h
+++ b/content/media/MediaDecoderReader.h
@@ -6,17 +6,16 @@
 #if !defined(MediaDecoderReader_h_)
 #define MediaDecoderReader_h_
 
 #include <nsDeque.h>
 #include "nsSize.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "MediaStreamGraph.h"
 #include "SharedBuffer.h"
-#include "ImageLayers.h"
 #include "AudioSampleFormat.h"
 #include "MediaResource.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 
 namespace mozilla {
 
 class AbstractMediaDecoder;
 
--- a/content/media/dash/DASHRepDecoder.h
+++ b/content/media/dash/DASHRepDecoder.h
@@ -11,24 +11,27 @@
  * partitioned into one or more segments and delivered to a client using HTTP.
  *
  * see DASHDecoder.cpp for info on DASH interaction with the media engine.*/
 
 #if !defined(DASHRepDecoder_h_)
 #define DASHRepDecoder_h_
 
 #include "Representation.h"
-#include "ImageLayers.h"
 #include "DASHDecoder.h"
 #include "WebMDecoder.h"
 #include "WebMReader.h"
 #include "MediaDecoder.h"
 
 namespace mozilla {
 
+namespace layers {
+class ImageContainer;
+}
+
 class DASHDecoder;
 class DASHRepReader;
 
 class DASHRepDecoder : public MediaDecoder
 {
 public:
   typedef mozilla::net::Representation Representation;
   typedef mozilla::net::SegmentBase SegmentBase;
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -50,16 +50,17 @@ class JavaScriptParent;
 }
 
 namespace layers {
 class PCompositorParent;
 } // namespace layers
 
 namespace dom {
 
+class Element;
 class TabParent;
 class PStorageParent;
 class ClonedMessageData;
 
 class ContentParent : public PContentParent
                     , public nsIObserver
                     , public nsIThreadObserver
                     , public nsIDOMGeoPositionCallback
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -22,29 +22,27 @@
 #include "gfxPoint.h"
 #include "gfxRect.h"
 #include "nsRect.h"
 #include "nsRegion.h"
 #include "gfxASurface.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/layers/CompositorTypes.h"
 #include "FrameMetrics.h"
-#include "ImageLayers.h"
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4800 )
 #endif
 
 namespace mozilla {
 
 typedef gfxASurface::gfxContentType gfxContentType;
 typedef gfxASurface::gfxImageFormat PixelFormat;
 typedef gfxASurface::gfxSurfaceType gfxSurfaceType;
 typedef gfxPattern::GraphicsFilter GraphicsFilterType;
-typedef layers::ImageLayer::ScaleMode ScaleMode;
 
 } // namespace mozilla
 
 namespace IPC {
 
 template<>
 struct ParamTraits<gfxMatrix>
 {
@@ -211,20 +209,20 @@ struct ParamTraits<mozilla::GraphicsFilt
 template <>
 struct ParamTraits<mozilla::layers::LayersBackend>
   : public EnumSerializer<mozilla::layers::LayersBackend,
                           mozilla::layers::LAYERS_NONE,
                           mozilla::layers::LAYERS_LAST>
 {};
 
 template <>
-struct ParamTraits<mozilla::ScaleMode>
-  : public EnumSerializer<mozilla::ScaleMode,
-                          mozilla::layers::ImageLayer::SCALE_NONE,
-                          mozilla::layers::ImageLayer::SCALE_SENTINEL>
+struct ParamTraits<mozilla::layers::ScaleMode>
+  : public EnumSerializer<mozilla::layers::ScaleMode,
+                          mozilla::layers::SCALE_NONE,
+                          mozilla::layers::SCALE_SENTINEL>
 {};
 
 template <>
 struct ParamTraits<mozilla::PixelFormat>
   : public EnumSerializer<mozilla::PixelFormat,
                           gfxASurface::ImageFormatARGB32,
                           gfxASurface::ImageFormatUnknown>
 {};
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -4,19 +4,19 @@
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_GFX_COMPOSITOR_H
 #define MOZILLA_GFX_COMPOSITOR_H
 
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/gfx/Matrix.h"
 #include "gfxMatrix.h"
-#include "Layers.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/layers/CompositorTypes.h"
+#include "Units.h"
 
 /**
  * Different elements of a web pages are rendered into separate "layers" before
  * they are flattened into the final image that is brought to the screen.
  * See Layers.h for more informations about layers and why we use retained
  * structures.
  * Most of the documentation for layers is directly in the source code in the
  * form of doc comments. An overview can also be found in the the wiki:
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -17,23 +17,16 @@ namespace layers {
 
 class ImageContainer;
 
 /**
  * A Layer which renders an Image.
  */
 class ImageLayer : public Layer {
 public:
-  enum ScaleMode {
-    SCALE_NONE,
-    SCALE_STRETCH,
-    SCALE_SENTINEL
-  // Unimplemented - SCALE_PRESERVE_ASPECT_RATIO_CONTAIN
-  };
-
   /**
    * CONSTRUCTION PHASE ONLY
    * Set the ImageContainer. aContainer must have the same layer manager
    * as this layer.
    */
   virtual void SetContainer(ImageContainer* aContainer);
 
   /**
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -330,17 +330,17 @@ struct ImageLayerProperties : public Lay
 
     return nsIntRect();
   }
 
   nsIntRegion mVisibleRegion;
   nsRefPtr<ImageContainer> mContainer;
   gfxPattern::GraphicsFilter mFilter;
   gfxIntSize mScaleToSize;
-  ImageLayer::ScaleMode mScaleMode;
+  ScaleMode mScaleMode;
 };
 
 LayerPropertiesBase*
 CloneLayerTreePropertiesInternal(Layer* aRoot)
 {
   if (!aRoot) {
     return new LayerPropertiesBase();
   }
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -106,12 +106,19 @@ struct LayerRenderState {
   // see LayerRenderStateFlags
   uint32_t mFlags;
   // the location of the layer's origin on mSurface
   nsIntPoint mOffset;
   // true if mOffset is applicable
   bool mHasOwnOffset;
 };
 
+enum ScaleMode {
+  SCALE_NONE,
+  SCALE_STRETCH,
+  SCALE_SENTINEL
+// Unimplemented - SCALE_PRESERVE_ASPECT_RATIO_CONTAIN
+};
+
 } // namespace
 } // namespace
 
 #endif /* GFX_LAYERSTYPES_H */
--- a/gfx/layers/YCbCrImageDataSerializer.h
+++ b/gfx/layers/YCbCrImageDataSerializer.h
@@ -7,16 +7,17 @@
 #define MOZILLA_LAYERS_BLOBYCBCRSURFACE_H
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/RefPtr.h"
 #include "ImageTypes.h"
 #include "base/basictypes.h"
 #include "Shmem.h"
 #include "gfxPoint.h"
+#include "ImageTypes.h"
 
 namespace mozilla {
 namespace ipc {
   class Shmem;
 }
 namespace gfx {
   class DataSourceSurface;
 }
--- a/gfx/layers/ipc/LayerTransaction.ipdlh
+++ b/gfx/layers/ipc/LayerTransaction.ipdlh
@@ -28,17 +28,17 @@ using nsPoint;
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 using mozilla::ScreenRotation;
 using nsCSSProperty;
 using mozilla::dom::ScreenOrientation;
 using mozilla::layers::TextureInfo;
 using mozilla::LayerMargin;
 using mozilla::LayerPoint;
-using mozilla::layers::ImageLayer::ScaleMode;
+using mozilla::layers::ScaleMode;
 using mozilla::layers::DiagnosticTypes;
 
 namespace mozilla {
 namespace layers {
 
 struct TargetConfig {
   nsIntRect naturalBounds;
   ScreenRotation rotation;
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1612,17 +1612,17 @@ nsObjectFrame::BuildLayer(nsDisplayListB
     NS_ASSERTION(layer->GetType() == Layer::TYPE_IMAGE, "Bad layer type");
     ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
 #ifdef XP_MACOSX
     if (!mInstanceOwner->UseAsyncRendering()) {
       mInstanceOwner->DoCocoaEventDrawRect(r, nullptr);
     }
 #endif
 
-    imglayer->SetScaleToSize(size, ImageLayer::SCALE_STRETCH);
+    imglayer->SetScaleToSize(size, SCALE_STRETCH);
     imglayer->SetContainer(container);
     gfxPattern::GraphicsFilter filter =
       nsLayoutUtils::GetGraphicsFilterForFrame(this);
 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
     if (!aManager->IsCompositingCheap()) {
       // Pixman just horrible with bilinear filter scaling
       filter = gfxPattern::FILTER_NEAREST;
     }
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -25,19 +25,17 @@
 #include "CC_Device.h"
 #include "CC_Call.h"
 #include "CC_Observer.h"
 #include "MediaPipeline.h"
 #include "PeerConnectionMedia.h"
 
 #ifdef MOZILLA_INTERNAL_API
 #include "mozilla/net/DataChannel.h"
-#include "Layers.h"
 #include "VideoUtils.h"
-#include "ImageLayers.h"
 #include "VideoSegment.h"
 #include "nsNSSShutDown.h"
 #else
 namespace mozilla {
   class DataChannel;
 }
 #endif
 
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -20,16 +20,17 @@
 #include "nsPresContext.h"
 #include "nsEventStateManager.h"
 #include "mozilla/StartupTimeline.h"
 #include "GeckoProfiler.h"
 #include "nsRefreshDriver.h"
 #include "mozilla/Preferences.h"
 #include "nsContentUtils.h" // for nsAutoScriptBlocker
 #include "nsLayoutUtils.h"
+#include "Layers.h"
 #include "mozilla/layers/Compositor.h"
 
 /**
    XXX TODO XXX
 
    DeCOMify newly private methods
    Optimize view storage
 */