Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapperClipCache.cpp

Issue 2738113003: Revert of Improve performance of GeometryMapper cache. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/GeometryMapperClipCache.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperClipCache.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperClipCache.cpp
deleted file mode 100644
index 53660b601ab3d5f2a02ce5390b7dd9906926e11a..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperClipCache.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "platform/graphics/paint/GeometryMapperClipCache.h"
-
-#include "platform/graphics/paint/FloatClipRect.h"
-
-namespace blink {
-
-// All clip caches invalidate themselves by tracking a local cache generation,
-// and invalidating their cache if their cache generation disagrees with
-// s_clipCacheGeneration.
-static unsigned s_clipCacheGeneration = 0;
-
-void GeometryMapperClipCache::clearCache() {
- s_clipCacheGeneration++;
-}
-
-void GeometryMapperClipCache::invalidateCacheIfNeeded() {
- if (m_cacheGeneration != s_clipCacheGeneration) {
- m_clipCache.clear();
- m_cacheGeneration = s_clipCacheGeneration;
- }
-}
-
-const FloatClipRect* GeometryMapperClipCache::getCachedClip(
- const ClipAndTransform& clipAndTransform) {
- invalidateCacheIfNeeded();
- for (const auto& entry : m_clipCache) {
- if (entry.clipAndTransform == clipAndTransform) {
- return &entry.clipRect;
- }
- }
- return nullptr;
-}
-
-void GeometryMapperClipCache::setCachedClip(
- const ClipAndTransform& clipAndTransform,
- const FloatClipRect& clip) {
- invalidateCacheIfNeeded();
-#if DCHECK_IS_ON()
- for (const auto& entry : m_clipCache) {
- if (entry.clipAndTransform == clipAndTransform)
- DCHECK(false); // There should be no existing entry.
- }
-#endif
- m_clipCache.push_back(ClipCacheEntry(clipAndTransform, clip));
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698