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

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

Issue 2502413004: WTF/std normalization: replace WTF::Vector::last with ::back (Closed)
Patch Set: rebase 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/PaintController.h" 5 #include "platform/graphics/paint/PaintController.h"
6 6
7 #include "platform/graphics/GraphicsLayer.h" 7 #include "platform/graphics/GraphicsLayer.h"
8 #include "platform/graphics/paint/DrawingDisplayItem.h" 8 #include "platform/graphics/paint/DrawingDisplayItem.h"
9 #include "platform/tracing/TraceEvent.h" 9 #include "platform/tracing/TraceEvent.h"
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 if (m_newDisplayItemList.isEmpty()) 137 if (m_newDisplayItemList.isEmpty())
138 return; 138 return;
139 139
140 #if DCHECK_IS_ON() 140 #if DCHECK_IS_ON()
141 // Also remove the index pointing to the removed display item. 141 // Also remove the index pointing to the removed display item.
142 IndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find( 142 IndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find(
143 &m_newDisplayItemList.last().client()); 143 &m_newDisplayItemList.last().client());
144 if (it != m_newDisplayItemIndicesByClient.end()) { 144 if (it != m_newDisplayItemIndicesByClient.end()) {
145 Vector<size_t>& indices = it->value; 145 Vector<size_t>& indices = it->value;
146 if (!indices.isEmpty() && 146 if (!indices.isEmpty() &&
147 indices.last() == (m_newDisplayItemList.size() - 1)) 147 indices.back() == (m_newDisplayItemList.size() - 1))
148 indices.pop_back(); 148 indices.pop_back();
149 } 149 }
150 #endif 150 #endif
151 151
152 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() && 152 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() &&
153 isCheckingUnderInvalidation()) { 153 isCheckingUnderInvalidation()) {
154 if (m_skippedProbableUnderInvalidationCount) { 154 if (m_skippedProbableUnderInvalidationCount) {
155 --m_skippedProbableUnderInvalidationCount; 155 --m_skippedProbableUnderInvalidationCount;
156 } else { 156 } else {
157 DCHECK(m_underInvalidationCheckingBegin); 157 DCHECK(m_underInvalidationCheckingBegin);
(...skipping 20 matching lines...) Expand all
178 if (displayItem.isCacheable()) { 178 if (displayItem.isCacheable()) {
179 // Mark the client shouldKeepAlive under this PaintController. 179 // Mark the client shouldKeepAlive under this PaintController.
180 // The status will end after the new display items are committed. 180 // The status will end after the new display items are committed.
181 displayItem.client().beginShouldKeepAlive(this); 181 displayItem.client().beginShouldKeepAlive(this);
182 182
183 if (!m_currentSubsequenceClients.isEmpty()) { 183 if (!m_currentSubsequenceClients.isEmpty()) {
184 // Mark the client shouldKeepAlive under the current subsequence. 184 // Mark the client shouldKeepAlive under the current subsequence.
185 // The status will end when the subsequence owner is invalidated or 185 // The status will end when the subsequence owner is invalidated or
186 // deleted. 186 // deleted.
187 displayItem.client().beginShouldKeepAlive( 187 displayItem.client().beginShouldKeepAlive(
188 m_currentSubsequenceClients.last()); 188 m_currentSubsequenceClients.back());
189 } 189 }
190 } 190 }
191 191
192 if (displayItem.getType() == DisplayItem::kSubsequence) { 192 if (displayItem.getType() == DisplayItem::kSubsequence) {
193 m_currentSubsequenceClients.append(&displayItem.client()); 193 m_currentSubsequenceClients.append(&displayItem.client());
194 } else if (displayItem.getType() == DisplayItem::kEndSubsequence) { 194 } else if (displayItem.getType() == DisplayItem::kEndSubsequence) {
195 CHECK(m_currentSubsequenceClients.last() == &displayItem.client()); 195 CHECK(m_currentSubsequenceClients.back() == &displayItem.client());
196 m_currentSubsequenceClients.pop_back(); 196 m_currentSubsequenceClients.pop_back();
197 } 197 }
198 } 198 }
199 #endif 199 #endif
200 200
201 if (isSkippingCache()) 201 if (isSkippingCache())
202 displayItem.setSkippedCache(); 202 displayItem.setSkippedCache();
203 203
204 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 204 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
205 size_t lastChunkIndex = m_newPaintChunks.lastChunkIndex(); 205 size_t lastChunkIndex = m_newPaintChunks.lastChunkIndex();
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 m_currentPaintArtifact.getDisplayItemList(), showPictures) 885 m_currentPaintArtifact.getDisplayItemList(), showPictures)
886 .utf8() 886 .utf8()
887 .data()); 887 .data());
888 WTFLogAlways("new display item list: [%s]\n", 888 WTFLogAlways("new display item list: [%s]\n",
889 displayItemListAsDebugString(m_newDisplayItemList, showPictures) 889 displayItemListAsDebugString(m_newDisplayItemList, showPictures)
890 .utf8() 890 .utf8()
891 .data()); 891 .data());
892 } 892 }
893 893
894 } // namespace blink 894 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698