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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed conflicts Created 6 years, 6 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
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 if (!isHTMLVideoElement(fullscreenElement)) 245 if (!isHTMLVideoElement(fullscreenElement))
246 return 0; 246 return 0;
247 RenderObject* renderer = fullscreenElement->renderer(); 247 RenderObject* renderer = fullscreenElement->renderer();
248 if (!renderer) 248 if (!renderer)
249 return 0; 249 return 0;
250 return toRenderVideo(renderer); 250 return toRenderVideo(renderer);
251 } 251 }
252 252
253 void RenderLayerCompositor::updateIfNeededRecursive() 253 void RenderLayerCompositor::updateIfNeededRecursive()
254 { 254 {
255 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild (); child; child = child->tree().nextSibling()) 255 for (Frame* child = m_renderView.frameView()->frame().tree().firstChild(); c hild; child = child->tree().nextSibling()) {
256 child->contentRenderer()->compositor()->updateIfNeededRecursive(); 256 if (child->isLocalFrame())
257 toLocalFrame(child)->contentRenderer()->compositor()->updateIfNeeded Recursive();
258 }
257 259
258 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateIfNeededRecurs ive"); 260 TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::updateIfNeededRecurs ive");
259 261
260 ASSERT(!m_renderView.needsLayout()); 262 ASSERT(!m_renderView.needsLayout());
261 263
262 ScriptForbiddenScope forbidScript; 264 ScriptForbiddenScope forbidScript;
263 265
264 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate); 266 lifecycle().advanceTo(DocumentLifecycle::InCompositingUpdate);
265 267
266 updateIfNeeded(); 268 updateIfNeeded();
267 269
268 lifecycle().advanceTo(DocumentLifecycle::CompositingClean); 270 lifecycle().advanceTo(DocumentLifecycle::CompositingClean);
269 271
270 DocumentAnimations::startPendingAnimations(m_renderView.document()); 272 DocumentAnimations::startPendingAnimations(m_renderView.document());
271 // TODO: Figure out why this fails on Chrome OS login page. crbug.com/365507 273 // TODO: Figure out why this fails on Chrome OS login page. crbug.com/365507
272 // ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean); 274 // ASSERT(lifecycle().state() == DocumentLifecycle::CompositingClean);
273 275
274 #if ASSERT_ENABLED 276 #if ASSERT_ENABLED
275 assertNoUnresolvedDirtyBits(); 277 assertNoUnresolvedDirtyBits();
276 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild (); child; child = child->tree().nextSibling()) 278 for (Frame* child = m_renderView.frameView()->frame().tree().firstChild(); c hild; child = child->tree().nextSibling()) {
277 child->contentRenderer()->compositor()->assertNoUnresolvedDirtyBits(); 279 if (child->isLocalFrame())
280 toLocalFrame(child)->contentRenderer()->compositor()->assertNoUnreso lvedDirtyBits();
281 }
278 #endif 282 #endif
279 } 283 }
280 284
281 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda teType) 285 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda teType)
282 { 286 {
283 ASSERT(updateType != CompositingUpdateNone); 287 ASSERT(updateType != CompositingUpdateNone);
284 // FIXME: Technically we only need to do this when the FrameView's isScrolla ble method 288 // FIXME: Technically we only need to do this when the FrameView's isScrolla ble method
285 // would return a different value. 289 // would return a different value.
286 if (updateType == CompositingUpdateAfterLayout) 290 if (updateType == CompositingUpdateAfterLayout)
287 m_rootShouldAlwaysCompositeDirty = true; 291 m_rootShouldAlwaysCompositeDirty = true;
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 1325
1322 // IFrames are special, because we hook compositing layers together across ifram e boundaries 1326 // IFrames are special, because we hook compositing layers together across ifram e boundaries
1323 // when both parent and iframe content are composited. So when this frame become s composited, we have 1327 // when both parent and iframe content are composited. So when this frame become s composited, we have
1324 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite. 1328 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
1325 void RenderLayerCompositor::notifyIFramesOfCompositingChange() 1329 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
1326 { 1330 {
1327 if (!m_renderView.frameView()) 1331 if (!m_renderView.frameView())
1328 return; 1332 return;
1329 LocalFrame& frame = m_renderView.frameView()->frame(); 1333 LocalFrame& frame = m_renderView.frameView()->frame();
1330 1334
1331 for (LocalFrame* child = frame.tree().firstChild(); child; child = child->tr ee().traverseNext(&frame)) { 1335 for (Frame* child = frame.tree().firstChild(); child; child = child->tree(). traverseNext(&frame)) {
1332 if (!child->document()) 1336 if (!child->isLocalFrame())
1337 continue;
1338 if (!toLocalFrame(child)->document())
1333 continue; // FIXME: Can this happen? 1339 continue; // FIXME: Can this happen?
1334 if (HTMLFrameOwnerElement* ownerElement = child->document()->ownerElemen t()) { 1340 if (HTMLFrameOwnerElement* ownerElement = toLocalFrame(child)->document( )->ownerElement()) {
1335 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerEle ment->document().lifecycle()); 1341 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerEle ment->document().lifecycle());
1336 ownerElement->scheduleLayerUpdate(); 1342 ownerElement->scheduleLayerUpdate();
1337 } 1343 }
1338 } 1344 }
1339 1345
1340 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so 1346 // Compositing also affects the answer to RenderIFrame::requiresAcceleratedC ompositing(), so
1341 // we need to schedule a style recalc in our parent document. 1347 // we need to schedule a style recalc in our parent document.
1342 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) { 1348 if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerEleme nt()) {
1343 ownerElement->document().renderView()->compositor()->setNeedsCompositing Update(CompositingUpdateAfterCompositingInputChange); 1349 ownerElement->document().renderView()->compositor()->setNeedsCompositing Update(CompositingUpdateAfterCompositingInputChange);
1344 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerElement ->document().lifecycle()); 1350 DeprecatedScheduleStyleRecalcDuringCompositingUpdate marker(ownerElement ->document().lifecycle());
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 } else if (graphicsLayer == m_scrollLayer.get()) { 1401 } else if (graphicsLayer == m_scrollLayer.get()) {
1396 name = "LocalFrame Scrolling Layer"; 1402 name = "LocalFrame Scrolling Layer";
1397 } else { 1403 } else {
1398 ASSERT_NOT_REACHED(); 1404 ASSERT_NOT_REACHED();
1399 } 1405 }
1400 1406
1401 return name; 1407 return name;
1402 } 1408 }
1403 1409
1404 } // namespace WebCore 1410 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698