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

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

Issue 2186643002: Fold compositing display items into contained drawings if the drawing is a singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 4 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
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/TraceEvent.h" 7 #include "platform/TraceEvent.h"
8 #include "platform/graphics/GraphicsLayer.h" 8 #include "platform/graphics/GraphicsLayer.h"
9 #include "platform/graphics/paint/DrawingDisplayItem.h" 9 #include "platform/graphics/paint/DrawingDisplayItem.h"
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 if (!indices.isEmpty() && indices.last() == (m_newDisplayItemList.size() - 1)) 146 if (!indices.isEmpty() && indices.last() == (m_newDisplayItemList.size() - 1))
147 indices.removeLast(); 147 indices.removeLast();
148 } 148 }
149 #endif 149 #endif
150 m_newDisplayItemList.removeLast(); 150 m_newDisplayItemList.removeLast();
151 151
152 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 152 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
153 m_newPaintChunks.decrementDisplayItemIndex(); 153 m_newPaintChunks.decrementDisplayItemIndex();
154 } 154 }
155 155
156 const DisplayItem* PaintController::lastDisplayItem(unsigned offset)
157 {
158 if (offset < m_newDisplayItemList.size())
159 return &m_newDisplayItemList[m_newDisplayItemList.size() - offset - 1];
160 return nullptr;
161 }
162
156 void PaintController::processNewItem(DisplayItem& displayItem) 163 void PaintController::processNewItem(DisplayItem& displayItem)
157 { 164 {
158 DCHECK(!m_constructionDisabled); 165 DCHECK(!m_constructionDisabled);
159 166
160 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 167 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
161 if (!isSkippingCache()) { 168 if (!isSkippingCache()) {
162 if (displayItem.isCacheable()) { 169 if (displayItem.isCacheable()) {
163 // Mark the client shouldKeepAlive under this PaintController. 170 // Mark the client shouldKeepAlive under this PaintController.
164 // The status will end after the new display items are committed. 171 // The status will end after the new display items are committed.
165 displayItem.client().beginShouldKeepAlive(this); 172 displayItem.client().beginShouldKeepAlive(this);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 560
554 void PaintController::showDebugData() const 561 void PaintController::showDebugData() const
555 { 562 {
556 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); 563 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data());
557 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 564 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
558 } 565 }
559 566
560 #endif // ifndef NDEBUG 567 #endif // ifndef NDEBUG
561 568
562 } // namespace blink 569 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698