Bug 1181832 - Keep gfxPrefs.h out of header files. r=kats

This commit is contained in:
Botond Ballo 2015-07-13 11:53:10 -04:00
parent 8896ecec8c
commit 329ac5fd09
18 changed files with 75 additions and 22 deletions

View File

@ -26,6 +26,7 @@
#include "MediaDecoder.h"
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
#include "nsNPAPIPluginInstance.h"
#include "gfxPrefs.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/Attributes.h"

View File

@ -53,6 +53,7 @@
#include "gfxPlatform.h"
#include "gfxFont.h"
#include "gfxBlur.h"
#include "gfxPrefs.h"
#include "gfxUtils.h"
#include "nsFrameLoader.h"

View File

@ -0,0 +1,22 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 "FrameMetrics.h"
#include "gfxPrefs.h"
namespace mozilla {
namespace layers {
const FrameMetrics::ViewID FrameMetrics::NULL_SCROLL_ID = 0;
const FrameMetrics FrameMetrics::sNullMetrics;
void
FrameMetrics::SetUsesContainerScrolling(bool aValue) {
MOZ_ASSERT_IF(aValue, gfxPrefs::LayoutUseContainersForRootFrames());
mUsesContainerScrolling = aValue;
}
}
}

View File

@ -14,7 +14,6 @@
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
#include "mozilla/gfx/Logging.h" // for Log
#include "gfxColor.h"
#include "gfxPrefs.h" // for LayoutUseContainersForRootFrames
#include "nsString.h"
namespace IPC {
@ -540,10 +539,9 @@ public:
return mIsLayersIdRoot;
}
void SetUsesContainerScrolling(bool aValue) {
MOZ_ASSERT_IF(aValue, gfxPrefs::LayoutUseContainersForRootFrames());
mUsesContainerScrolling = aValue;
}
// Implemented out of line because the implementation needs gfxPrefs.h
// and we don't want to include that from FrameMetrics.h.
void SetUsesContainerScrolling(bool aValue);
bool UsesContainerScrolling() const {
return mUsesContainerScrolling;
}

View File

@ -49,8 +49,6 @@ FILEOrDefault(FILE* aFile)
}
typedef FrameMetrics::ViewID ViewID;
const ViewID FrameMetrics::NULL_SCROLL_ID = 0;
const FrameMetrics FrameMetrics::sNullMetrics;
using namespace mozilla::gfx;

View File

@ -7,14 +7,22 @@
#include "ActiveElementManager.h"
#include "APZCCallbackHelper.h"
#include "gfxPrefs.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/layers/APZCCallbackHelper.h"
#include "nsCOMPtr.h"
#include "nsDocShell.h"
#include "nsIDOMMouseEvent.h"
#include "nsIDOMWindowUtils.h"
#include "nsIScrollableFrame.h"
#include "nsIScrollbarMediator.h"
#include "nsITimer.h"
#include "nsIWeakReferenceUtils.h"
#include "nsIWidget.h"
#include "nsLayoutUtils.h"
#include "nsQueryFrame.h"
#include "TouchManager.h"
#include "nsIDOMMouseEvent.h"
#include "nsLayoutUtils.h"

View File

@ -9,7 +9,6 @@
#include <stdint.h> // for uint32_t
#include "ClientLayerManager.h" // for ClientLayerManager, etc
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "gfxPrefs.h" // for gfxPrefs
#include "nsDebug.h" // for NS_ASSERTION
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
#include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE

View File

