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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 431 CompositeOperator previousOperator = paintInfo.context->compositeOpe ration(); | 431 CompositeOperator previousOperator = paintInfo.context->compositeOpe ration(); |
| 432 paintInfo.context->setCompositeOperation(CompositeCopy); | 432 paintInfo.context->setCompositeOperation(CompositeCopy); |
| 433 paintInfo.context->fillRect(paintInfo.rect, baseColor); | 433 paintInfo.context->fillRect(paintInfo.rect, baseColor); |
| 434 paintInfo.context->setCompositeOperation(previousOperator); | 434 paintInfo.context->setCompositeOperation(previousOperator); |
| 435 } else { | 435 } else { |
| 436 paintInfo.context->clearRect(paintInfo.rect); | 436 paintInfo.context->clearRect(paintInfo.rect); |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 | 440 |
| 441 void RenderView::repaintTreeAfterLayout(const RenderLayerModelObject& repaintCon tainer) | |
|
Julien - ping for review
2014/05/30 02:39:32
This code path seems very artificial to me as I wo
leviw_travelin_and_unemployed
2014/05/30 15:52:57
I'm not sure I understand what the "artificial" pa
dsinclair
2014/06/02 00:38:29
That code path is never hit in RAL. I don't necess
Julien - ping for review
2014/06/02 23:21:19
It's not hit by RAL because we made it so, not bec
| |
| 442 { | |
| 443 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | |
| 444 ASSERT(!needsLayout()); | |
| 445 | |
| 446 // We specifically need to repaint the viewRect since other renderers | |
| 447 // short-circuit on full-repaint. | |
| 448 if (doingFullRepaint() && !viewRect().isEmpty()) | |
| 449 repaintViewRectangle(viewRect()); | |
| 450 | |
| 451 RenderBlock::repaintTreeAfterLayout(repaintContainer); | |
| 452 } | |
| 453 | |
| 441 void RenderView::repaintViewRectangle(const LayoutRect& ur) const | 454 void RenderView::repaintViewRectangle(const LayoutRect& ur) const |
| 442 { | 455 { |
| 443 ASSERT(!ur.isEmpty()); | 456 ASSERT(!ur.isEmpty()); |
| 444 | 457 |
| 445 if (document().printing() || !m_frameView) | 458 if (document().printing() || !m_frameView) |
| 446 return; | 459 return; |
| 447 | 460 |
| 448 // We always just invalidate the root view, since we could be an iframe that is clipped out | 461 // We always just invalidate the root view, since we could be an iframe that is clipped out |
| 449 // or even invisible. | 462 // or even invisible. |
| 450 Element* elt = document().ownerElement(); | 463 Element* elt = document().ownerElement(); |
| 451 if (!elt) | 464 if (!elt) { |
| 452 m_frameView->repaintContentRectangle(pixelSnappedIntRect(ur)); | 465 if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking) |
| 453 else if (RenderBox* obj = elt->renderBox()) { | 466 layer()->repainter().setBackingNeedsRepaintInRect(ur); |
| 467 else | |
| 468 m_frameView->repaintContentRectangle(pixelSnappedIntRect(ur)); | |
| 469 } else if (RenderBox* obj = elt->renderBox()) { | |
| 454 LayoutRect vr = viewRect(); | 470 LayoutRect vr = viewRect(); |
| 455 LayoutRect r = intersection(ur, vr); | 471 LayoutRect r = intersection(ur, vr); |
| 456 | 472 |
| 457 // Subtract out the contentsX and contentsY offsets to get our coords wi thin the viewing | 473 // Subtract out the contentsX and contentsY offsets to get our coords wi thin the viewing |
| 458 // rectangle. | 474 // rectangle. |
| 459 r.moveBy(-vr.location()); | 475 r.moveBy(-vr.location()); |
| 460 | 476 |
| 461 // FIXME: Hardcoded offsets here are not good. | 477 // FIXME: Hardcoded offsets here are not good. |
| 462 r.moveBy(obj->contentBoxRect().location()); | 478 r.moveBy(obj->contentBoxRect().location()); |
| 463 obj->repaintRectangle(r); | 479 obj->repaintRectangle(r); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 993 return viewWidth(IncludeScrollbars) / scale; | 1009 return viewWidth(IncludeScrollbars) / scale; |
| 994 } | 1010 } |
| 995 | 1011 |
| 996 double RenderView::layoutViewportHeight() const | 1012 double RenderView::layoutViewportHeight() const |
| 997 { | 1013 { |
| 998 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 1014 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
| 999 return viewHeight(IncludeScrollbars) / scale; | 1015 return viewHeight(IncludeScrollbars) / scale; |
| 1000 } | 1016 } |
| 1001 | 1017 |
| 1002 } // namespace WebCore | 1018 } // namespace WebCore |
| OLD | NEW |