Bug 1528881 - Part 1: gfx/thebes: Make some global functions static. r=jrmuizel

clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called).

gfx/thebes/gfxBlur.cpp:444:6 [-Wmissing-prototypes] no previous prototype for function 'CacheBlur'
gfx/thebes/gfxPlatform.cpp:1087:6 [-Wmissing-prototypes] no previous prototype for function 'IsFeatureSupported'
gfx/thebes/gfxPlatform.cpp:1355:6 [-Wmissing-prototypes] no previous prototype for function 'SourceBufferDestroy'
gfx/thebes/gfxPlatform.cpp:1365:6 [-Wmissing-prototypes] no previous prototype for function 'SourceSurfaceDestroyed'
gfx/thebes/gfxPlatform.cpp:2422:6 [-Wmissing-prototypes] no previous prototype for function 'VideoDecodingFailedChangedCallback'
gfx/thebes/gfxPlatform.cpp:559:6 [-Wmissing-prototypes] no previous prototype for function 'WebRenderDebugPrefChangeCallback'

widget/GfxInfoBase.cpp:82:6 [-Wmissing-prototypes] no previous prototype for function 'InitGfxDriverInfoShutdownObserver'

Differential Revision: https://phabricator.services.mozilla.com/D20260

--HG--
extra : source : b8333099bca51db166839862e4a3918c5e8874f2
extra : intermediate-source : acb4bb2466df7fb22ca1a76e13c79186ea938bc1
extra : histedit_source : 16cf3a96596046e8111774a147b23ade0676c8e1
This commit is contained in:
Chris Peterson 2019-02-17 01:18:01 -08:00
parent 0c2ed50cde
commit 8c5a13370c
3 changed files with 11 additions and 10 deletions

View File

@ -441,10 +441,11 @@ static IntSize ComputeMinSizeForShadowShape(const RectCornerRadii* aCornerRadii,
return minSize;
}
void CacheBlur(DrawTarget* aDT, const IntSize& aMinSize,
const IntSize& aBlurRadius, const RectCornerRadii* aCornerRadii,
const Color& aShadowColor, const IntMargin& aBlurMargin,
SourceSurface* aBoxShadow) {
static void CacheBlur(DrawTarget* aDT, const IntSize& aMinSize,
const IntSize& aBlurRadius,
const RectCornerRadii* aCornerRadii,
const Color& aShadowColor, const IntMargin& aBlurMargin,
SourceSurface* aBoxShadow) {
BlurCacheKey key(aMinSize, aBlurRadius, aCornerRadii, aShadowColor,
aDT->GetBackendType());
BlurCacheData* data =

View File

@ -556,7 +556,7 @@ void RecordingPrefChanged(const char* aPrefName, void* aClosure) {
#define WR_DEBUG_PREF "gfx.webrender.debug"
void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
int32_t flags = 0;
#define GFX_WEBRENDER_DEBUG(suffix, bit) \
if (Preferences::GetBool(WR_DEBUG_PREF suffix, false)) { \
@ -1084,7 +1084,7 @@ void gfxPlatform::Init() {
}
}
bool IsFeatureSupported(long aFeature) {
static bool IsFeatureSupported(long aFeature) {
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString blockId;
int32_t status;
@ -1352,7 +1352,7 @@ struct SourceSurfaceUserData {
BackendType mBackendType;
};
void SourceBufferDestroy(void* srcSurfUD) {
static void SourceBufferDestroy(void* srcSurfUD) {
delete static_cast<SourceSurfaceUserData*>(srcSurfUD);
}
@ -1362,7 +1362,7 @@ struct DependentSourceSurfaceUserData {
RefPtr<gfxASurface> mSurface;
};
void SourceSurfaceDestroyed(void* aData) {
static void SourceSurfaceDestroyed(void* aData) {
delete static_cast<DependentSourceSurfaceUserData*>(aData);
}
@ -2432,7 +2432,7 @@ static bool sBufferRotationCheckPref = true;
static mozilla::Atomic<bool> sLayersAccelerationPrefsInitialized(false);
void VideoDecodingFailedChangedCallback(const char* aPref, void*) {
static void VideoDecodingFailedChangedCallback(const char* aPref, void*) {
sLayersHardwareVideoDecodingFailed = Preferences::GetBool(aPref, false);
gfxPlatform::GetPlatform()->UpdateCanUseHardwareVideoDecoding();
}

View File

@ -79,7 +79,7 @@ class ShutdownObserver : public nsIObserver {
NS_IMPL_ISUPPORTS(ShutdownObserver, nsIObserver)
void InitGfxDriverInfoShutdownObserver() {
static void InitGfxDriverInfoShutdownObserver() {
if (GfxInfoBase::sDriverInfoObserverInitialized) return;
GfxInfoBase::sDriverInfoObserverInitialized = true;