| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); | 438 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); |
| 439 paintInfo.context->setCompositeOperation(CompositeCopy); | 439 paintInfo.context->setCompositeOperation(CompositeCopy); |
| 440 paintInfo.context->fillRect(paintInfo.rect, baseColor); | 440 paintInfo.context->fillRect(paintInfo.rect, baseColor); |
| 441 paintInfo.context->setCompositeOperation(previousOperator); | 441 paintInfo.context->setCompositeOperation(previousOperator); |
| 442 } else { | 442 } else { |
| 443 paintInfo.context->clearRect(paintInfo.rect); | 443 paintInfo.context->clearRect(paintInfo.rect); |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 void RenderView::invalidateTreeAfterLayout(const RenderLayerModelObject& paintIn
validationContainer) |
| 449 { |
| 450 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); |
| 451 ASSERT(!needsLayout()); |
| 452 |
| 453 // We specifically need to repaint the viewRect since other renderers |
| 454 // short-circuit on full-repaint. |
| 455 if (doingFullRepaint() && !viewRect().isEmpty()) |
| 456 repaintViewRectangle(viewRect()); |
| 457 |
| 458 RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer); |
| 459 } |
| 460 |
| 448 void RenderView::repaintViewRectangle(const LayoutRect& ur) const | 461 void RenderView::repaintViewRectangle(const LayoutRect& ur) const |
| 449 { | 462 { |
| 450 ASSERT(!ur.isEmpty()); | 463 ASSERT(!ur.isEmpty()); |
| 451 | 464 |
| 452 if (document().printing() || !m_frameView) | 465 if (document().printing() || !m_frameView) |
| 453 return; | 466 return; |
| 454 | 467 |
| 455 // We always just invalidate the root view, since we could be an iframe that
is clipped out | 468 // We always just invalidate the root view, since we could be an iframe that
is clipped out |
| 456 // or even invisible. | 469 // or even invisible. |
| 457 Element* elt = document().ownerElement(); | 470 Element* elt = document().ownerElement(); |
| 458 if (!elt) | 471 if (!elt) { |
| 459 m_frameView->repaintContentRectangle(pixelSnappedIntRect(ur)); | 472 if (hasLayer() && layer()->compositingState() == PaintsIntoOwnBacking) |
| 460 else if (RenderBox* obj = elt->renderBox()) { | 473 layer()->repainter().setBackingNeedsRepaintInRect(ur); |
| 474 else |
| 475 m_frameView->repaintContentRectangle(pixelSnappedIntRect(ur)); |
| 476 } else if (RenderBox* obj = elt->renderBox()) { |
| 461 LayoutRect vr = viewRect(); | 477 LayoutRect vr = viewRect(); |
| 462 LayoutRect r = intersection(ur, vr); | 478 LayoutRect r = intersection(ur, vr); |
| 463 | 479 |
| 464 // Subtract out the contentsX and contentsY offsets to get our coords wi
thin the viewing | 480 // Subtract out the contentsX and contentsY offsets to get our coords wi
thin the viewing |
| 465 // rectangle. | 481 // rectangle. |
| 466 r.moveBy(-vr.location()); | 482 r.moveBy(-vr.location()); |
| 467 | 483 |
| 468 // FIXME: Hardcoded offsets here are not good. | 484 // FIXME: Hardcoded offsets here are not good. |
| 469 r.moveBy(obj->contentBoxRect().location()); | 485 r.moveBy(obj->contentBoxRect().location()); |
| 470 obj->repaintRectangle(r); | 486 obj->repaintRectangle(r); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 return viewWidth(IncludeScrollbars) / scale; | 1016 return viewWidth(IncludeScrollbars) / scale; |
| 1001 } | 1017 } |
| 1002 | 1018 |
| 1003 double RenderView::layoutViewportHeight() const | 1019 double RenderView::layoutViewportHeight() const |
| 1004 { | 1020 { |
| 1005 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 1021 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
| 1006 return viewHeight(IncludeScrollbars) / scale; | 1022 return viewHeight(IncludeScrollbars) / scale; |
| 1007 } | 1023 } |
| 1008 | 1024 |
| 1009 } // namespace WebCore | 1025 } // namespace WebCore |
| OLD | NEW |