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

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

Issue 266473009: Fix & clarify some comments in compositing. Rename clippedByAncestor to more accurately (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make conditionals clearer in shouldClipCompositedBounds Created 6 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 { 349 {
350 // Scrollbar layers use this layer for relative positioning, so don't clip. 350 // Scrollbar layers use this layer for relative positioning, so don't clip.
351 if (layerForHorizontalScrollbar() || layerForVerticalScrollbar()) 351 if (layerForHorizontalScrollbar() || layerForVerticalScrollbar())
352 return false; 352 return false;
353 353
354 if (layerOrAncestorIsTransformedOrUsingCompositedScrolling(&m_owningLayer)) 354 if (layerOrAncestorIsTransformedOrUsingCompositedScrolling(&m_owningLayer))
355 return false; 355 return false;
356 356
357 // Scrolled composited layers are clipped by their ancestor clipping layer, 357 // Scrolled composited layers are clipped by their ancestor clipping layer,
358 // so don't clip these, either. 358 // so don't clip these, either.
359 if (!compositor()->clippedByAncestor(&m_owningLayer)) 359 if (compositor()->clippedByNonAncestorInStackingTree(&m_owningLayer)
360 return true; 360 && m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_ow ningLayer.ancestorScrollingLayer())
361 return false;
361 362
362 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() != m_ownin gLayer.ancestorScrollingLayer()) 363 return true;
363 return true;
364
365 return false;
366 } 364 }
367 365
368 void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::Update Type updateType) 366 void CompositedLayerMapping::updateCompositedBounds(GraphicsLayerUpdater::Update Type updateType)
369 { 367 {
370 if (!shouldUpdateGraphicsLayer(updateType)) 368 if (!shouldUpdateGraphicsLayer(updateType))
371 return; 369 return;
372 370
373 // We need to know if we draw content in order to update our bounds (this ha s an effect 371 // We need to know if we draw content in order to update our bounds (this ha s an effect
374 // on whether or not descendands will paint into our backing). Update this v alue now. 372 // on whether or not descendands will paint into our backing). Update this v alue now.
375 updateDrawsContent(); 373 updateDrawsContent();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin gLayer))) 451 if (updateForegroundLayer(compositor->needsContentsCompositingLayer(&m_ownin gLayer)))
454 layerConfigChanged = true; 452 layerConfigChanged = true;
455 453
456 bool needsDescendantsClippingLayer = compositor->clipsCompositingDescendants (&m_owningLayer); 454 bool needsDescendantsClippingLayer = compositor->clipsCompositingDescendants (&m_owningLayer);
457 455
458 // Our scrolling layer will clip. 456 // Our scrolling layer will clip.
459 if (m_owningLayer.needsCompositedScrolling()) 457 if (m_owningLayer.needsCompositedScrolling())
460 needsDescendantsClippingLayer = false; 458 needsDescendantsClippingLayer = false;
461 459
462 RenderLayer* scrollParent = compositor->acceleratedCompositingForOverflowScr ollEnabled() ? m_owningLayer.scrollParent() : 0; 460 RenderLayer* scrollParent = compositor->acceleratedCompositingForOverflowScr ollEnabled() ? m_owningLayer.scrollParent() : 0;
463 bool needsAncestorClip = compositor->clippedByAncestor(&m_owningLayer); 461 bool needsAncestorClip = compositor->clippedByNonAncestorInStackingTree(&m_o wningLayer);
464 if (scrollParent) { 462 if (scrollParent) {
465 // If our containing block is our ancestor scrolling layer, then we'll a lready be clipped 463 // If our containing block is our ancestor scrolling layer, then we'll a lready be clipped
466 // to it via our scroll parent and we don't need an ancestor clipping la yer. 464 // to it via our scroll parent and we don't need an ancestor clipping la yer.
467 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o wningLayer.ancestorCompositedScrollingLayer()) 465 if (m_owningLayer.renderer()->containingBlock()->enclosingLayer() == m_o wningLayer.ancestorCompositedScrollingLayer())
468 needsAncestorClip = false; 466 needsAncestorClip = false;
469 } 467 }
470 468
471 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer)) 469 if (updateClippingLayers(needsAncestorClip, needsDescendantsClippingLayer))
472 layerConfigChanged = true; 470 layerConfigChanged = true;
473 471
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2155 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2158 name = "Scrolling Contents Layer"; 2156 name = "Scrolling Contents Layer";
2159 } else { 2157 } else {
2160 ASSERT_NOT_REACHED(); 2158 ASSERT_NOT_REACHED();
2161 } 2159 }
2162 2160
2163 return name; 2161 return name;
2164 } 2162 }
2165 2163
2166 } // namespace WebCore 2164 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | Source/core/rendering/compositing/RenderLayerCompositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698