Commit 1a589010 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Views: Add MRUCache of results from ShapeRunWithFont

Add missing patchset from crrev.com/572420

Bug: 826265
Change-Id: I2506916da8a489c83f3c93ff3a143070505c3bba
Reviewed-on: https://chromium-review.googlesource.com/1125528Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572487}
parent df57de1f
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/icu/source/common/unicode/ubidi.h" #include "third_party/icu/source/common/unicode/ubidi.h"
...@@ -969,15 +968,14 @@ struct ShapeRunWithFontOutput { ...@@ -969,15 +968,14 @@ struct ShapeRunWithFontOutput {
}; };
// An MRU cache of the results from calling ShapeRunWithFont. Use the same // An MRU cache of the results from calling ShapeRunWithFont. Use the same
// maximum cache size as is usedin blink::ShapeCache. // maximum cache size as is used in blink::ShapeCache.
const int kShapeRunCacheSize = 10000; constexpr int kShapeRunCacheSize = 10000;
using ShapeRunCacheBase = base::HashingMRUCache<ShapeRunWithFontInput, using ShapeRunCacheBase = base::HashingMRUCache<ShapeRunWithFontInput,
ShapeRunWithFontOutput, ShapeRunWithFontOutput,
ShapeRunWithFontInput::Hash>; ShapeRunWithFontInput::Hash>;
class ShapeRunCache : public ShapeRunCacheBase { class ShapeRunCache : public ShapeRunCacheBase {
public: public:
ShapeRunCache() : ShapeRunCacheBase(kShapeRunCacheSize) {} ShapeRunCache() : ShapeRunCacheBase(kShapeRunCacheSize) {}
~ShapeRunCache() override {}
}; };
void ShapeRunWithFont(const ShapeRunWithFontInput& in, void ShapeRunWithFont(const ShapeRunWithFontInput& in,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment