| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 rootView = rootView->frame()->ownerLayoutObject()->view(); | 967 rootView = rootView->frame()->ownerLayoutObject()->view(); |
| 968 | 968 |
| 969 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); | 969 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); |
| 970 | 970 |
| 971 // Plugin frameRects are in absolute screen space. | 971 // Plugin frameRects are in absolute screen space. |
| 972 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr
ameRect()), UseTransforms).enclosingBoundingBox(); | 972 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr
ameRect()), UseTransforms).enclosingBoundingBox(); |
| 973 | 973 |
| 974 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); | 974 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); |
| 975 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null
ptr); | 975 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null
ptr); |
| 976 | 976 |
| 977 // The frameRect is already in absolute space. | 977 // The frameRect is already in absolute space, except for scrolling of the r
oot frame. |
| 978 windowRect = frameRect(); | 978 windowRect = frameRect(); |
| 979 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location())); |
| 979 | 980 |
| 980 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); | 981 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); |
| 981 unclippedIntLocalRect = clippedLocalRect; | 982 unclippedIntLocalRect = clippedLocalRect; |
| 982 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); | 983 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); |
| 983 | 984 |
| 984 // TODO(chrishtr): intentionally ignore transform, because the positioning o
f frameRect() does also. This is probably wrong. | 985 // TODO(chrishtr): intentionally ignore transform, because the positioning o
f frameRect() does also. This is probably wrong. |
| 985 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal
Rect)).enclosingBoundingBox(); | 986 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal
Rect)).enclosingBoundingBox(); |
| 986 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc
losingBoundingBox(); | 987 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc
losingBoundingBox(); |
| 987 } | 988 } |
| 988 | 989 |
| 989 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli
pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) | 990 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli
pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) |
| 990 { | 991 { |
| 991 // document().layoutView() can be 0 when we receive messages from the | 992 // document().layoutView() can be null when we receive messages from the |
| 992 // plugins while we are destroying a frame. | 993 // plugins while we are destroying a frame. |
| 993 // FIXME: Can we just check m_element->document().isActive() ? | 994 // FIXME: Can we just check m_element->document().isActive() ? |
| 994 if (m_element->layoutObject()->document().layoutView()) { | 995 if (m_element->layoutObject()->document().layoutView()) { |
| 995 // Take our element and get the clip rect from the enclosing layer and | 996 // Take our element and get the clip rect from the enclosing layer and |
| 996 // frame view. | 997 // frame view. |
| 997 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); | 998 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); |
| 998 } | 999 } |
| 999 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 1000 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 1000 // Convert to the plugin position. | 1001 // Convert to the plugin position. |
| 1001 for (size_t i = 0; i < cutOutRects.size(); i++) | 1002 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 1002 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 1003 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 1003 } | 1004 } |
| 1004 | 1005 |
| 1005 } // namespace blinkf | 1006 } // namespace blinkf |
| OLD | NEW |