OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ASSERT(false); // We should have seen ro1 and ro2 by now. | 108 ASSERT(false); // We should have seen ro1 and ro2 by now. |
109 return false; | 109 return false; |
110 } | 110 } |
111 } | 111 } |
112 return true; | 112 return true; |
113 } | 113 } |
114 | 114 |
115 static bool intersectsRect(const LayoutObject* renderer, const IntRect& rect) | 115 static bool intersectsRect(const LayoutObject* renderer, const IntRect& rect) |
116 { | 116 { |
117 return renderer->absoluteBoundingBoxRectIgnoringTransforms().intersects(rect
) | 117 return renderer->absoluteBoundingBoxRectIgnoringTransforms().intersects(rect
) |
118 && (!renderer->style() || renderer->style()->visibility() == VISIBLE); | 118 && (!renderer->style() || renderer->style()->visibility() == EVisibility
::Visible); |
119 } | 119 } |
120 | 120 |
121 static void addToOcclusions(const LayoutBox* renderer, Vector<IntRect>& occlusio
ns) | 121 static void addToOcclusions(const LayoutBox* renderer, Vector<IntRect>& occlusio
ns) |
122 { | 122 { |
123 occlusions.append(IntRect( | 123 occlusions.append(IntRect( |
124 roundedIntPoint(renderer->localToAbsolute()), | 124 roundedIntPoint(renderer->localToAbsolute()), |
125 flooredIntSize(renderer->size()))); | 125 flooredIntSize(renderer->size()))); |
126 } | 126 } |
127 | 127 |
128 static void addTreeToOcclusions(const LayoutObject* renderer, const IntRect& fra
meRect, Vector<IntRect>& occlusions) | 128 static void addTreeToOcclusions(const LayoutObject* renderer, const IntRect& fra
meRect, Vector<IntRect>& occlusions) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // as being in the top layer. | 193 // as being in the top layer. |
194 const Element* ancestor = topLayerAncestor(element); | 194 const Element* ancestor = topLayerAncestor(element); |
195 Document* document = parentFrameView->frame().document(); | 195 Document* document = parentFrameView->frame().document(); |
196 const HeapVector<Member<Element>>& elements = document->topLayerElements(); | 196 const HeapVector<Member<Element>>& elements = document->topLayerElements(); |
197 size_t start = ancestor ? elements.find(ancestor) + 1 : 0; | 197 size_t start = ancestor ? elements.find(ancestor) + 1 : 0; |
198 for (size_t i = start; i < elements.size(); ++i) | 198 for (size_t i = start; i < elements.size(); ++i) |
199 addTreeToOcclusions(elements[i]->layoutObject(), frameRect, occlusions); | 199 addTreeToOcclusions(elements[i]->layoutObject(), frameRect, occlusions); |
200 } | 200 } |
201 | 201 |
202 } // namespace blink | 202 } // namespace blink |
OLD | NEW |