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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 rootView = rootView->frame()->ownerLayoutObject()->view(); | 944 rootView = rootView->frame()->ownerLayoutObject()->view(); |
945 | 945 |
946 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); | 946 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); |
947 | 947 |
948 // Plugin frameRects are in absolute screen space. | 948 // Plugin frameRects are in absolute screen space. |
949 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr
ameRect()), UseTransforms).enclosingBoundingBox(); | 949 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr
ameRect()), UseTransforms).enclosingBoundingBox(); |
950 | 950 |
951 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); | 951 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); |
952 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null
ptr); | 952 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null
ptr); |
953 | 953 |
954 // The frameRect is already in absolute space, except for scrolling of the r
oot frame. | 954 // The frameRect is already in absolute space of the local frame to the plug
in. |
955 windowRect = frameRect(); | 955 windowRect = frameRect(); |
| 956 // Map up to the root frame. |
956 windowRect = enclosingIntRect(m_element->document().view()->layoutView()->lo
calToAbsoluteQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries)
.boundingBox()); | 957 windowRect = enclosingIntRect(m_element->document().view()->layoutView()->lo
calToAbsoluteQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries)
.boundingBox()); |
| 958 // Finally, adjust for scrolling of the root frame, which the above does not
take into account. |
| 959 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location())); |
957 | 960 |
958 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); | 961 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); |
959 unclippedIntLocalRect = clippedLocalRect; | 962 unclippedIntLocalRect = clippedLocalRect; |
960 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); | 963 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); |
961 | 964 |
962 // TODO(chrishtr): intentionally ignore transform, because the positioning o
f frameRect() does also. This is probably wrong. | 965 // TODO(chrishtr): intentionally ignore transform, because the positioning o
f frameRect() does also. This is probably wrong. |
963 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal
Rect)).enclosingBoundingBox(); | 966 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal
Rect)).enclosingBoundingBox(); |
964 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc
losingBoundingBox(); | 967 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc
losingBoundingBox(); |
965 } | 968 } |
966 | 969 |
967 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli
pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) | 970 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli
pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) |
968 { | 971 { |
969 // document().layoutView() can be null when we receive messages from the | 972 // document().layoutView() can be null when we receive messages from the |
970 // plugins while we are destroying a frame. | 973 // plugins while we are destroying a frame. |
971 // FIXME: Can we just check m_element->document().isActive() ? | 974 // FIXME: Can we just check m_element->document().isActive() ? |
972 if (m_element->layoutObject()->document().layoutView()) { | 975 if (m_element->layoutObject()->document().layoutView()) { |
973 // Take our element and get the clip rect from the enclosing layer and | 976 // Take our element and get the clip rect from the enclosing layer and |
974 // frame view. | 977 // frame view. |
975 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); | 978 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); |
976 } | 979 } |
977 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 980 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
978 // Convert to the plugin position. | 981 // Convert to the plugin position. |
979 for (size_t i = 0; i < cutOutRects.size(); i++) | 982 for (size_t i = 0; i < cutOutRects.size(); i++) |
980 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 983 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
981 } | 984 } |
982 | 985 |
983 } // namespace blinkf | 986 } // namespace blinkf |
OLD | NEW |