@ -36,7 +36,6 @@
#include "mozilla/layers/ISurfaceAllocator.h"
#include "gfxReusableSurfaceWrapper.h"
#include "pratom.h" // For PR_ATOMIC_INCREMENT/DECREMENT
#include "gfxPrefs.h"
namespace mozilla {
namespace layers {

View File

@ -13,6 +13,7 @@
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "ShadowLayerParent.h" // for ShadowLayerParent
#include "CompositableTransactionParent.h" // for EditReplyVector
#include "gfxPrefs.h"
#include "mozilla/gfx/BasePoint3D.h" // for BasePoint3D
#include "mozilla/layers/CanvasLayerComposite.h"
#include "mozilla/layers/ColorLayerComposite.h"

View File

@ -293,6 +293,7 @@ UNIFIED_SOURCES += [
'Compositor.cpp',
'CopyableCanvasLayer.cpp',
'Effects.cpp',
'FrameMetrics.cpp',
'GLImages.cpp',
'ImageDataSerializer.cpp',
'ImageLayers.cpp',

View File

@ -2352,3 +2352,15 @@ gfxPlatform::AsyncPanZoomEnabled()
#endif
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
}
/*virtual*/ bool
gfxPlatform::UseProgressivePaint()
{
return gfxPrefs::ProgressivePaintDoNotUseDirectly();
}
/*static*/ bool
gfxPlatform::PerfWarnings()
{
return gfxPrefs::PerfWarnings();
}

View File

@ -13,7 +13,6 @@
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "gfxPrefs.h"
#include "gfxTypes.h"
#include "gfxFontFamilyList.h"
#include "gfxBlur.h"
@ -62,7 +61,7 @@ BackendTypeBit(BackendType b)
#define MOZ_PERFORMANCE_WARNING(module, ...) \
do { \
if (gfxPrefs::PerfWarnings()) { \
if (gfxPlatform::PerfWarnings()) { \
printf_stderr("[" module "] " __VA_ARGS__); \
} \
} while (0)
@ -261,7 +260,7 @@ public:
/// These should be used instead of directly accessing the preference,
/// as different platforms may override the behaviour.
virtual bool UseProgressivePaint() { return gfxPrefs::ProgressivePaintDoNotUseDirectly(); }
virtual bool UseProgressivePaint();
static bool AsyncPanZoomEnabled();
@ -620,6 +619,12 @@ public:
const mozilla::gfx::IntSize& aSize,
mozilla::gfx::SurfaceFormat aFormat);
/**
* Wrapper around gfxPrefs::PerfWarnings().
* Extracted into a function to avoid including gfxPrefs.h from this file.
*/
static bool PerfWarnings();
protected:
gfxPlatform();
virtual ~gfxPlatform();

View File

@ -1300,6 +1300,18 @@ nsDisplayListBuilder::GetDirtyRectForScrolledContents(const nsIFrame* aScrollabl
return result;
}
bool
nsDisplayListBuilder::IsBuildingLayerEventRegions()
{
if (mMode == PAINTING) {
// Note: this is the only place that gets to query LayoutEventRegionsEnabled
// 'directly' - other code should call this function.
return gfxPrefs::LayoutEventRegionsEnabledDoNotUseDirectly() ||
mAsyncPanZoomEnabled;
}
return false;
}
void nsDisplayListSet::MoveTo(const nsDisplayListSet& aDestination) const
{
aDestination.BorderBackground()->AppendToTop(BorderBackground());

View File

@ -345,16 +345,7 @@ public:
{
mLayerEventRegions = aItem;
}
bool IsBuildingLayerEventRegions()
{
if (mMode == PAINTING) {
// Note: this is the only place that gets to query LayoutEventRegionsEnabled
// 'directly' - other code should call this function.
return gfxPrefs::LayoutEventRegionsEnabledDoNotUseDirectly() ||
mAsyncPanZoomEnabled;
}
return false;
}
bool IsBuildingLayerEventRegions();
bool IsInsidePointerEventsNoneDoc()
{
return CurrentPresShellState()->mInsidePointerEventsNoneDoc;

View File

@ -6,6 +6,7 @@
#include "ScrollVelocityQueue.h"
#include "gfxPrefs.h"
#include "nsPresContext.h"
#include "nsRefreshDriver.h"

View File

@ -10,6 +10,8 @@
#include "nsSubDocumentFrame.h"
#include "gfxPrefs.h"
#include "mozilla/layout/RenderFrameParent.h"
#include "nsCOMPtr.h"

View File

@ -15,6 +15,7 @@
#include "android/log.h"
#include "GLContext.h"
#include "gfxPrefs.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/Hal.h"

View File

@ -56,6 +56,7 @@
#include "gfx2DGlue.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/MiscEvents.h"
#include "mozilla/MouseEvents.h"