| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); | 268 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); |
| 269 paintInfo.context->setCompositeOperation(CompositeCopy); | 269 paintInfo.context->setCompositeOperation(CompositeCopy); |
| 270 paintInfo.context->fillRect(paintInfo.rect, baseColor); | 270 paintInfo.context->fillRect(paintInfo.rect, baseColor); |
| 271 paintInfo.context->setCompositeOperation(previousOperator); | 271 paintInfo.context->setCompositeOperation(previousOperator); |
| 272 } else { | 272 } else { |
| 273 paintInfo.context->clearRect(paintInfo.rect); | 273 paintInfo.context->clearRect(paintInfo.rect); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 void RenderView::invalidateTreeIfNeeded(const PaintInvalidationState& paintInval
idationState) | |
| 279 { | |
| 280 ASSERT(!needsLayout()); | |
| 281 | |
| 282 // We specifically need to issue paint invalidations for the viewRect since
other renderers | |
| 283 // short-circuit on full-paint invalidation. | |
| 284 LayoutRect dirtyRect = viewRect(); | |
| 285 if (doingFullPaintInvalidation() && !dirtyRect.isEmpty()) { | |
| 286 const RenderLayerModelObject* paintInvalidationContainer = &paintInvalid
ationState.paintInvalidationContainer(); | |
| 287 mapRectToPaintInvalidationBacking(paintInvalidationContainer, dirtyRect,
&paintInvalidationState); | |
| 288 } | |
| 289 RenderBlock::invalidateTreeIfNeeded(paintInvalidationState); | |
| 290 } | |
| 291 | |
| 292 void RenderView::invalidatePaintForRectangle(const LayoutRect& paintInvalidation
Rect) const | |
| 293 { | |
| 294 ASSERT(!paintInvalidationRect.isEmpty()); | |
| 295 | |
| 296 if (m_frameView) | |
| 297 m_frameView->contentRectangleForPaintInvalidation(pixelSnappedIntRect(pa
intInvalidationRect)); | |
| 298 } | |
| 299 | |
| 300 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta
te) const | 278 void RenderView::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* sta
te) const |
| 301 { | 279 { |
| 302 // Apply our transform if we have one (because of full page zooming). | 280 // Apply our transform if we have one (because of full page zooming). |
| 303 if (!paintInvalidationContainer && layer() && layer()->transform()) | 281 if (!paintInvalidationContainer && layer() && layer()->transform()) |
| 304 rect = layer()->transform()->mapRect(rect); | 282 rect = layer()->transform()->mapRect(rect); |
| 305 } | 283 } |
| 306 | 284 |
| 307 | |
| 308 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu
latedOffset) const | 285 void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumu
latedOffset) const |
| 309 { | 286 { |
| 310 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); | 287 rects.append(pixelSnappedIntRect(accumulatedOffset, layer()->size())); |
| 311 } | 288 } |
| 312 | 289 |
| 313 void RenderView::absoluteQuads(Vector<FloatQuad>& quads) const | 290 void RenderView::absoluteQuads(Vector<FloatQuad>& quads) const |
| 314 { | 291 { |
| 315 quads.append(FloatRect(FloatPoint(), layer()->size())); | 292 quads.append(FloatRect(FloatPoint(), layer()->size())); |
| 316 } | 293 } |
| 317 | 294 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 void RenderView::getSelection(RenderObject*& startRenderer, int& startOffset, Re
nderObject*& endRenderer, int& endOffset) const | 521 void RenderView::getSelection(RenderObject*& startRenderer, int& startOffset, Re
nderObject*& endRenderer, int& endOffset) const |
| 545 { | 522 { |
| 546 startRenderer = m_selectionStart; | 523 startRenderer = m_selectionStart; |
| 547 startOffset = m_selectionStartPos; | 524 startOffset = m_selectionStartPos; |
| 548 endRenderer = m_selectionEnd; | 525 endRenderer = m_selectionEnd; |
| 549 endOffset = m_selectionEndPos; | 526 endOffset = m_selectionEndPos; |
| 550 } | 527 } |
| 551 | 528 |
| 552 void RenderView::clearSelection() | 529 void RenderView::clearSelection() |
| 553 { | 530 { |
| 554 layer()->invalidatePaintForBlockSelectionGaps(); | |
| 555 setSelection(0, -1, 0, -1, PaintInvalidationNewMinusOld); | 531 setSelection(0, -1, 0, -1, PaintInvalidationNewMinusOld); |
| 556 } | 532 } |
| 557 | 533 |
| 558 void RenderView::selectionStartEnd(int& startPos, int& endPos) const | 534 void RenderView::selectionStartEnd(int& startPos, int& endPos) const |
| 559 { | 535 { |
| 560 startPos = m_selectionStartPos; | 536 startPos = m_selectionStartPos; |
| 561 endPos = m_selectionEndPos; | 537 endPos = m_selectionEndPos; |
| 562 } | 538 } |
| 563 | 539 |
| 564 LayoutRect RenderView::viewRect() const | 540 LayoutRect RenderView::viewRect() const |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 m_iframes.remove(iframe); | 656 m_iframes.remove(iframe); |
| 681 } | 657 } |
| 682 | 658 |
| 683 void RenderView::updateIFramesAfterLayout() | 659 void RenderView::updateIFramesAfterLayout() |
| 684 { | 660 { |
| 685 for (auto& iframe: m_iframes) | 661 for (auto& iframe: m_iframes) |
| 686 iframe->updateWidgetBounds(); | 662 iframe->updateWidgetBounds(); |
| 687 } | 663 } |
| 688 | 664 |
| 689 } // namespace blink | 665 } // namespace blink |
| OLD | NEW |