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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2475713002: Allocate OverlapMapContainers in vector rather than on stack with copy (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return clippedOverlap; 111 return clippedOverlap;
112 // Unclipped is allowed to overlap clipped, but not vice-versa. 112 // Unclipped is allowed to overlap clipped, but not vice-versa.
113 return clippedOverlap || 113 return clippedOverlap ||
114 m_overlapStack.last().unclipped.overlapsLayers(bounds); 114 m_overlapStack.last().unclipped.overlapsLayers(bounds);
115 } 115 }
116 116
117 void beginNewOverlapTestingContext() { 117 void beginNewOverlapTestingContext() {
118 // This effectively creates a new "clean slate" for overlap state. 118 // This effectively creates a new "clean slate" for overlap state.
119 // This is used when we know that a subtree or remaining set of 119 // This is used when we know that a subtree or remaining set of
120 // siblings does not need to check overlap with things behind it. 120 // siblings does not need to check overlap with things behind it.
121 m_overlapStack.append(OverlapMapContainers()); 121 m_overlapStack.grow(m_overlapStack.size() + 1);
122 } 122 }
123 123
124 void finishCurrentOverlapTestingContext() { 124 void finishCurrentOverlapTestingContext() {
125 // The overlap information on the top of the stack is still necessary 125 // The overlap information on the top of the stack is still necessary
126 // for checking overlap of any layers outside this context that may 126 // for checking overlap of any layers outside this context that may
127 // overlap things from inside this context. Therefore, we must merge 127 // overlap things from inside this context. Therefore, we must merge
128 // the information from the top of the stack before popping the stack. 128 // the information from the top of the stack before popping the stack.
129 // 129 //
130 // FIXME: we may be able to avoid this deep copy by rearranging how 130 // FIXME: we may be able to avoid this deep copy by rearranging how
131 // overlapMap state is managed. 131 // overlapMap state is managed.
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 descendantHas3DTransform |= 538 descendantHas3DTransform |=
539 anyDescendantHas3DTransform || layer->has3DTransform(); 539 anyDescendantHas3DTransform || layer->has3DTransform();
540 } 540 }
541 541
542 // At this point we have finished collecting all reasons to composite this 542 // At this point we have finished collecting all reasons to composite this
543 // layer. 543 // layer.
544 layer->setCompositingReasons(reasonsToComposite); 544 layer->setCompositingReasons(reasonsToComposite);
545 } 545 }
546 546
547 } // namespace blink 547 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698