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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.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/GeometryMapperTransformCache.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.cpp
deleted file mode 100644
index 5f3cba39285d0e6b081c86487fe0a6c9dc150c9e..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.cpp
+++ /dev/null
@@ -1,49 +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/GeometryMapperTransformCache.h"
-
-namespace blink {
-
-// All transform caches invalidate themselves by tracking a local cache
-// generation, and invalidating their cache if their cache generation disagrees
-// with s_transformCacheGeneration.
-static unsigned s_transformCacheGeneration = 0;
-
-void GeometryMapperTransformCache::clearCache() {
- s_transformCacheGeneration++;
-}
-
-void GeometryMapperTransformCache::invalidateCacheIfNeeded() {
- if (m_cacheGeneration != s_transformCacheGeneration) {
- m_transformCache.clear();
- m_cacheGeneration = s_transformCacheGeneration;
- }
-}
-
-const TransformationMatrix* GeometryMapperTransformCache::getCachedTransform(
- const TransformPaintPropertyNode* ancestorTransform) {
- invalidateCacheIfNeeded();
- for (const auto& entry : m_transformCache) {
- if (entry.ancestorNode == ancestorTransform) {
- return &entry.toAncestor;
- }
- }
- return nullptr;
-}
-
-void GeometryMapperTransformCache::setCachedTransform(
- const TransformPaintPropertyNode* ancestorTransform,
- const TransformationMatrix& matrix) {
- invalidateCacheIfNeeded();
-#if DCHECK_IS_ON()
- for (const auto& entry : m_transformCache) {
- if (entry.ancestorNode == ancestorTransform)
- DCHECK(false); // There should be no existing entry.
- }
-#endif
- m_transformCache.push_back(TransformCacheEntry(ancestorTransform, matrix));
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698