| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 ASSERT(!needsLayout()); | 453 ASSERT(!needsLayout()); |
| 454 | 454 |
| 455 // We specifically need to repaint the viewRect since other renderers | 455 // We specifically need to repaint the viewRect since other renderers |
| 456 // short-circuit on full-repaint. | 456 // short-circuit on full-repaint. |
| 457 if (doingFullRepaint() && !viewRect().isEmpty()) | 457 if (doingFullRepaint() && !viewRect().isEmpty()) |
| 458 repaintViewRectangle(viewRect()); | 458 repaintViewRectangle(viewRect()); |
| 459 | 459 |
| 460 RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer); | 460 RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void RenderView::repaintViewRectangle(const LayoutRect& ur) const | 463 void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const |
| 464 { | 464 { |
| 465 ASSERT(!ur.isEmpty()); | 465 ASSERT(!repaintRect.isEmpty()); |
| 466 | 466 |
| 467 if (document().printing() || !m_frameView) | 467 if (document().printing() || !m_frameView) |
| 468 return; | 468 return; |
| 469 | 469 |
| 470 // We always just invalidate the root view, since we could be an iframe that
is clipped out | 470 // We always just invalidate the root view, since we could be an iframe that
is clipped out |
| 471 // or even invisible. | 471 // or even invisible. |
| 472 Element* elt = document().ownerElement(); | 472 Element* owner = document().ownerElement(); |
| 473 if (!elt) { | 473 if (layer()->compositingState() == PaintsIntoOwnBacking) { |
| 474 if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking) | 474 layer()->repainter().setBackingNeedsRepaintInRect(repaintRect); |
| 475 layer()->repainter().setBackingNeedsRepaintInRect(ur); | 475 } else if (!owner) { |
| 476 else | 476 m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(re
paintRect)); |
| 477 m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRec
t(ur)); | 477 } else if (RenderBox* obj = owner->renderBox()) { |
| 478 } else if (RenderBox* obj = elt->renderBox()) { | 478 LayoutRect viewRectangle = viewRect(); |
| 479 LayoutRect vr = viewRect(); | 479 LayoutRect rectToRepaint = intersection(repaintRect, viewRectangle); |
| 480 LayoutRect r = intersection(ur, vr); | |
| 481 | 480 |
| 482 // Subtract out the contentsX and contentsY offsets to get our coords wi
thin the viewing | 481 // Subtract out the contentsX and contentsY offsets to get our coords wi
thin the viewing |
| 483 // rectangle. | 482 // rectangle. |
| 484 r.moveBy(-vr.location()); | 483 rectToRepaint.moveBy(-viewRectangle.location()); |
| 485 | 484 |
| 486 // FIXME: Hardcoded offsets here are not good. | 485 // FIXME: Hardcoded offsets here are not good. |
| 487 r.moveBy(obj->contentBoxRect().location()); | 486 rectToRepaint.moveBy(obj->contentBoxRect().location()); |
| 488 obj->repaintRectangle(r); | 487 obj->repaintRectangle(rectToRepaint); |
| 489 } | 488 } |
| 490 } | 489 } |
| 491 | 490 |
| 492 void RenderView::repaintViewAndCompositedLayers() | 491 void RenderView::repaintViewAndCompositedLayers() |
| 493 { | 492 { |
| 494 repaint(); | 493 repaint(); |
| 495 | 494 |
| 496 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. | 495 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. |
| 497 DisableCompositingQueryAsserts disabler; | 496 DisableCompositingQueryAsserts disabler; |
| 498 | 497 |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 return viewWidth(IncludeScrollbars) / scale; | 1017 return viewWidth(IncludeScrollbars) / scale; |
| 1019 } | 1018 } |
| 1020 | 1019 |
| 1021 double RenderView::layoutViewportHeight() const | 1020 double RenderView::layoutViewportHeight() const |
| 1022 { | 1021 { |
| 1023 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 1022 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
| 1024 return viewHeight(IncludeScrollbars) / scale; | 1023 return viewHeight(IncludeScrollbars) / scale; |
| 1025 } | 1024 } |
| 1026 | 1025 |
| 1027 } // namespace WebCore | 1026 } // namespace WebCore |
| OLD | NEW |