OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/FramePainter.h" | 6 #include "core/paint/FramePainter.h" |
7 | 7 |
8 #include "core/editing/markers/DocumentMarkerController.h" | 8 #include "core/editing/markers/DocumentMarkerController.h" |
9 #include "core/fetch/MemoryCache.h" | 9 #include "core/fetch/MemoryCache.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 #if ENABLE(ASSERT) | 118 #if ENABLE(ASSERT) |
119 layoutView->assertSubtreeIsLaidOut(); | 119 layoutView->assertSubtreeIsLaidOut(); |
120 LayoutObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>layoutObject()); | 120 LayoutObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>layoutObject()); |
121 #endif | 121 #endif |
122 | 122 |
123 PaintLayerPainter layerPainter(*rootLayer); | 123 PaintLayerPainter layerPainter(*rootLayer); |
124 | 124 |
125 float deviceScaleFactor = blink::deviceScaleFactor(rootLayer->layoutObject()
->frame()); | 125 float deviceScaleFactor = blink::deviceScaleFactor(rootLayer->layoutObject()
->frame()); |
126 context.setDeviceScaleFactor(deviceScaleFactor); | 126 context.setDeviceScaleFactor(deviceScaleFactor); |
127 | 127 |
128 layerPainter.paint(&context, LayoutRect(rect), localPaintFlags, layoutObject
); | 128 layerPainter.paint(context, LayoutRect(rect), localPaintFlags, layoutObject)
; |
129 | 129 |
130 if (rootLayer->containsDirtyOverlayScrollbars()) | 130 if (rootLayer->containsDirtyOverlayScrollbars()) |
131 layerPainter.paintOverlayScrollbars(&context, LayoutRect(rect), localPai
ntFlags, layoutObject); | 131 layerPainter.paintOverlayScrollbars(context, LayoutRect(rect), localPain
tFlags, layoutObject); |
132 | 132 |
133 frameView().setIsPainting(false); | 133 frameView().setIsPainting(false); |
134 | 134 |
135 // Regions may have changed as a result of the visibility/z-index of element
changing. | 135 // Regions may have changed as a result of the visibility/z-index of element
changing. |
136 if (document->annotatedRegionsDirty()) | 136 if (document->annotatedRegionsDirty()) |
137 frameView().updateDocumentAnnotatedRegions(); | 137 frameView().updateDocumentAnnotatedRegions(); |
138 | 138 |
139 if (isTopLevelPainter) { | 139 if (isTopLevelPainter) { |
140 // Everything that happens after paintContents completions is considered | 140 // Everything that happens after paintContents completions is considered |
141 // to be part of the next frame. | 141 // to be part of the next frame. |
142 memoryCache()->updateFramePaintTimestamp(); | 142 memoryCache()->updateFramePaintTimestamp(); |
143 s_inPaintContents = false; | 143 s_inPaintContents = false; |
144 } | 144 } |
145 | 145 |
146 InspectorInstrumentation::didPaint(layoutView, 0, &context, LayoutRect(rect)
); | 146 InspectorInstrumentation::didPaint(layoutView, 0, context, LayoutRect(rect))
; |
147 } | 147 } |
148 | 148 |
149 void FramePainter::paintScrollbars(GraphicsContext& context, const IntRect& rect
) | 149 void FramePainter::paintScrollbars(GraphicsContext& context, const IntRect& rect
) |
150 { | 150 { |
151 if (frameView().horizontalScrollbar() && !frameView().layerForHorizontalScro
llbar()) | 151 if (frameView().horizontalScrollbar() && !frameView().layerForHorizontalScro
llbar()) |
152 paintScrollbar(context, *frameView().horizontalScrollbar(), rect); | 152 paintScrollbar(context, *frameView().horizontalScrollbar(), rect); |
153 if (frameView().verticalScrollbar() && !frameView().layerForVerticalScrollba
r()) | 153 if (frameView().verticalScrollbar() && !frameView().layerForVerticalScrollba
r()) |
154 paintScrollbar(context, *frameView().verticalScrollbar(), rect); | 154 paintScrollbar(context, *frameView().verticalScrollbar(), rect); |
155 | 155 |
156 if (frameView().layerForScrollCorner()) | 156 if (frameView().layerForScrollCorner()) |
(...skipping 30 matching lines...) Expand all Loading... |
187 bar.paint(context, CullRect(rect)); | 187 bar.paint(context, CullRect(rect)); |
188 } | 188 } |
189 | 189 |
190 const FrameView& FramePainter::frameView() | 190 const FrameView& FramePainter::frameView() |
191 { | 191 { |
192 ASSERT(m_frameView); | 192 ASSERT(m_frameView); |
193 return *m_frameView; | 193 return *m_frameView; |
194 } | 194 } |
195 | 195 |
196 } // namespace blink | 196 } // namespace blink |
OLD | NEW |