Title: [210836] trunk/Source/WebCore
- Revision
- 210836
- Author
- [email protected]
- Date
- 2017-01-17 17:21:16 -0800 (Tue, 17 Jan 2017)
Log Message
WidthCache should be off while under memory pressure.
<https://webkit.org/b/167141>
Reviewed by Antti Koivisto.
Since we empty all the WidthCaches when we come under memory pressure, we shouldn't
repopulate them until the pressure has gone away.
* platform/graphics/WidthCache.h:
(WebCore::WidthCache::add):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (210835 => 210836)
--- trunk/Source/WebCore/ChangeLog 2017-01-18 01:14:33 UTC (rev 210835)
+++ trunk/Source/WebCore/ChangeLog 2017-01-18 01:21:16 UTC (rev 210836)
@@ -1,3 +1,16 @@
+2017-01-17 Andreas Kling <[email protected]>
+
+ WidthCache should be off while under memory pressure.
+ <https://webkit.org/b/167141>
+
+ Reviewed by Antti Koivisto.
+
+ Since we empty all the WidthCaches when we come under memory pressure, we shouldn't
+ repopulate them until the pressure has gone away.
+
+ * platform/graphics/WidthCache.h:
+ (WebCore::WidthCache::add):
+
2017-01-17 Antti Koivisto <[email protected]>
Persist derived data
Modified: trunk/Source/WebCore/platform/graphics/WidthCache.h (210835 => 210836)
--- trunk/Source/WebCore/platform/graphics/WidthCache.h 2017-01-18 01:14:33 UTC (rev 210835)
+++ trunk/Source/WebCore/platform/graphics/WidthCache.h 2017-01-18 01:21:16 UTC (rev 210836)
@@ -26,6 +26,7 @@
#ifndef WidthCache_h
#define WidthCache_h
+#include "MemoryPressureHandler.h"
#include "TextRun.h"
#include <wtf/Forward.h>
#include <wtf/HashFunctions.h>
@@ -120,6 +121,8 @@
float* add(const TextRun& run, float entry, bool hasKerningOrLigatures, bool hasWordSpacingOrLetterSpacing, GlyphOverflow* glyphOverflow)
{
+ if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
+ return nullptr;
// The width cache is not really profitable unless we're doing expensive glyph transformations.
if (!hasKerningOrLigatures)
return 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes