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 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #endif | 56 #endif |
57 | 57 |
58 namespace WebCore { | 58 namespace WebCore { |
59 | 59 |
60 using namespace HTMLNames; | 60 using namespace HTMLNames; |
61 | 61 |
62 double FrameView::sCurrentPaintTimeStamp = 0.0; | 62 double FrameView::sCurrentPaintTimeStamp = 0.0; |
63 | 63 |
64 struct ScheduledEvent { | 64 struct ScheduledEvent { |
65 RefPtr<Event> m_event; | 65 RefPtr<Event> m_event; |
66 RefPtr<Node> m_eventTarget; | 66 RefPtr<EventTargetNode> m_eventTarget; |
67 }; | 67 }; |
68 | 68 |
69 FrameView::FrameView(Frame* frame) | 69 FrameView::FrameView(Frame* frame) |
70 : m_refCount(1) | 70 : m_refCount(1) |
71 , m_frame(frame) | 71 , m_frame(frame) |
72 , m_vmode(ScrollbarAuto) | 72 , m_vmode(ScrollbarAuto) |
73 , m_hmode(ScrollbarAuto) | 73 , m_hmode(ScrollbarAuto) |
74 , m_slowRepaintObjectCount(0) | 74 , m_slowRepaintObjectCount(0) |
75 , m_layoutTimer(this, &FrameView::layoutTimerFired) | 75 , m_layoutTimer(this, &FrameView::layoutTimerFired) |
76 , m_layoutRoot(0) | 76 , m_layoutRoot(0) |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 m_viewportRenderer = o; | 367 m_viewportRenderer = o; |
368 } | 368 } |
369 | 369 |
370 #if USE(ACCELERATED_COMPOSITING) | 370 #if USE(ACCELERATED_COMPOSITING) |
371 void FrameView::updateCompositingLayers(CompositingUpdate updateType) | 371 void FrameView::updateCompositingLayers(CompositingUpdate updateType) |
372 { | 372 { |
373 RenderView* view = m_frame->contentRenderer(); | 373 RenderView* view = m_frame->contentRenderer(); |
374 if (!view || !view->usesCompositing()) | 374 if (!view || !view->usesCompositing()) |
375 return; | 375 return; |
376 | 376 |
377 if (updateType == ForcedCompositingUpdate) | 377 if (updateType == ForcedUpdate) |
378 view->compositor()->setCompositingLayersNeedUpdate(); | 378 view->compositor()->setCompositingLayersNeedUpdate(); |
379 | 379 |
380 view->compositor()->updateCompositingLayers(); | 380 view->compositor()->updateCompositingLayers(); |
381 } | 381 } |
382 | 382 |
383 void FrameView::setNeedsOneShotDrawingSynchronization() | 383 void FrameView::setNeedsOneShotDrawingSynchronization() |
384 { | 384 { |
385 Page* page = frame() ? frame()->page() : 0; | 385 Page* page = frame() ? frame()->page() : 0; |
386 if (page) | 386 if (page) |
387 page->chrome()->client()->setNeedsOneShotDrawingSynchronization(); | 387 page->chrome()->client()->setNeedsOneShotDrawingSynchronization(); |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 bool FrameView::shouldUpdateWhileOffscreen() const | 927 bool FrameView::shouldUpdateWhileOffscreen() const |
928 { | 928 { |
929 return m_shouldUpdateWhileOffscreen; | 929 return m_shouldUpdateWhileOffscreen; |
930 } | 930 } |
931 | 931 |
932 void FrameView::setShouldUpdateWhileOffscreen(bool shouldUpdateWhileOffscreen) | 932 void FrameView::setShouldUpdateWhileOffscreen(bool shouldUpdateWhileOffscreen) |
933 { | 933 { |
934 m_shouldUpdateWhileOffscreen = shouldUpdateWhileOffscreen; | 934 m_shouldUpdateWhileOffscreen = shouldUpdateWhileOffscreen; |
935 } | 935 } |
936 | 936 |
937 void FrameView::scheduleEvent(PassRefPtr<Event> event, PassRefPtr<Node> eventTar
get) | 937 void FrameView::scheduleEvent(PassRefPtr<Event> event, PassRefPtr<EventTargetNod
e> eventTarget) |
938 { | 938 { |
939 if (!m_enqueueEvents) { | 939 if (!m_enqueueEvents) { |
940 ExceptionCode ec = 0; | 940 ExceptionCode ec = 0; |
941 eventTarget->dispatchEvent(event, ec); | 941 eventTarget->dispatchEvent(event, ec); |
942 return; | 942 return; |
943 } | 943 } |
944 | 944 |
945 ScheduledEvent* scheduledEvent = new ScheduledEvent; | 945 ScheduledEvent* scheduledEvent = new ScheduledEvent; |
946 scheduledEvent->m_event = event; | 946 scheduledEvent->m_event = event; |
947 scheduledEvent->m_eventTarget = eventTarget; | 947 scheduledEvent->m_eventTarget = eventTarget; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 | 1025 |
1026 bool horizontalOverflowChanged = (m_horizontalOverflow != horizontalOverflow
); | 1026 bool horizontalOverflowChanged = (m_horizontalOverflow != horizontalOverflow
); |
1027 bool verticalOverflowChanged = (m_verticalOverflow != verticalOverflow); | 1027 bool verticalOverflowChanged = (m_verticalOverflow != verticalOverflow); |
1028 | 1028 |
1029 if (horizontalOverflowChanged || verticalOverflowChanged) { | 1029 if (horizontalOverflowChanged || verticalOverflowChanged) { |
1030 m_horizontalOverflow = horizontalOverflow; | 1030 m_horizontalOverflow = horizontalOverflow; |
1031 m_verticalOverflow = verticalOverflow; | 1031 m_verticalOverflow = verticalOverflow; |
1032 | 1032 |
1033 scheduleEvent(OverflowEvent::create(horizontalOverflowChanged, horizonta
lOverflow, | 1033 scheduleEvent(OverflowEvent::create(horizontalOverflowChanged, horizonta
lOverflow, |
1034 verticalOverflowChanged, verticalOverflow), | 1034 verticalOverflowChanged, verticalOverflow), |
1035 m_viewportRenderer->element()); | 1035 EventTargetNodeCast(m_viewportRenderer->element())); |
1036 } | 1036 } |
1037 | 1037 |
1038 } | 1038 } |
1039 | 1039 |
1040 void FrameView::dispatchScheduledEvents() | 1040 void FrameView::dispatchScheduledEvents() |
1041 { | 1041 { |
1042 if (m_scheduledEvents.isEmpty()) | 1042 if (m_scheduledEvents.isEmpty()) |
1043 return; | 1043 return; |
1044 | 1044 |
1045 Vector<ScheduledEvent*> scheduledEventsCopy = m_scheduledEvents; | 1045 Vector<ScheduledEvent*> scheduledEventsCopy = m_scheduledEvents; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 IntRect dirtyRect(0, (int)floorf(oldTop), root->docWidth(), (int)ceilf(o
ldBottom - oldTop)); | 1332 IntRect dirtyRect(0, (int)floorf(oldTop), root->docWidth(), (int)ceilf(o
ldBottom - oldTop)); |
1333 root->layer()->paint(&context, dirtyRect); | 1333 root->layer()->paint(&context, dirtyRect); |
1334 *newBottom = root->bestTruncatedAt(); | 1334 *newBottom = root->bestTruncatedAt(); |
1335 if (*newBottom == 0) | 1335 if (*newBottom == 0) |
1336 *newBottom = oldBottom; | 1336 *newBottom = oldBottom; |
1337 } else | 1337 } else |
1338 *newBottom = oldBottom; | 1338 *newBottom = oldBottom; |
1339 } | 1339 } |
1340 | 1340 |
1341 } // namespace WebCore | 1341 } // namespace WebCore |
OLD | NEW |