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

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

Issue 323653002: Delete CompositingUpdateAfterLayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add back two lines to fix browser_test 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/compositing/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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 #if ASSERT_ENABLED 250 #if ASSERT_ENABLED
251 assertNoUnresolvedDirtyBits(); 251 assertNoUnresolvedDirtyBits();
252 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild (); child; child = child->tree().nextSibling()) 252 for (LocalFrame* child = m_renderView.frameView()->frame().tree().firstChild (); child; child = child->tree().nextSibling())
253 child->contentRenderer()->compositor()->assertNoUnresolvedDirtyBits(); 253 child->contentRenderer()->compositor()->assertNoUnresolvedDirtyBits();
254 #endif 254 #endif
255 } 255 }
256 256
257 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda teType) 257 void RenderLayerCompositor::setNeedsCompositingUpdate(CompositingUpdateType upda teType)
258 { 258 {
259 ASSERT(updateType != CompositingUpdateNone); 259 ASSERT(updateType != CompositingUpdateNone);
260 // FIXME: Technically we only need to do this when the FrameView's isScrolla ble method
261 // would return a different value.
262 if (updateType == CompositingUpdateAfterLayout)
263 m_rootShouldAlwaysCompositeDirty = true;
264 260
265 // FIXME: This function should only set dirty bits. We shouldn't 261 // FIXME: This function should only set dirty bits. We shouldn't
266 // enable compositing mode here. 262 // enable compositing mode here.
267 // We check needsLayout here because we don't know if we need to enable 263 // We check needsLayout here because we don't know if we need to enable
268 // compositing mode until layout is up-to-date because we need to know 264 // compositing mode until layout is up-to-date because we need to know
269 // if this frame scrolls. 265 // if this frame scrolls.
266 //
267 // NOTE: CastStreamingApiTestWithPixelOutput.RtpStreamError triggers
268 // an ASSERT when this code is removed.
270 if (!m_renderView.needsLayout()) 269 if (!m_renderView.needsLayout())
271 enableCompositingModeIfNeeded(); 270 enableCompositingModeIfNeeded();
272 271
273 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType); 272 m_pendingUpdateType = std::max(m_pendingUpdateType, updateType);
274
275 page()->animator().scheduleVisualUpdate(); 273 page()->animator().scheduleVisualUpdate();
276 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean); 274 lifecycle().ensureStateAtMost(DocumentLifecycle::LayoutClean);
277 } 275 }
278 276
277 void RenderLayerCompositor::didLayout()
278 {
279 // FIXME: Technically we only need to do this when the FrameView's
280 // isScrollable method would return a different value.
281 m_rootShouldAlwaysCompositeDirty = true;
282 enableCompositingModeIfNeeded();
283
284 // FIXME: Rather than marking the entire RenderView as dirty, we should
285 // track which RenderLayers moved during layout and only dirty those
286 // specific RenderLayers.
287 rootRenderLayer()->setNeedsToUpdateAncestorDependentProperties();
288 setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange);
289 }
290
279 #if ASSERT_ENABLED 291 #if ASSERT_ENABLED
280 292
281 void RenderLayerCompositor::assertNoUnresolvedDirtyBits() 293 void RenderLayerCompositor::assertNoUnresolvedDirtyBits()
282 { 294 {
283 ASSERT(!compositingLayersNeedRebuild()); 295 ASSERT(!compositingLayersNeedRebuild());
284 ASSERT(m_pendingUpdateType == CompositingUpdateNone); 296 ASSERT(m_pendingUpdateType == CompositingUpdateNone);
285 ASSERT(!m_rootShouldAlwaysCompositeDirty); 297 ASSERT(!m_rootShouldAlwaysCompositeDirty);
286 } 298 }
287 299
288 #endif 300 #endif
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 if (!hasAcceleratedCompositing()) 353 if (!hasAcceleratedCompositing())
342 return; 354 return;
343 355
344 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling Coordinator()->needsToUpdateAfterCompositingChange(); 356 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() && scrolling Coordinator()->needsToUpdateAfterCompositingChange();
345 if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate & & !needsToUpdateScrollingCoordinator) 357 if (updateType == CompositingUpdateNone && !needHierarchyAndGeometryUpdate & & !needsToUpdateScrollingCoordinator)
346 return; 358 return;
347 359
348 GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpda ter::DoNotForceUpdate; 360 GraphicsLayerUpdater::UpdateType graphicsLayerUpdateType = GraphicsLayerUpda ter::DoNotForceUpdate;
349 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo sitingPropertyUpdater::DoNotForceUpdate; 361 CompositingPropertyUpdater::UpdateType compositingPropertyUpdateType = Compo sitingPropertyUpdater::DoNotForceUpdate;
350 362
351 // FIXME: Teach non-style compositing updates how to do partial tree walks.
352 if (updateType >= CompositingUpdateAfterLayout) {
353 graphicsLayerUpdateType = GraphicsLayerUpdater::ForceUpdate;
354 compositingPropertyUpdateType = CompositingPropertyUpdater::ForceUpdate;
355 }
356
357 RenderLayer* updateRoot = rootRenderLayer(); 363 RenderLayer* updateRoot = rootRenderLayer();
358 364
359 Vector<RenderLayer*> layersNeedingRepaint; 365 Vector<RenderLayer*> layersNeedingRepaint;
360 366
361 if (updateType >= CompositingUpdateAfterCompositingInputChange) { 367 if (updateType >= CompositingUpdateAfterCompositingInputChange) {
362 bool layersChanged = false; 368 bool layersChanged = false;
363 { 369 {
364 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA ncestorDependentProperties"); 370 TRACE_EVENT0("blink_rendering", "CompositingPropertyUpdater::updateA ncestorDependentProperties");
365 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper ties(updateRoot, compositingPropertyUpdateType); 371 CompositingPropertyUpdater(updateRoot).updateAncestorDependentProper ties(updateRoot, compositingPropertyUpdateType);
366 #if ASSERT_ENABLED 372 #if ASSERT_ENABLED
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 } else if (graphicsLayer == m_scrollLayer.get()) { 1343 } else if (graphicsLayer == m_scrollLayer.get()) {
1338 name = "LocalFrame Scrolling Layer"; 1344 name = "LocalFrame Scrolling Layer";
1339 } else { 1345 } else {
1340 ASSERT_NOT_REACHED(); 1346 ASSERT_NOT_REACHED();
1341 } 1347 }
1342 1348
1343 return name; 1349 return name;
1344 } 1350 }
1345 1351
1346 } // namespace WebCore 1352 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698