| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 return view->platformWidget(); | 1258 return view->platformWidget(); |
| 1259 #endif | 1259 #endif |
| 1260 return false; | 1260 return false; |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const | 1263 bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const |
| 1264 { | 1264 { |
| 1265 // Parent document content needs to be able to render on top of a composited
frame, so correct behavior | 1265 // Parent document content needs to be able to render on top of a composited
frame, so correct behavior |
| 1266 // is to have the parent document become composited too. However, this can c
ause problems on platforms that | 1266 // is to have the parent document become composited too. However, this can c
ause problems on platforms that |
| 1267 // use native views for frames (like Mac), so disable that behavior on those
platforms for now. | 1267 // use native views for frames (like Mac), so disable that behavior on those
platforms for now. |
| 1268 HTMLFrameOwnerElement* ownerElement = enclosingFrameElement(); | 1268 HTMLFrameOwnerElement* ownerElement = m_renderView->document()->ownerElement
(); |
| 1269 RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0; | 1269 RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0; |
| 1270 | 1270 |
| 1271 // If we are the top-level frame, don't propagate. | 1271 // If we are the top-level frame, don't propagate. |
| 1272 if (!ownerElement) | 1272 if (!ownerElement) |
| 1273 return false; | 1273 return false; |
| 1274 | 1274 |
| 1275 if (!allowsIndependentlyCompositedFrames(m_renderView->frameView())) | 1275 if (!allowsIndependentlyCompositedFrames(m_renderView->frameView())) |
| 1276 return true; | 1276 return true; |
| 1277 | 1277 |
| 1278 if (!renderer || !renderer->isRenderPart()) | 1278 if (!renderer || !renderer->isRenderPart()) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1289 if (frameRenderer->widget()) { | 1289 if (frameRenderer->widget()) { |
| 1290 ASSERT(frameRenderer->widget()->isFrameView()); | 1290 ASSERT(frameRenderer->widget()->isFrameView()); |
| 1291 FrameView* view = static_cast<FrameView*>(frameRenderer->widget()); | 1291 FrameView* view = static_cast<FrameView*>(frameRenderer->widget()); |
| 1292 if (view->isOverlappedIncludingAncestors() || view->hasCompositingAncest
or()) | 1292 if (view->isOverlappedIncludingAncestors() || view->hasCompositingAncest
or()) |
| 1293 return true; | 1293 return true; |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 return false; | 1296 return false; |
| 1297 } | 1297 } |
| 1298 | 1298 |
| 1299 HTMLFrameOwnerElement* RenderLayerCompositor::enclosingFrameElement() const | |
| 1300 { | |
| 1301 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->ownerEle
ment()) | |
| 1302 return (ownerElement->hasTagName(iframeTag) || ownerElement->hasTagName(
frameTag) || ownerElement->hasTagName(objectTag)) ? ownerElement : 0; | |
| 1303 | |
| 1304 return 0; | |
| 1305 } | |
| 1306 | |
| 1307 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const | 1299 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const |
| 1308 { | 1300 { |
| 1309 if (!canBeComposited(layer)) | 1301 if (!canBeComposited(layer)) |
| 1310 return false; | 1302 return false; |
| 1311 | 1303 |
| 1312 return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers
() || (inCompositingMode() && layer->isRootLayer()); | 1304 return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers
() || (inCompositingMode() && layer->isRootLayer()); |
| 1313 } | 1305 } |
| 1314 | 1306 |
| 1315 // Note: this specifies whether the RL needs a compositing layer for intrinsic r
easons. | 1307 // Note: this specifies whether the RL needs a compositing layer for intrinsic r
easons. |
| 1316 // Use needsToBeComposited() to determine if a RL actually needs a compositing l
ayer. | 1308 // Use needsToBeComposited() to determine if a RL actually needs a compositing l
ayer. |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 return page->scrollingCoordinator(); | 2082 return page->scrollingCoordinator(); |
| 2091 } | 2083 } |
| 2092 | 2084 |
| 2093 return 0; | 2085 return 0; |
| 2094 } | 2086 } |
| 2095 #endif | 2087 #endif |
| 2096 | 2088 |
| 2097 } // namespace WebCore | 2089 } // namespace WebCore |
| 2098 | 2090 |
| 2099 #endif // USE(ACCELERATED_COMPOSITING) | 2091 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |