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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 m_pageLogicalHeightChanged = false; | 253 m_pageLogicalHeightChanged = false; |
254 | 254 |
255 layoutContent(); | 255 layoutContent(); |
256 | 256 |
257 #ifndef NDEBUG | 257 #ifndef NDEBUG |
258 checkLayoutState(); | 258 checkLayoutState(); |
259 #endif | 259 #endif |
260 clearNeedsLayout(); | 260 clearNeedsLayout(); |
261 } | 261 } |
262 | 262 |
263 void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) c
onst | 263 void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContai
ner, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed, c
onst PaintInvalidationState* paintInvalidationState) const |
264 { | 264 { |
265 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I
sFixed)); | 265 ASSERT_UNUSED(wasFixed, !wasFixed || *wasFixed == static_cast<bool>(mode & I
sFixed)); |
266 | 266 |
267 if (!repaintContainer && mode & UseTransforms && shouldUseTransformFromConta
iner(0)) { | 267 if (!repaintContainer && mode & UseTransforms && shouldUseTransformFromConta
iner(0)) { |
268 TransformationMatrix t; | 268 TransformationMatrix t; |
269 getTransformFromContainer(0, LayoutSize(), t); | 269 getTransformFromContainer(0, LayoutSize(), t); |
270 transformState.applyTransform(t); | 270 transformState.applyTransform(t); |
271 } | 271 } |
272 | 272 |
273 if (mode & IsFixed && m_frameView) | 273 if (mode & IsFixed && m_frameView) |
274 transformState.move(m_frameView->scrollOffsetForFixedPosition()); | 274 transformState.move(m_frameView->scrollOffsetForFixedPosition()); |
275 | 275 |
276 if (repaintContainer == this) | 276 if (repaintContainer == this) |
277 return; | 277 return; |
278 | 278 |
279 if (mode & TraverseDocumentBoundaries) { | 279 if (mode & TraverseDocumentBoundaries) { |
280 if (RenderObject* parentDocRenderer = frame()->ownerRenderer()) { | 280 if (RenderObject* parentDocRenderer = frame()->ownerRenderer()) { |
281 transformState.move(-frame()->view()->scrollOffset()); | 281 transformState.move(-frame()->view()->scrollOffset()); |
282 if (parentDocRenderer->isBox()) | 282 if (parentDocRenderer->isBox()) |
283 transformState.move(toLayoutSize(toRenderBox(parentDocRenderer)-
>contentBoxRect().location())); | 283 transformState.move(toLayoutSize(toRenderBox(parentDocRenderer)-
>contentBoxRect().location())); |
284 parentDocRenderer->mapLocalToContainer(repaintContainer, transformSt
ate, mode, wasFixed); | 284 parentDocRenderer->mapLocalToContainer(repaintContainer, transformSt
ate, mode, wasFixed, paintInvalidationState); |
285 return; | 285 return; |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 // If a container was specified, and was not 0 or the RenderView, | 289 // If a container was specified, and was not 0 or the RenderView, |
290 // then we should have found it by now. | 290 // then we should have found it by now. |
291 ASSERT_ARG(repaintContainer, !repaintContainer); | 291 ASSERT_ARG(repaintContainer, !repaintContainer); |
292 } | 292 } |
293 | 293 |
294 const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 294 const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObj
ect* ancestorToStopAt, RenderGeometryMap& geometryMap) const |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); | 437 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); |
438 paintInfo.context->setCompositeOperation(CompositeCopy); | 438 paintInfo.context->setCompositeOperation(CompositeCopy); |
439 paintInfo.context->fillRect(paintInfo.rect, baseColor); | 439 paintInfo.context->fillRect(paintInfo.rect, baseColor); |
440 paintInfo.context->setCompositeOperation(previousOperator); | 440 paintInfo.context->setCompositeOperation(previousOperator); |
441 } else { | 441 } else { |
442 paintInfo.context->clearRect(paintInfo.rect); | 442 paintInfo.context->clearRect(paintInfo.rect); |
443 } | 443 } |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
447 void RenderView::invalidateTreeAfterLayout(const RenderLayerModelObject& paintIn
validationContainer) | 447 void RenderView::invalidateTreeAfterLayout(const PaintInvalidationState& paintIn
validationState) |
448 { | 448 { |
449 ASSERT(!needsLayout()); | 449 ASSERT(!needsLayout()); |
450 | 450 |
451 // We specifically need to repaint the viewRect since other renderers | 451 // We specifically need to repaint the viewRect since other renderers |
452 // short-circuit on full-repaint. | 452 // short-circuit on full-repaint. |
453 if (doingFullRepaint() && !viewRect().isEmpty()) | 453 if (doingFullRepaint() && !viewRect().isEmpty()) |
454 repaintViewRectangle(viewRect()); | 454 repaintViewRectangle(viewRect()); |
455 | 455 |
456 LayoutState rootLayoutState(0, false, *this); | 456 RenderBlock::invalidateTreeAfterLayout(paintInvalidationState); |
457 RenderBlock::invalidateTreeAfterLayout(paintInvalidationContainer); | |
458 } | 457 } |
459 | 458 |
460 void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const | 459 void RenderView::repaintViewRectangle(const LayoutRect& repaintRect) const |
461 { | 460 { |
462 ASSERT(!repaintRect.isEmpty()); | 461 ASSERT(!repaintRect.isEmpty()); |
463 | 462 |
464 if (document().printing() || !m_frameView) | 463 if (document().printing() || !m_frameView) |
465 return; | 464 return; |
466 | 465 |
467 // We always just invalidate the root view, since we could be an iframe that
is clipped out | 466 // We always just invalidate the root view, since we could be an iframe that
is clipped out |
(...skipping 21 matching lines...) Expand all Loading... |
489 { | 488 { |
490 paintInvalidationForWholeRenderer(); | 489 paintInvalidationForWholeRenderer(); |
491 | 490 |
492 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. | 491 // The only way we know how to hit these ASSERTS below this point is via the
Chromium OS login screen. |
493 DisableCompositingQueryAsserts disabler; | 492 DisableCompositingQueryAsserts disabler; |
494 | 493 |
495 if (compositor()->inCompositingMode()) | 494 if (compositor()->inCompositingMode()) |
496 compositor()->repaintCompositedLayers(); | 495 compositor()->repaintCompositedLayers(); |
497 } | 496 } |
498 | 497 |
499 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed) const | 498 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalidati
onState* paintInvalidationState) const |
500 { | 499 { |
501 // If a container was specified, and was not 0 or the RenderView, | 500 // If a container was specified, and was not 0 or the RenderView, |
502 // then we should have found it by now. | 501 // then we should have found it by now. |
503 ASSERT_ARG(paintInvalidationContainer, !paintInvalidationContainer || paintI
nvalidationContainer == this); | 502 ASSERT_ARG(paintInvalidationContainer, !paintInvalidationContainer || paintI
nvalidationContainer == this); |
504 | 503 |
505 if (document().printing()) | 504 if (document().printing()) |
506 return; | 505 return; |
507 | 506 |
508 if (style()->isFlippedBlocksWritingMode()) { | 507 if (style()->isFlippedBlocksWritingMode()) { |
509 // We have to flip by hand since the view's logical height has not been
determined. We | 508 // We have to flip by hand since the view's logical height has not been
determined. We |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 return viewWidth(IncludeScrollbars) / scale; | 993 return viewWidth(IncludeScrollbars) / scale; |
995 } | 994 } |
996 | 995 |
997 double RenderView::layoutViewportHeight() const | 996 double RenderView::layoutViewportHeight() const |
998 { | 997 { |
999 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; | 998 float scale = m_frameView ? m_frameView->frame().pageZoomFactor() : 1; |
1000 return viewHeight(IncludeScrollbars) / scale; | 999 return viewHeight(IncludeScrollbars) / scale; |
1001 } | 1000 } |
1002 | 1001 |
1003 } // namespace WebCore | 1002 } // namespace WebCore |
OLD | NEW |