Bug 940625 - Discard the surfaces for SVG images that are in the ImageLib SurfaceCache when the app theme changes. r=seth

This commit is contained in:
Jonathan Watt 2014-06-25 13:04:36 +01:00
parent f886ddcddc
commit 74a5f2859e

View File

@ -33,6 +33,7 @@
#include "nsLayoutUtils.h"
#include "nsViewManager.h"
#include "RestyleManager.h"
#include "SurfaceCache.h"
#include "nsCSSRuleProcessor.h"
#include "nsRuleNode.h"
#include "gfxPlatform.h"
@ -1710,10 +1711,15 @@ nsPresContext::ThemeChangedInternal()
sThemeChanged = false;
}
// Clear all cached LookAndFeel colors.
if (sLookAndFeelChanged) {
// Clear all cached LookAndFeel colors.
LookAndFeel::Refresh();
sLookAndFeelChanged = false;
// Vector images (SVG) may be using theme colors so we discard all cached
// surfaces. (We could add a vector image only version of DiscardAll, but
// in bug 940625 we decided theme changes are rare enough not to bother.)
mozilla::image::SurfaceCache::DiscardAll();
}
// This will force the system metrics to be generated the next time they're used