| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 | 401 |
| 402 void FrameView::invalidateTreeIfNeeded() | 402 void FrameView::invalidateTreeIfNeeded() |
| 403 { | 403 { |
| 404 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); | 404 lifecycle().advanceTo(DocumentLifecycle::InPaintInvalidation); |
| 405 | 405 |
| 406 ASSERT(renderView()); | 406 ASSERT(renderView()); |
| 407 RenderView& rootForPaintInvalidation = *renderView(); | 407 RenderView& rootForPaintInvalidation = *renderView(); |
| 408 ASSERT(!rootForPaintInvalidation.needsLayout()); | 408 ASSERT(!rootForPaintInvalidation.needsLayout()); |
| 409 | 409 |
| 410 TRACE_EVENT1("blink", "FrameView::invalidateTree", "root", rootForPaintInval
idation.debugName().ascii().data()); | |
| 411 | |
| 412 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); | 410 PaintInvalidationState rootPaintInvalidationState(rootForPaintInvalidation); |
| 413 | 411 |
| 414 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); | 412 rootForPaintInvalidation.invalidateTreeIfNeeded(rootPaintInvalidationState); |
| 415 | 413 |
| 416 m_doFullPaintInvalidation = false; | 414 m_doFullPaintInvalidation = false; |
| 417 #ifndef NDEBUG | 415 #ifndef NDEBUG |
| 418 renderView()->assertSubtreeClearedPaintInvalidationState(); | 416 renderView()->assertSubtreeClearedPaintInvalidationState(); |
| 419 #endif | 417 #endif |
| 420 | 418 |
| 421 if (m_frame->selection().isCaretBoundsDirty()) | |
| 422 m_frame->selection().invalidateCaretRect(); | |
| 423 | |
| 424 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); | 419 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); |
| 425 } | 420 } |
| 426 | 421 |
| 427 DocumentLifecycle& FrameView::lifecycle() const | 422 DocumentLifecycle& FrameView::lifecycle() const |
| 428 { | 423 { |
| 429 return m_frame->document()->lifecycle(); | 424 return m_frame->document()->lifecycle(); |
| 430 } | 425 } |
| 431 | 426 |
| 432 void FrameView::setMediaType(const AtomicString& mediaType) | 427 void FrameView::setMediaType(const AtomicString& mediaType) |
| 433 { | 428 { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 460 } |
| 466 | 461 |
| 467 HostWindow* FrameView::hostWindow() const | 462 HostWindow* FrameView::hostWindow() const |
| 468 { | 463 { |
| 469 Page* page = frame().page(); | 464 Page* page = frame().page(); |
| 470 if (!page) | 465 if (!page) |
| 471 return 0; | 466 return 0; |
| 472 return &page->chrome(); | 467 return &page->chrome(); |
| 473 } | 468 } |
| 474 | 469 |
| 475 void FrameView::contentRectangleForPaintInvalidation(const IntRect& r) | |
| 476 { | |
| 477 ASSERT(paintInvalidationIsAllowed()); | |
| 478 | |
| 479 IntRect paintRect = r; | |
| 480 if (clipsPaintInvalidations() && !paintsEntireContents()) | |
| 481 paintRect.intersect(visibleContentRect()); | |
| 482 if (paintRect.isEmpty()) | |
| 483 return; | |
| 484 | |
| 485 if (HostWindow* window = hostWindow()) | |
| 486 window->invalidateContentsAndRootView(contentsToWindow(paintRect)); | |
| 487 } | |
| 488 | |
| 489 void FrameView::contentsResized() | 470 void FrameView::contentsResized() |
| 490 { | 471 { |
| 491 setNeedsLayout(); | 472 setNeedsLayout(); |
| 492 } | 473 } |
| 493 | 474 |
| 494 void FrameView::scheduleRelayout() | 475 void FrameView::scheduleRelayout() |
| 495 { | 476 { |
| 496 ASSERT(m_frame->view() == this); | 477 ASSERT(m_frame->view() == this); |
| 497 | 478 |
| 498 if (isSubtreeLayout()) { | 479 if (isSubtreeLayout()) { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 totalObjects = 0; | 946 totalObjects = 0; |
| 966 | 947 |
| 967 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { | 948 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { |
| 968 ++totalObjects; | 949 ++totalObjects; |
| 969 if (o->needsLayout()) | 950 if (o->needsLayout()) |
| 970 ++needsLayoutObjects; | 951 ++needsLayoutObjects; |
| 971 } | 952 } |
| 972 } | 953 } |
| 973 | 954 |
| 974 } // namespace blink | 955 } // namespace blink |
| OLD | NEW |