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

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

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 // When we get to have a lot of rects on a layer, the performance cost of 2390 // When we get to have a lot of rects on a layer, the performance cost of
2391 // tracking those rects outweighs the benefit of doing compositor thread hit 2391 // tracking those rects outweighs the benefit of doing compositor thread hit
2392 // testing. 2392 // testing.
2393 // FIXME: This limit needs to be low due to the O(n^2) algorithm in 2393 // FIXME: This limit needs to be low due to the O(n^2) algorithm in
2394 // WebLayer::setTouchEventHandlerRegion - crbug.com/300282. 2394 // WebLayer::setTouchEventHandlerRegion - crbug.com/300282.
2395 const size_t maxRectsPerLayer = 100; 2395 const size_t maxRectsPerLayer = 100;
2396 2396
2397 LayerHitTestRects::iterator iter = layerRects.find(currentLayer); 2397 LayerHitTestRects::iterator iter = layerRects.find(currentLayer);
2398 Vector<LayoutRect>* iterValue; 2398 Vector<LayoutRect>* iterValue;
2399 if (iter == layerRects.end()) 2399 if (iter == layerRects.end())
2400 iterValue = 2400 iterValue = &layerRects.insert(currentLayer, Vector<LayoutRect>())
2401 &layerRects.add(currentLayer, Vector<LayoutRect>()).storedValue->value; 2401 .storedValue->value;
2402 else 2402 else
2403 iterValue = &iter->value; 2403 iterValue = &iter->value;
2404 for (size_t i = 0; i < ownRects.size(); i++) { 2404 for (size_t i = 0; i < ownRects.size(); i++) {
2405 if (!containerRect.contains(ownRects[i])) { 2405 if (!containerRect.contains(ownRects[i])) {
2406 iterValue->push_back(ownRects[i]); 2406 iterValue->push_back(ownRects[i]);
2407 if (iterValue->size() > maxRectsPerLayer) { 2407 if (iterValue->size() > maxRectsPerLayer) {
2408 // Just mark the entire layer instead, and switch to walking the layer 2408 // Just mark the entire layer instead, and switch to walking the layer
2409 // tree instead of the layout tree. 2409 // tree instead of the layout tree.
2410 layerRects.erase(currentLayer); 2410 layerRects.erase(currentLayer);
2411 currentLayer->addLayerHitTestRects(layerRects); 2411 currentLayer->addLayerHitTestRects(layerRects);
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
3492 const blink::LayoutObject* root = object1; 3492 const blink::LayoutObject* root = object1;
3493 while (root->parent()) 3493 while (root->parent())
3494 root = root->parent(); 3494 root = root->parent();
3495 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3495 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3496 } else { 3496 } else {
3497 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3497 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3498 } 3498 }
3499 } 3499 }
3500 3500
3501 #endif 3501 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698