Bug 1545892 - Reduce includes in gfx2DGlue.h, nsLayoutUtils.h, nsPresContext.h. r=dholbert
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 22 Apr 2019 19:58:52 +0000
changeset 470403 8f99d1f6247203548fd613c6c23ede4c10562f74
parent 470402 7c58a86df1c6aa72126951ba9b2930a6ce5de99e
child 470404 643d7793369e20fd5a0a9786294bf1c073d0a2d2
push id35905
push userdvarga@mozilla.com
push dateTue, 23 Apr 2019 09:53:27 +0000
treeherdermozilla-central@831918f009f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1545892
milestone68.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 1545892 - Reduce includes in gfx2DGlue.h, nsLayoutUtils.h, nsPresContext.h. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D28266
gfx/gl/GLContext.h
gfx/gl/GLContextEGL.h
gfx/layers/ImageContainer.cpp
gfx/layers/LayersTypes.h
gfx/layers/basic/TextureClientX11.cpp
gfx/layers/composite/X11TextureHost.cpp
gfx/thebes/gfx2DGlue.h
image/test/gtest/Common.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresContext.h
widget/cocoa/nsAppShell.mm
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -41,20 +41,16 @@
 #include "SurfaceTypes.h"
 #include "GLContextSymbols.h"
 #include "base/platform_thread.h"  // for PlatformThreadId
 #include "mozilla/GenericRefCounted.h"
 #include "mozilla/WeakPtr.h"
 #include "gfx2DGlue.h"
 #include "GeckoProfiler.h"
 
-namespace android {
-class GraphicBuffer;
-}  // namespace android
-
 namespace mozilla {
 namespace gfx {
 class DataSourceSurface;
 class SourceSurface;
 }  // namespace gfx
 
 namespace gl {
 class GLBlitHelper;
--- a/gfx/gl/GLContextEGL.h
+++ b/gfx/gl/GLContextEGL.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GLCONTEXTEGL_H_
 #define GLCONTEXTEGL_H_
 
 #include "GLContext.h"
 #include "GLLibraryEGL.h"
 
+class gfxASurface;
 namespace mozilla {
 namespace widget {
 class CompositorWidget;
 }  // namespace widget
 namespace gl {
 
 class GLContextEGL : public GLContext {
   friend class TextureImageEGL;
--- a/gfx/layers/ImageContainer.cpp
+++ b/gfx/layers/ImageContainer.cpp
@@ -38,19 +38,18 @@
 #  include <d3d10_1.h>
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #  include "mozilla/layers/D3D11YCbCrImage.h"
 #endif
 
 namespace mozilla {
 namespace layers {
 
+using namespace mozilla::gfx;
 using namespace mozilla::ipc;
-using namespace android;
-using namespace mozilla::gfx;
 
 Atomic<int32_t> Image::sSerialCounter(0);
 
 Atomic<uint32_t> ImageContainer::sGenerationCounter(0);
 
 static void CopyPlane(uint8_t* aDst, const uint8_t* aSrc,
                       const gfx::IntSize& aSize, int32_t aStride,
                       int32_t aSkip);
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -37,20 +37,16 @@
 
 //#define ENABLE_FRAME_LATENCY_LOG
 
 namespace IPC {
 template <typename T>
 struct ParamTraits;
 }  // namespace IPC
 
-namespace android {
-class MOZ_EXPORT GraphicBuffer;
-}  // namespace android
-
 namespace mozilla {
 namespace layers {
 
 class TextureHost;
 
 #undef NONE
 #undef OPAQUE
 
--- a/gfx/layers/basic/TextureClientX11.cpp
+++ b/gfx/layers/basic/TextureClientX11.cpp
@@ -1,22 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "mozilla/layers/TextureClientX11.h"
+
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/layers/ShadowLayerUtilsX11.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Logging.h"
+#include "gfx2DGlue.h"
+#include "gfxPlatform.h"
 #include "gfxXlibSurface.h"
-#include "gfx2DGlue.h"
 
 #include "mozilla/X11Util.h"
 #include <X11/Xlib.h>
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 namespace mozilla {
--- a/gfx/layers/composite/X11TextureHost.cpp
+++ b/gfx/layers/composite/X11TextureHost.cpp
@@ -1,21 +1,23 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "X11TextureHost.h"
+
 #include "mozilla/layers/BasicCompositor.h"
-#include "mozilla/layers/X11TextureSourceBasic.h"
 #include "mozilla/layers/CompositorOGL.h"
+#include "mozilla/layers/X11TextureSourceBasic.h"
 #include "mozilla/layers/X11TextureSourceOGL.h"
+#include "gfx2DGlue.h"
+#include "gfxPlatform.h"
 #include "gfxXlibSurface.h"
-#include "gfx2DGlue.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace mozilla::gfx;
 
 X11TextureHost::X11TextureHost(TextureFlags aFlags,
                                const SurfaceDescriptorX11& aDescriptor)
--- a/gfx/thebes/gfx2DGlue.h
+++ b/gfx/thebes/gfx2DGlue.h
@@ -2,20 +2,20 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 GFX_2D_GLUE_H
 #define GFX_2D_GLUE_H
 
-#include "gfxPlatform.h"
+#include "gfxMatrix.h"
+#include "gfxPoint.h"
 #include "gfxRect.h"
-#include "gfxMatrix.h"
-#include "gfxContext.h"
+#include "gfxTypes.h"
 #include "mozilla/gfx/Matrix.h"
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/gfx/2D.h"
 
 namespace mozilla {
 namespace gfx {
 
 inline Rect ToRect(const gfxRect &aRect) {
--- a/image/test/gtest/Common.cpp
+++ b/image/test/gtest/Common.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "Common.h"
 
 #include <cstdlib>
 
+#include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIProperties.h"
 #include "nsNetUtil.h"
 #include "mozilla/RefPtr.h"
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -10,42 +10,43 @@
 #include "LayoutConstants.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/TypedEnumBits.h"
 #include "nsBoundingMetrics.h"
 #include "nsChangeHint.h"
-#include "nsFrameList.h"
 #include "mozilla/layout/FrameChildList.h"
 #include "mozilla/layers/ScrollableLayerGuid.h"
 #include "nsThreadUtils.h"
-#include "nsIPrincipal.h"
-#include "nsIWidget.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsStyleCoord.h"
 #include "nsStyleConsts.h"
 #include "nsGkAtoms.h"
-#include "imgIContainer.h"
 #include "mozilla/gfx/2D.h"
 #include "Units.h"
 #include "mozilla/ToString.h"
 #include "mozilla/ReflowOutput.h"
-#include "ImageContainer.h"
+#include "ImageContainer.h" // for layers::Image
 #include "gfx2DGlue.h"
 #include "SVGImageContext.h"
 #include <limits>
 #include <algorithm>
 #include "gfxPoint.h"
 #include "nsClassHashtable.h"
 
 class gfxContext;
+class gfxFontEntry;
+class imgIContainer;
+class nsFrameList;
 class nsPresContext;
 class nsIContent;
+class nsIPrincipal;
+class nsIWidget;
 class nsAtom;
 class nsIScrollableFrame;
 class nsRegion;
 class nsDisplayListBuilder;
 enum class nsDisplayListBuilderMode : uint8_t;
 class nsDisplayItem;
 class nsFontMetrics;
 class nsFontFaceList;
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -19,19 +19,18 @@
 #include "nsColor.h"
 #include "nsCoord.h"
 #include "nsCOMPtr.h"
 #include "nsRect.h"
 #include "nsStringFwd.h"
 #include "nsFont.h"
 #include "gfxFontConstants.h"
 #include "nsAtom.h"
-#include "nsITimer.h"
 #include "nsCRT.h"
-#include "nsIWidgetListener.h"
+#include "nsIWidgetListener.h" // for nsSizeMode
 #include "nsGkAtoms.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsChangeHint.h"
 #include <algorithm>
 #include "gfxTypes.h"
 #include "gfxRect.h"
 #include "nsTArray.h"
 #include "mozilla/MemoryReporting.h"
@@ -44,16 +43,17 @@
 #include "prenv.h"
 #include "mozilla/StaticPresData.h"
 
 class nsBidi;
 class nsIPrintSettings;
 class nsDocShell;
 class nsIDocShell;
 class nsITheme;
+class nsITimer;
 class nsIContent;
 class nsIFrame;
 class nsFrameManager;
 class nsILinkHandler;
 class nsAtom;
 class nsIRunnable;
 class gfxFontFeatureValueSet;
 class gfxUserFontEntry;
--- a/widget/cocoa/nsAppShell.mm
+++ b/widget/cocoa/nsAppShell.mm
@@ -8,16 +8,17 @@
  * Gecko events.
  */
 
 #import <Cocoa/Cocoa.h>
 
 #include "CustomCocoaEvents.h"
 #include "mozilla/WidgetTraceEvent.h"
 #include "nsAppShell.h"
+#include "gfxPlatform.h"
 #include "nsCOMPtr.h"
 #include "nsIFile.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsString.h"
 #include "nsIRollupListener.h"
 #include "nsIWidget.h"
 #include "nsThreadUtils.h"
 #include "nsIWindowMediator.h"