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