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

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

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/PaintController.h" 6 #include "platform/graphics/paint/PaintController.h"
7 7
8 #include "platform/NotImplemented.h" 8 #include "platform/NotImplemented.h"
9 #include "platform/TraceEvent.h" 9 #include "platform/TraceEvent.h"
10 #include "platform/graphics/GraphicsLayer.h" 10 #include "platform/graphics/GraphicsLayer.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 m_scopeStack.append(m_nextScope++); 105 m_scopeStack.append(m_nextScope++);
106 beginSkippingCache(); 106 beginSkippingCache();
107 } 107 }
108 108
109 void PaintController::endScope() 109 void PaintController::endScope()
110 { 110 {
111 m_scopeStack.removeLast(); 111 m_scopeStack.removeLast();
112 endSkippingCache(); 112 endSkippingCache();
113 } 113 }
114 114
115 void PaintController::invalidate(const DisplayItemClientWrapper& client, PaintIn validationReason paintInvalidationReason, const IntRect& previousPaintInvalidati onRect, const IntRect& newPaintInvalidationRect) 115 void PaintController::invalidate(const DisplayItemClientWrapper& client, PaintIn validationReason paintInvalidationReason, const Vector<IntRect>& paintInvalidati onRects)
116 { 116 {
117 invalidateClient(client); 117 invalidateClient(client);
118 118
119 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { 119 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled())
120 Invalidation invalidation = { previousPaintInvalidationRect, paintInvali dationReason }; 120 return;
121 if (!previousPaintInvalidationRect.isEmpty()) 121
122 m_invalidations.append(invalidation); 122 for (auto& rect : paintInvalidationRects) {
123 if (newPaintInvalidationRect != previousPaintInvalidationRect && !newPai ntInvalidationRect.isEmpty()) { 123 Invalidation invalidation = { rect, paintInvalidationReason };
124 invalidation.rect = newPaintInvalidationRect; 124 m_invalidations.append(invalidation);
125 m_invalidations.append(invalidation);
126 }
127 } 125 }
128 } 126 }
129 127
130 void PaintController::invalidateClient(const DisplayItemClientWrapper& client) 128 void PaintController::invalidateClient(const DisplayItemClientWrapper& client)
131 { 129 {
132 invalidateUntracked(client.displayItemClient()); 130 invalidateUntracked(client.displayItemClient());
133 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali dationObjects) 131 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali dationObjects)
134 m_trackedPaintInvalidationObjects->append(client.debugName()); 132 m_trackedPaintInvalidationObjects->append(client.debugName());
135 } 133 }
136 134
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 563
566 void PaintController::showDebugData() const 564 void PaintController::showDebugData() const
567 { 565 {
568 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.displayItemList()).utf8().data()); 566 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.displayItemList()).utf8().data());
569 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); 567 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data());
570 } 568 }
571 569
572 #endif // ifndef NDEBUG 570 #endif // ifndef NDEBUG
573 571
574 } // namespace blink 572 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698