Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 // short-circuit on full-paint invalidation. | 326 // short-circuit on full-paint invalidation. |
| 327 LayoutRect dirtyRect = viewRect(); | 327 LayoutRect dirtyRect = viewRect(); |
| 328 if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { | 328 if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { |
| 329 const LayoutLayerModelObject* paintInvalidationContainer = &paintInvalid ationState.paintInvalidationContainer(); | 329 const LayoutLayerModelObject* paintInvalidationContainer = &paintInvalid ationState.paintInvalidationContainer(); |
| 330 Layer::mapRectToPaintInvalidationBacking(this, paintInvalidationContaine r, dirtyRect, &paintInvalidationState); | 330 Layer::mapRectToPaintInvalidationBacking(this, paintInvalidationContaine r, dirtyRect, &paintInvalidationState); |
| 331 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Pai ntInvalidationFull); | 331 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Pai ntInvalidationFull); |
| 332 } | 332 } |
| 333 RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); | 333 RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); |
| 334 } | 334 } |
| 335 | 335 |
| 336 LayoutRect RenderView::rectForPaintInvalidation(const LayoutRect* paintInvalidat ionRectPtr) const | |
|
enne (OOO)
2015/02/10 00:17:49
I see your comment about this existing before and
MikeB
2015/03/18 21:18:34
I updated this to be more in-line with using prope
| |
| 337 { | |
| 338 LayoutRect paintInvalidationRect = | |
| 339 paintInvalidationRectPtr ? *paintInvalidationRectPtr : viewRect(); | |
| 340 Element* owner = document().ownerElement(); | |
| 341 if (document().printing() || !m_frameView | |
| 342 || layer()->compositingState() == PaintsIntoOwnBacking || !owner) | |
| 343 return paintInvalidationRect; | |
| 344 if (RenderBox* obj = owner->renderBox()) { | |
| 345 // Intersect the viewport with the paint invalidation rect. | |
| 346 LayoutRect viewRectangle = viewRect(); | |
| 347 LayoutRect rectToInvalidate = intersection(paintInvalidationRect, viewRe ctangle); | |
| 348 | |
| 349 // Adjust for scroll offset of the view. | |
| 350 rectToInvalidate.moveBy(-viewRectangle.location()); | |
| 351 | |
| 352 // Adjust for frame border. | |
| 353 rectToInvalidate.moveBy(obj->contentBoxRect().location()); | |
| 354 return rectToInvalidate; | |
| 355 } | |
| 356 return paintInvalidationRect; | |
| 357 } | |
| 358 | |
| 336 void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation Rect, PaintInvalidationReason invalidationReason) const | 359 void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation Rect, PaintInvalidationReason invalidationReason) const |
| 337 { | 360 { |
| 338 ASSERT(!paintInvalidationRect.isEmpty()); | 361 ASSERT(!paintInvalidationRect.isEmpty()); |
| 339 | 362 |
| 340 if (document().printing() || !m_frameView) | 363 if (document().printing() || !m_frameView) |
| 341 return; | 364 return; |
| 342 | 365 |
| 343 ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->owne rRenderer()); | 366 ASSERT(layer()->compositingState() == PaintsIntoOwnBacking || !frame()->owne rRenderer()); |
| 344 | 367 |
| 345 if (layer()->compositingState() == PaintsIntoOwnBacking) { | 368 if (layer()->compositingState() == PaintsIntoOwnBacking) { |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 981 } | 1004 } |
| 982 | 1005 |
| 983 void RenderView::invalidateDisplayItemClients(DisplayItemList* displayItemList) const | 1006 void RenderView::invalidateDisplayItemClients(DisplayItemList* displayItemList) const |
| 984 { | 1007 { |
| 985 RenderBlockFlow::invalidateDisplayItemClients(displayItemList); | 1008 RenderBlockFlow::invalidateDisplayItemClients(displayItemList); |
| 986 if (m_frameView) | 1009 if (m_frameView) |
| 987 displayItemList->invalidate(m_frameView->displayItemClient()); | 1010 displayItemList->invalidate(m_frameView->displayItemClient()); |
| 988 } | 1011 } |
| 989 | 1012 |
| 990 } // namespace blink | 1013 } // namespace blink |
| OLD | NEW |