r?jrmuizel - Avoid using gfxPrefs in a widely-included header. draft
authorJeff Gilbert <jdashg@gmail.com>
Thu, 19 May 2016 19:39:07 -0700
changeset 369929 45889e7f540e40392d5a97cd87c31dff855d1c5e
parent 369928 38568116e0ee30d5e43b711558b2053e3c4319e7
child 369930 415460694fc9f13df72999c3d42b9441e293b6c1
push id18953
push userjgilbert@mozilla.com
push dateTue, 24 May 2016 00:19:59 +0000
milestone49.0a1
r?jrmuizel - Avoid using gfxPrefs in a widely-included header. From b02080fc6310b60e572c2391aecaa8395eb0fc65 Mon Sep 17 00:00:00 2001 --- gfx/layers/ipc/ISurfaceAllocator.cpp | 8 ++++++++ gfx/layers/ipc/ISurfaceAllocator.h | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) MozReview-Commit-ID: 4DUxlKJU964
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/layers/ipc/ISurfaceAllocator.h
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -2,22 +2,30 @@
  * 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"
+
 namespace mozilla {
 namespace layers {
 
 NS_IMPL_ISUPPORTS(GfxMemoryImageReporter, nsIMemoryReporter)
 
 mozilla::Atomic<ptrdiff_t> GfxMemoryImageReporter::sAmount(0);
 
 mozilla::ipc::SharedMemory::SharedMemoryType OptimalShmemType()
 {
   return ipc::SharedMemory::SharedMemoryType::TYPE_BASIC;
 }
 
+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
@@ -114,17 +113,17 @@ protected:
 /// Methods that are specific to the client/child side.
 class ClientIPCAllocator : public ISurfaceAllocator
 {
 public:
   virtual ClientIPCAllocator* AsClientAllocator() override { return this; }
 
   virtual MessageLoop * GetMessageLoop() const = 0;
 
-  virtual int32_t GetMaxTextureSize() const { return gfxPrefs::MaxTextureSize(); }
+  virtual int32_t GetMaxTextureSize() const;
 };
 
 /// An allocator can provide shared memory.
 ///
 /// The allocated shmems can be deallocated on either process, as long as they
 /// belong to the same channel.
 class ShmemAllocator
 {