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 26 matching lines...) Expand all Loading... |
37 #include "core/paint/PaintLayer.h" | 37 #include "core/paint/PaintLayer.h" |
38 #include "core/paint/ViewPainter.h" | 38 #include "core/paint/ViewPainter.h" |
39 #include "core/svg/SVGDocumentExtensions.h" | 39 #include "core/svg/SVGDocumentExtensions.h" |
40 #include "platform/Histogram.h" | 40 #include "platform/Histogram.h" |
41 #include "platform/TraceEvent.h" | 41 #include "platform/TraceEvent.h" |
42 #include "platform/TracedValue.h" | 42 #include "platform/TracedValue.h" |
43 #include "platform/geometry/FloatQuad.h" | 43 #include "platform/geometry/FloatQuad.h" |
44 #include "platform/geometry/TransformState.h" | 44 #include "platform/geometry/TransformState.h" |
45 #include "platform/graphics/paint/PaintController.h" | 45 #include "platform/graphics/paint/PaintController.h" |
46 #include "public/platform/Platform.h" | 46 #include "public/platform/Platform.h" |
| 47 #include "wtf/PtrUtil.h" |
47 #include <inttypes.h> | 48 #include <inttypes.h> |
48 | 49 |
49 namespace blink { | 50 namespace blink { |
50 | 51 |
51 namespace { | 52 namespace { |
52 | 53 |
53 class HitTestLatencyRecorder { | 54 class HitTestLatencyRecorder { |
54 public: | 55 public: |
55 HitTestLatencyRecorder(bool allowsChildFrameContent) | 56 HitTestLatencyRecorder(bool allowsChildFrameContent) |
56 : m_start(WTF::monotonicallyIncreasingTime()) | 57 : m_start(WTF::monotonicallyIncreasingTime()) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 237 } |
237 | 238 |
238 void LayoutView::layout() | 239 void LayoutView::layout() |
239 { | 240 { |
240 if (!document().paginated()) | 241 if (!document().paginated()) |
241 setPageLogicalHeight(LayoutUnit()); | 242 setPageLogicalHeight(LayoutUnit()); |
242 | 243 |
243 if (pageLogicalHeight() && shouldUsePrintingLayout()) { | 244 if (pageLogicalHeight() && shouldUsePrintingLayout()) { |
244 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; | 245 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth()
; |
245 if (!m_fragmentationContext) | 246 if (!m_fragmentationContext) |
246 m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this
)); | 247 m_fragmentationContext = wrapUnique(new ViewFragmentationContext(*th
is)); |
247 } else if (m_fragmentationContext) { | 248 } else if (m_fragmentationContext) { |
248 m_fragmentationContext.reset(); | 249 m_fragmentationContext.reset(); |
249 } | 250 } |
250 | 251 |
251 SubtreeLayoutScope layoutScope(*this); | 252 SubtreeLayoutScope layoutScope(*this); |
252 | 253 |
253 LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); | 254 LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); |
254 | 255 |
255 // Use calcWidth/Height to get the new width/height, since this will take th
e full page zoom factor into account. | 256 // Use calcWidth/Height to get the new width/height, since this will take th
e full page zoom factor into account. |
256 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView | 257 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 } | 946 } |
946 | 947 |
947 bool LayoutView::usesCompositing() const | 948 bool LayoutView::usesCompositing() const |
948 { | 949 { |
949 return m_compositor && m_compositor->staleInCompositingMode(); | 950 return m_compositor && m_compositor->staleInCompositingMode(); |
950 } | 951 } |
951 | 952 |
952 PaintLayerCompositor* LayoutView::compositor() | 953 PaintLayerCompositor* LayoutView::compositor() |
953 { | 954 { |
954 if (!m_compositor) | 955 if (!m_compositor) |
955 m_compositor = adoptPtr(new PaintLayerCompositor(*this)); | 956 m_compositor = wrapUnique(new PaintLayerCompositor(*this)); |
956 | 957 |
957 return m_compositor.get(); | 958 return m_compositor.get(); |
958 } | 959 } |
959 | 960 |
960 void LayoutView::setIsInWindow(bool isInWindow) | 961 void LayoutView::setIsInWindow(bool isInWindow) |
961 { | 962 { |
962 if (m_compositor) | 963 if (m_compositor) |
963 m_compositor->setIsInWindow(isInWindow); | 964 m_compositor->setIsInWindow(isInWindow); |
964 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 965 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
965 // We don't invalidate layers during document detach(), so must clear the sh
ould-keep-alive | 966 // We don't invalidate layers during document detach(), so must clear the sh
ould-keep-alive |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 // ASSERT(!frame()->isMainFrame()) here. All main frame scrolling should | 1043 // ASSERT(!frame()->isMainFrame()) here. All main frame scrolling should |
1043 // be handled by the ViewportScrollCallback. | 1044 // be handled by the ViewportScrollCallback. |
1044 | 1045 |
1045 if (!frameView()) | 1046 if (!frameView()) |
1046 return ScrollResult(false, false, delta.width(), delta.height()); | 1047 return ScrollResult(false, false, delta.width(), delta.height()); |
1047 | 1048 |
1048 return frameView()->getScrollableArea()->userScroll(granularity, delta); | 1049 return frameView()->getScrollableArea()->userScroll(granularity, delta); |
1049 } | 1050 } |
1050 | 1051 |
1051 } // namespace blink | 1052 } // namespace blink |
OLD | NEW |