Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: Source/WebCore/rendering/RenderLayerCompositor.cpp

Issue 9405017: Merge 107024 - Properly detect top level frames when propogating compositing (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 return view->platformWidget(); 1255 return view->platformWidget();
1256 #endif 1256 #endif
1257 return false; 1257 return false;
1258 } 1258 }
1259 1259
1260 bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const 1260 bool RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame() const
1261 { 1261 {
1262 // Parent document content needs to be able to render on top of a composited frame, so correct behavior 1262 // Parent document content needs to be able to render on top of a composited frame, so correct behavior
1263 // is to have the parent document become composited too. However, this can c ause problems on platforms that 1263 // is to have the parent document become composited too. However, this can c ause problems on platforms that
1264 // use native views for frames (like Mac), so disable that behavior on those platforms for now. 1264 // use native views for frames (like Mac), so disable that behavior on those platforms for now.
1265 HTMLFrameOwnerElement* ownerElement = enclosingFrameElement(); 1265 HTMLFrameOwnerElement* ownerElement = m_renderView->document()->ownerElement ();
1266 RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0; 1266 RenderObject* renderer = ownerElement ? ownerElement->renderer() : 0;
1267 1267
1268 // If we are the top-level frame, don't propagate. 1268 // If we are the top-level frame, don't propagate.
1269 if (!ownerElement) 1269 if (!ownerElement)
1270 return false; 1270 return false;
1271 1271
1272 if (!allowsIndependentlyCompositedFrames(m_renderView->frameView())) 1272 if (!allowsIndependentlyCompositedFrames(m_renderView->frameView()))
1273 return true; 1273 return true;
1274 1274
1275 if (!renderer || !renderer->isRenderPart()) 1275 if (!renderer || !renderer->isRenderPart())
(...skipping 10 matching lines...) Expand all
1286 if (frameRenderer->widget()) { 1286 if (frameRenderer->widget()) {
1287 ASSERT(frameRenderer->widget()->isFrameView()); 1287 ASSERT(frameRenderer->widget()->isFrameView());
1288 FrameView* view = static_cast<FrameView*>(frameRenderer->widget()); 1288 FrameView* view = static_cast<FrameView*>(frameRenderer->widget());
1289 if (view->isOverlappedIncludingAncestors() || view->hasCompositingAncest or()) 1289 if (view->isOverlappedIncludingAncestors() || view->hasCompositingAncest or())
1290 return true; 1290 return true;
1291 } 1291 }
1292 1292
1293 return false; 1293 return false;
1294 } 1294 }
1295 1295
1296 HTMLFrameOwnerElement* RenderLayerCompositor::enclosingFrameElement() const
1297 {
1298 if (HTMLFrameOwnerElement* ownerElement = m_renderView->document()->ownerEle ment())
1299 return (ownerElement->hasTagName(iframeTag) || ownerElement->hasTagName( frameTag) || ownerElement->hasTagName(objectTag)) ? ownerElement : 0;
1300
1301 return 0;
1302 }
1303
1304 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const 1296 bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
1305 { 1297 {
1306 if (!canBeComposited(layer)) 1298 if (!canBeComposited(layer))
1307 return false; 1299 return false;
1308 1300
1309 return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers () || (inCompositingMode() && layer->isRootLayer()); 1301 return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers () || (inCompositingMode() && layer->isRootLayer());
1310 } 1302 }
1311 1303
1312 // Note: this specifies whether the RL needs a compositing layer for intrinsic r easons. 1304 // Note: this specifies whether the RL needs a compositing layer for intrinsic r easons.
1313 // Use needsToBeComposited() to determine if a RL actually needs a compositing l ayer. 1305 // Use needsToBeComposited() to determine if a RL actually needs a compositing l ayer.
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 if (!viewLayer->isComposited()) 1988 if (!viewLayer->isComposited())
1997 return; 1989 return;
1998 1990
1999 if (GraphicsLayer* rootLayer = viewLayer->backing()->graphicsLayer()) 1991 if (GraphicsLayer* rootLayer = viewLayer->backing()->graphicsLayer())
2000 rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants(); 1992 rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
2001 } 1993 }
2002 1994
2003 } // namespace WebCore 1995 } // namespace WebCore
2004 1996
2005 #endif // USE(ACCELERATED_COMPOSITING) 1997 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698