Bug 1268638 - Avoid using gfxPrefs in a widfely-included header. - r=jrmuizel
☠☠ backed out by ead1598b347f ☠ ☠
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 20 Jun 2016 20:32:50 -0700
changeset 302241 002f87a61edf488c359b6ecee10b3ada554d7036
parent 302240 8b0db9b0f87cb1ef75491bdd5927c631aca7fafd
child 302242 69116551e4b9c5b88e779574af27a6daac95a104
push id78659
push userjgilbert@mozilla.com
push dateTue, 21 Jun 2016 21:10:32 +0000
treeherdermozilla-inbound@1a2db6efc575 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1268638
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 1268638 - Avoid using gfxPrefs in a widfely-included header. - r=jrmuizel MozReview-Commit-ID: KUERI1IC4HK
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/layers/ipc/ISurfaceAllocator.h
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -2,16 +2,17 @@
  * vim: sw=2 ts=8 et :
  */
 /* 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 "ISurfaceAllocator.h"
 
+#include "gfxPrefs.h"
 #include "mozilla/layers/ImageBridgeParent.h" // for ImageBridgeParent
 #include "mozilla/layers/TextureHost.h"       // for TextureHost
 
 namespace mozilla {
 namespace layers {
 
 NS_IMPL_ISUPPORTS(GfxMemoryImageReporter, nsIMemoryReporter)
 
@@ -282,10 +283,16 @@ FixedSizeSmallShmemSectionAllocator::Shr
       }
       mUsedShmems.pop_back();
     } else {
       i++;
     }
   }
 }
 
+int32_t
+ClientIPCAllocator::GetMaxTextureSize() const
+{
+  return gfxPrefs::MaxTextureSize();
+}
+
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/ipc/ISurfaceAllocator.h
+++ b/gfx/layers/ipc/ISurfaceAllocator.h
@@ -11,17 +11,16 @@
 #include "gfxTypes.h"
 #include "mozilla/gfx/Point.h"          // for IntSize
 #include "mozilla/ipc/SharedMemory.h"   // for SharedMemory, etc
 #include "mozilla/RefPtr.h"
 #include "nsIMemoryReporter.h"          // for nsIMemoryReporter
 #include "mozilla/Atomics.h"            // for Atomic
 #include "mozilla/layers/LayersMessages.h" // for ShmemSection
 #include "LayersTypes.h"
-#include "gfxPrefs.h"
 #include "mozilla/layers/AtomicRefCountedWithFinalize.h"
 
 /*
  * FIXME [bjacob] *** PURE CRAZYNESS WARNING ***
  * (I think that this doesn't apply anymore.)
  *
  * This #define is actually needed here, because subclasses of ISurfaceAllocator,
  * namely ShadowLayerForwarder, will or will not override AllocGrallocBuffer
@@ -124,17 +123,17 @@ class ClientIPCAllocator : public ISurfa
 {
 public:
   ClientIPCAllocator(const char* aName) : ISurfaceAllocator(aName) {}
 
   virtual ClientIPCAllocator* AsClientAllocator() override { return this; }
 
   virtual MessageLoop * GetMessageLoop() const = 0;
 
-  virtual int32_t GetMaxTextureSize() const { return gfxPrefs::MaxTextureSize(); }
+  virtual int32_t GetMaxTextureSize() const;
 
   virtual void CancelWaitForRecycle(uint64_t aTextureId) = 0;
 };
 
 /// Methods that are specific to the host/parent side.
 class HostIPCAllocator : public ISurfaceAllocator
 {
 public: