OLD | NEW |
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. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 LayoutRect newContainerRect; | 2514 LayoutRect newContainerRect; |
2515 computeSelfHitTestRects(ownRects, layerOffset); | 2515 computeSelfHitTestRects(ownRects, layerOffset); |
2516 | 2516 |
2517 // When we get to have a lot of rects on a layer, the performance cost of tr
acking those | 2517 // When we get to have a lot of rects on a layer, the performance cost of tr
acking those |
2518 // rects outweighs the benefit of doing compositor thread hit testing. | 2518 // rects outweighs the benefit of doing compositor thread hit testing. |
2519 // FIXME: This limit needs to be low due to the O(n^2) algorithm in | 2519 // FIXME: This limit needs to be low due to the O(n^2) algorithm in |
2520 // WebLayer::setTouchEventHandlerRegion - crbug.com/300282. | 2520 // WebLayer::setTouchEventHandlerRegion - crbug.com/300282. |
2521 const size_t maxRectsPerLayer = 100; | 2521 const size_t maxRectsPerLayer = 100; |
2522 | 2522 |
2523 LayerHitTestRects::iterator iter = layerRects.find(currentLayer); | 2523 LayerHitTestRects::iterator iter = layerRects.find(currentLayer); |
2524 Vector<blink::LayoutRect>* iterValue; | 2524 Vector<LayoutRect>* iterValue; |
2525 if (iter == layerRects.end()) | 2525 if (iter == layerRects.end()) |
2526 iterValue = &layerRects.add(currentLayer, Vector<LayoutRect>()).storedVa
lue->value; | 2526 iterValue = &layerRects.add(currentLayer, Vector<LayoutRect>()).storedVa
lue->value; |
2527 else | 2527 else |
2528 iterValue = &iter->value; | 2528 iterValue = &iter->value; |
2529 for (size_t i = 0; i < ownRects.size(); i++) { | 2529 for (size_t i = 0; i < ownRects.size(); i++) { |
2530 if (!containerRect.contains(ownRects[i])) { | 2530 if (!containerRect.contains(ownRects[i])) { |
2531 iterValue->append(ownRects[i]); | 2531 iterValue->append(ownRects[i]); |
2532 if (iterValue->size() > maxRectsPerLayer) { | 2532 if (iterValue->size() > maxRectsPerLayer) { |
2533 // Just mark the entire layer instead, and switch to walking the
layer | 2533 // Just mark the entire layer instead, and switch to walking the
layer |
2534 // tree instead of the render tree. | 2534 // tree instead of the render tree. |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 { | 3470 { |
3471 if (object1) { | 3471 if (object1) { |
3472 const blink::RenderObject* root = object1; | 3472 const blink::RenderObject* root = object1; |
3473 while (root->parent()) | 3473 while (root->parent()) |
3474 root = root->parent(); | 3474 root = root->parent(); |
3475 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3475 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3476 } | 3476 } |
3477 } | 3477 } |
3478 | 3478 |
3479 #endif | 3479 #endif |
OLD | NEW |