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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: 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
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/instrumentation/tracing/TraceEvent.h" 9 #include "platform/instrumentation/tracing/TraceEvent.h"
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h"
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 clientToInvalidate = &m_newDisplayItemList[movedToIndex].client(); 725 clientToInvalidate = &m_newDisplayItemList[movedToIndex].client();
726 } else { 726 } else {
727 highestMovedToIndex = movedToIndex; 727 highestMovedToIndex = movedToIndex;
728 } 728 }
729 } 729 }
730 } else if (oldItem.drawsContent()) { 730 } else if (oldItem.drawsContent()) {
731 isPotentiallyInvalidClient = true; 731 isPotentiallyInvalidClient = true;
732 clientToInvalidate = &oldItem.client(); 732 clientToInvalidate = &oldItem.client();
733 } 733 }
734 if (clientToInvalidate && 734 if (clientToInvalidate &&
735 invalidatedClientsInOldChunk.add(clientToInvalidate).isNewEntry) { 735 invalidatedClientsInOldChunk.insert(clientToInvalidate).isNewEntry) {
736 addRasterInvalidationInfo( 736 addRasterInvalidationInfo(
737 isPotentiallyInvalidClient ? nullptr : clientToInvalidate, newChunk, 737 isPotentiallyInvalidClient ? nullptr : clientToInvalidate, newChunk,
738 FloatRect(m_currentPaintArtifact.getDisplayItemList().visualRect( 738 FloatRect(m_currentPaintArtifact.getDisplayItemList().visualRect(
739 oldIndex))); 739 oldIndex)));
740 } 740 }
741 } 741 }
742 742
743 HashSet<const DisplayItemClient*> invalidatedClientsInNewChunk; 743 HashSet<const DisplayItemClient*> invalidatedClientsInNewChunk;
744 for (size_t newIndex = newChunk.beginIndex; newIndex < newChunk.endIndex; 744 for (size_t newIndex = newChunk.beginIndex; newIndex < newChunk.endIndex;
745 ++newIndex) { 745 ++newIndex) {
746 const DisplayItem& newItem = m_newDisplayItemList[newIndex]; 746 const DisplayItem& newItem = m_newDisplayItemList[newIndex];
747 if (newItem.drawsContent() && !clientCacheIsValid(newItem.client()) && 747 if (newItem.drawsContent() && !clientCacheIsValid(newItem.client()) &&
748 invalidatedClientsInNewChunk.add(&newItem.client()).isNewEntry) { 748 invalidatedClientsInNewChunk.insert(&newItem.client()).isNewEntry) {
749 addRasterInvalidationInfo(&newItem.client(), newChunk, 749 addRasterInvalidationInfo(&newItem.client(), newChunk,
750 FloatRect(newItem.client().visualRect())); 750 FloatRect(newItem.client().visualRect()));
751 } 751 }
752 } 752 }
753 } 753 }
754 754
755 void PaintController::showUnderInvalidationError( 755 void PaintController::showUnderInvalidationError(
756 const char* reason, 756 const char* reason,
757 const DisplayItem& newItem, 757 const DisplayItem& newItem,
758 const DisplayItem* oldItem) const { 758 const DisplayItem* oldItem) const {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 0, m_newDisplayItemList.size(), 861 0, m_newDisplayItemList.size(),
862 showPictures ? (DisplayItemList::JsonOptions::ShowPictures | 862 showPictures ? (DisplayItemList::JsonOptions::ShowPictures |
863 DisplayItemList::JsonOptions::ShowClientDebugName) 863 DisplayItemList::JsonOptions::ShowClientDebugName)
864 : DisplayItemList::JsonOptions::ShowClientDebugName) 864 : DisplayItemList::JsonOptions::ShowClientDebugName)
865 ->toPrettyJSONString() 865 ->toPrettyJSONString()
866 .utf8() 866 .utf8()
867 .data()); 867 .data());
868 } 868 }
869 869
870 } // namespace blink 870 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698