| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 void RenderLayer::setSubpixelAccumulation(const LayoutSize& size) | 245 void RenderLayer::setSubpixelAccumulation(const LayoutSize& size) |
| 246 { | 246 { |
| 247 m_subpixelAccumulation = size; | 247 m_subpixelAccumulation = size; |
| 248 } | 248 } |
| 249 | 249 |
| 250 void RenderLayer::updateLayerPositionsAfterLayout(const RenderLayer* rootLayer,
UpdateLayerPositionsFlags flags) | 250 void RenderLayer::updateLayerPositionsAfterLayout(const RenderLayer* rootLayer,
UpdateLayerPositionsFlags flags) |
| 251 { | 251 { |
| 252 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou
t"); | 252 TRACE_EVENT0("blink_rendering", "RenderLayer::updateLayerPositionsAfterLayou
t"); |
| 253 | 253 |
| 254 m_clipper.clearClipRectsIncludingDescendants(); |
| 255 |
| 254 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues | 256 // FIXME: Remove incremental compositing updates after fixing the chicken/eg
g issues |
| 255 // https://code.google.com/p/chromium/issues/detail?id=343756 | 257 // https://code.google.com/p/chromium/issues/detail?id=343756 |
| 256 DisableCompositingQueryAsserts disabler; | 258 DisableCompositingQueryAsserts disabler; |
| 257 updateLayerPositionRecursive(flags); | 259 updateLayerPositionRecursive(flags); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void RenderLayer::updateLayerPositionRecursive(UpdateLayerPositionsFlags flags) | 262 void RenderLayer::updateLayerPositionRecursive(UpdateLayerPositionsFlags flags) |
| 261 { | 263 { |
| 262 if (updateLayerPosition()) | 264 if (updateLayerPosition()) |
| 263 flags |= ForceMayNeedPaintInvalidation; | 265 flags |= ForceMayNeedPaintInvalidation; |
| 264 | 266 |
| 265 if (flags & ForceMayNeedPaintInvalidation) | 267 if (flags & ForceMayNeedPaintInvalidation) |
| 266 m_renderer->setMayNeedPaintInvalidation(true); | 268 m_renderer->setMayNeedPaintInvalidation(true); |
| 267 | 269 |
| 268 // Clear our cached clip rect information. | |
| 269 m_clipper.clearClipRects(); | |
| 270 | |
| 271 if (hasOverflowControls()) { | 270 if (hasOverflowControls()) { |
| 272 // FIXME: We should figure out the right time to position the overflow c
ontrols. | 271 // FIXME: We should figure out the right time to position the overflow c
ontrols. |
| 273 // This call appears to be necessary to pass some layout test that use E
ventSender, | 272 // This call appears to be necessary to pass some layout test that use E
ventSender, |
| 274 // presumably because the normal time to position the controls is during
paint. We | 273 // presumably because the normal time to position the controls is during
paint. We |
| 275 // probably shouldn't position the overflow controls during paint either
... | 274 // probably shouldn't position the overflow controls during paint either
... |
| 276 scrollableArea()->positionOverflowControls(IntSize()); | 275 scrollableArea()->positionOverflowControls(IntSize()); |
| 277 } | 276 } |
| 278 | 277 |
| 279 updateDescendantDependentFlags(); | 278 updateDescendantDependentFlags(); |
| 280 | 279 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return renderer()->style()->position() == FixedPosition && renderer()->conta
iningBlock()->enclosingLayer()->isRootLayer(); | 337 return renderer()->style()->position() == FixedPosition && renderer()->conta
iningBlock()->enclosingLayer()->isRootLayer(); |
| 339 } | 338 } |
| 340 | 339 |
| 341 bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const | 340 bool RenderLayer::scrollsWithRespectTo(const RenderLayer* other) const |
| 342 { | 341 { |
| 343 if (scrollsWithViewport() != other->scrollsWithViewport()) | 342 if (scrollsWithViewport() != other->scrollsWithViewport()) |
| 344 return true; | 343 return true; |
| 345 return compositingInputs().ancestorScrollingLayer != other->compositingInput
s().ancestorScrollingLayer; | 344 return compositingInputs().ancestorScrollingLayer != other->compositingInput
s().ancestorScrollingLayer; |
| 346 } | 345 } |
| 347 | 346 |
| 348 void RenderLayer::updateLayerPositionsAfterDocumentScroll() | |
| 349 { | |
| 350 ASSERT(this == renderer()->view()->layer()); | |
| 351 updateLayerPositionsAfterScroll(); | |
| 352 } | |
| 353 | |
| 354 void RenderLayer::updateLayerPositionsAfterOverflowScroll() | 347 void RenderLayer::updateLayerPositionsAfterOverflowScroll() |
| 355 { | 348 { |
| 356 // FIXME: why is it OK to not check the ancestors of this layer in order to | 349 m_clipper.clearClipRectsIncludingDescendants(); |
| 357 // initialize the HasSeenViewportConstrainedAncestor and HasSeenAncestorWith
OverflowClip flags? | 350 updateLayerPositionsAfterScrollRecursive(); |
| 358 updateLayerPositionsAfterScroll(IsOverflowScroll); | |
| 359 } | 351 } |
| 360 | 352 |
| 361 void RenderLayer::updateLayerPositionsAfterScroll(UpdateLayerPositionsAfterScrol
lFlags flags) | 353 void RenderLayer::updateLayerPositionsAfterScrollRecursive() |
| 362 { | 354 { |
| 363 // FIXME: This shouldn't be needed, but there are some corner cases where | 355 updateLayerPosition(); |
| 364 // these flags are still dirty. Update so that the check below is valid. | |
| 365 updateDescendantDependentFlags(); | |
| 366 | 356 |
| 367 // If we have no visible content and no visible descendants, there is no poi
nt recomputing | 357 // FIXME: We could track the repaint container as we walk down the tree. |
| 368 // our rectangles as they will be empty. If our visibility changes, we are e
xpected to | 358 if (!renderer()->isTableCell()) |
| 369 // recompute all our positions anyway. | |
| 370 if (subtreeIsInvisible()) | |
| 371 return; | |
| 372 | |
| 373 if (updateLayerPosition()) | |
| 374 flags |= HasChangedAncestor; | |
| 375 | |
| 376 if ((flags & HasChangedAncestor) || (flags & HasSeenViewportConstrainedAnces
tor) || (flags & IsOverflowScroll)) | |
| 377 m_clipper.clearClipRects(); | |
| 378 | |
| 379 if (renderer()->style()->hasViewportConstrainedPosition()) | |
| 380 flags |= HasSeenViewportConstrainedAncestor; | |
| 381 | |
| 382 if (renderer()->hasOverflowClip()) | |
| 383 flags |= HasSeenAncestorWithOverflowClip; | |
| 384 | |
| 385 if ((flags & IsOverflowScroll) && (flags & HasSeenAncestorWithOverflowClip)
&& !renderer()->isTableCell()) { | |
| 386 // FIXME: We could track the repaint container as we walk down the tree. | |
| 387 m_renderer->setPreviousPaintInvalidationRect(m_renderer->boundsRectForPa
intInvalidation(m_renderer->containerForPaintInvalidation())); | 359 m_renderer->setPreviousPaintInvalidationRect(m_renderer->boundsRectForPa
intInvalidation(m_renderer->containerForPaintInvalidation())); |
| 388 } | |
| 389 | 360 |
| 390 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 361 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| 391 child->updateLayerPositionsAfterScroll(flags); | 362 child->updateLayerPositionsAfterScrollRecursive(); |
| 392 | |
| 393 // We don't update our reflection as scrolling is a translation which does n
ot change the size() | |
| 394 // of an object, thus RenderReplica will still repaint itself properly as th
e layer position was | |
| 395 // updated above. | |
| 396 } | 363 } |
| 397 | 364 |
| 398 void RenderLayer::updateTransformationMatrix() | 365 void RenderLayer::updateTransformationMatrix() |
| 399 { | 366 { |
| 400 if (m_transform) { | 367 if (m_transform) { |
| 401 RenderBox* box = renderBox(); | 368 RenderBox* box = renderBox(); |
| 402 ASSERT(box); | 369 ASSERT(box); |
| 403 m_transform->makeIdentity(); | 370 m_transform->makeIdentity(); |
| 404 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec
t().size(), RenderStyle::IncludeTransformOrigin); | 371 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec
t().size(), RenderStyle::IncludeTransformOrigin); |
| 405 makeMatrixRenderable(*m_transform, compositor()->hasAcceleratedCompositi
ng()); | 372 makeMatrixRenderable(*m_transform, compositor()->hasAcceleratedCompositi
ng()); |
| (...skipping 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3745 } | 3712 } |
| 3746 } | 3713 } |
| 3747 | 3714 |
| 3748 void showLayerTree(const WebCore::RenderObject* renderer) | 3715 void showLayerTree(const WebCore::RenderObject* renderer) |
| 3749 { | 3716 { |
| 3750 if (!renderer) | 3717 if (!renderer) |
| 3751 return; | 3718 return; |
| 3752 showLayerTree(renderer->enclosingLayer()); | 3719 showLayerTree(renderer->enclosingLayer()); |
| 3753 } | 3720 } |
| 3754 #endif | 3721 #endif |
| OLD | NEW |