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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp

Issue 2653433002: Share GeometryMapper cache between pre-paint and compositing. (Closed)
Patch Set: none Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/paint/GeometryMapper.h" 5 #include "platform/graphics/paint/GeometryMapper.h"
6 6
7 #include "platform/RuntimeEnabledFeatures.h" 7 #include "platform/RuntimeEnabledFeatures.h"
8 #include "platform/geometry/LayoutRect.h" 8 #include "platform/geometry/LayoutRect.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 it++) { 276 it++) {
277 TransformationMatrix localTransformMatrix = (*it)->matrix(); 277 TransformationMatrix localTransformMatrix = (*it)->matrix();
278 localTransformMatrix.applyTransformOrigin((*it)->origin()); 278 localTransformMatrix.applyTransformOrigin((*it)->origin());
279 transformMatrix = transformMatrix * localTransformMatrix; 279 transformMatrix = transformMatrix * localTransformMatrix;
280 precomputedData.toAncestorTransforms.set(*it, transformMatrix); 280 precomputedData.toAncestorTransforms.set(*it, transformMatrix);
281 } 281 }
282 success = true; 282 success = true;
283 return precomputedData.toAncestorTransforms.find(localTransformNode)->value; 283 return precomputedData.toAncestorTransforms.find(localTransformNode)->value;
284 } 284 }
285 285
286 void GeometryMapper::clearCache() {
287 m_data.clear();
288 }
289
286 namespace { 290 namespace {
287 291
288 template <typename NodeType> 292 template <typename NodeType>
289 unsigned nodeDepth(const NodeType* node) { 293 unsigned nodeDepth(const NodeType* node) {
290 unsigned depth = 0; 294 unsigned depth = 0;
291 while (node) { 295 while (node) {
292 depth++; 296 depth++;
293 node = node->parent(); 297 node = node->parent();
294 } 298 }
295 return depth; 299 return depth;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 const TransformPaintPropertyNode*, 338 const TransformPaintPropertyNode*,
335 const TransformPaintPropertyNode*); 339 const TransformPaintPropertyNode*);
336 template const ClipPaintPropertyNode* GeometryMapper::lowestCommonAncestor( 340 template const ClipPaintPropertyNode* GeometryMapper::lowestCommonAncestor(
337 const ClipPaintPropertyNode*, 341 const ClipPaintPropertyNode*,
338 const ClipPaintPropertyNode*); 342 const ClipPaintPropertyNode*);
339 template const ScrollPaintPropertyNode* GeometryMapper::lowestCommonAncestor( 343 template const ScrollPaintPropertyNode* GeometryMapper::lowestCommonAncestor(
340 const ScrollPaintPropertyNode*, 344 const ScrollPaintPropertyNode*,
341 const ScrollPaintPropertyNode*); 345 const ScrollPaintPropertyNode*);
342 346
343 } // namespace blink 347 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698