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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2605543002: Replace adjustment of previous visual rects on scroll with normal paint invalidation (Closed)
Patch Set: Remove unused parameters Created 3 years, 11 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // FIXME: Remove incremental compositing updates after fixing the 288 // FIXME: Remove incremental compositing updates after fixing the
289 // chicken/egg issues, https://crbug.com/343756 289 // chicken/egg issues, https://crbug.com/343756
290 DisableCompositingQueryAsserts disabler; 290 DisableCompositingQueryAsserts disabler;
291 updatePaginationRecursive(enclosingPaginationLayer()); 291 updatePaginationRecursive(enclosingPaginationLayer());
292 } 292 }
293 } 293 }
294 294
295 void PaintLayer::updateLayerPositionRecursive() { 295 void PaintLayer::updateLayerPositionRecursive() {
296 updateLayerPosition(); 296 updateLayerPosition();
297 297
298 // FIXME(400589): We would like to do this in
299 // PaintLayerScrollableArea::updateAfterLayout, but it depends on the size
300 // computed by updateLayerPosition.
301 if (m_scrollableArea) {
302 if (ScrollAnimatorBase* scrollAnimator =
303 m_scrollableArea->existingScrollAnimator())
304 scrollAnimator->updateAfterLayout();
305 }
306
307 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) 298 for (PaintLayer* child = firstChild(); child; child = child->nextSibling())
308 child->updateLayerPositionRecursive(); 299 child->updateLayerPositionRecursive();
309 } 300 }
310 301
311 void PaintLayer::updateHasSelfPaintingLayerDescendant() const { 302 void PaintLayer::updateHasSelfPaintingLayerDescendant() const {
312 DCHECK(m_hasSelfPaintingLayerDescendantDirty); 303 DCHECK(m_hasSelfPaintingLayerDescendantDirty);
313 304
314 m_hasSelfPaintingLayerDescendant = false; 305 m_hasSelfPaintingLayerDescendant = false;
315 306
316 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) { 307 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 (layoutObject()->style()->position() == StickyPosition && 362 (layoutObject()->style()->position() == StickyPosition &&
372 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root())); 363 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root()));
373 } 364 }
374 365
375 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const { 366 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const {
376 if (sticksToViewport() != other->sticksToViewport()) 367 if (sticksToViewport() != other->sticksToViewport())
377 return true; 368 return true;
378 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); 369 return ancestorScrollingLayer() != other->ancestorScrollingLayer();
379 } 370 }
380 371
381 void PaintLayer::updateLayerPositionsAfterOverflowScroll( 372 void PaintLayer::updateLayerPositionsAfterOverflowScroll() {
382 const DoubleSize& scrollDelta) {
383 clipper().clearClipRectsIncludingDescendants(); 373 clipper().clearClipRectsIncludingDescendants();
384 updateLayerPositionsAfterScrollRecursive(scrollDelta, 374 updateLayerPositionRecursive();
385 isPaintInvalidationContainer());
386 }
387
388 void PaintLayer::updateLayerPositionsAfterScrollRecursive(
389 const DoubleSize& scrollDelta,
390 bool paintInvalidationContainerWasScrolled) {
391 updateLayerPosition();
392 if (paintInvalidationContainerWasScrolled &&
393 !isPaintInvalidationContainer()) {
394 // Paint invalidation rects are in the coordinate space of the paint
395 // invalidation container. If it has scrolled, the rect must be adjusted.
396 // Note that it is not safe to reset it to the current bounds rect, as the
397 // LayoutObject may have moved since the
398 // last invalidation.
399 // FIXME(416535): Ideally, pending invalidations of scrolling content should
400 // be stored in the coordinate space of the scrolling content layer, so that
401 // they need no adjustment.
402 m_layoutObject->adjustPreviousPaintInvalidationForScrollIfNeeded(
403 scrollDelta);
404 }
405 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) {
406 child->updateLayerPositionsAfterScrollRecursive(
407 scrollDelta, paintInvalidationContainerWasScrolled &&
408 !child->isPaintInvalidationContainer());
409 }
410 } 375 }
411 376
412 void PaintLayer::updateTransformationMatrix() { 377 void PaintLayer::updateTransformationMatrix() {
413 if (TransformationMatrix* transform = this->transform()) { 378 if (TransformationMatrix* transform = this->transform()) {
414 LayoutBox* box = layoutBox(); 379 LayoutBox* box = layoutBox();
415 DCHECK(box); 380 DCHECK(box);
416 transform->makeIdentity(); 381 transform->makeIdentity();
417 box->style()->applyTransform( 382 box->style()->applyTransform(
418 *transform, box->size(), ComputedStyle::IncludeTransformOrigin, 383 *transform, box->size(), ComputedStyle::IncludeTransformOrigin,
419 ComputedStyle::IncludeMotionPath, 384 ComputedStyle::IncludeMotionPath,
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
3289 } 3254 }
3290 3255
3291 void showLayerTree(const blink::LayoutObject* layoutObject) { 3256 void showLayerTree(const blink::LayoutObject* layoutObject) {
3292 if (!layoutObject) { 3257 if (!layoutObject) {
3293 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3258 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3294 return; 3259 return;
3295 } 3260 }
3296 showLayerTree(layoutObject->enclosingLayer()); 3261 showLayerTree(layoutObject->enclosingLayer());
3297 } 3262 }
3298 #endif 3263 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698