| 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/dom/DocumentMarkerController.h" | 8 #include "core/dom/DocumentMarkerController.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/inspector/InspectorInstrumentation.h" | 10 #include "core/inspector/InspectorInstrumentation.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (m_frameView.paintBehavior() == PaintBehaviorNormal) | 120 if (m_frameView.paintBehavior() == PaintBehaviorNormal) |
| 121 document->markers().invalidateRenderedRectsForMarkersInRect(LayoutRect(r
ect)); | 121 document->markers().invalidateRenderedRectsForMarkersInRect(LayoutRect(r
ect)); |
| 122 | 122 |
| 123 if (document->printing()) | 123 if (document->printing()) |
| 124 m_frameView.setPaintBehavior(m_frameView.paintBehavior() | PaintBehavior
FlattenCompositingLayers); | 124 m_frameView.setPaintBehavior(m_frameView.paintBehavior() | PaintBehavior
FlattenCompositingLayers); |
| 125 | 125 |
| 126 ASSERT(!m_frameView.isPainting()); | 126 ASSERT(!m_frameView.isPainting()); |
| 127 m_frameView.setIsPainting(true); | 127 m_frameView.setIsPainting(true); |
| 128 | 128 |
| 129 // m_frameView.nodeToDraw() is used to draw only one element (and its descen
dants) | 129 // m_frameView.nodeToDraw() is used to draw only one element (and its descen
dants) |
| 130 LayoutObject* renderer = m_frameView.nodeToDraw() ? m_frameView.nodeToDraw()
->renderer() : 0; | 130 LayoutObject* renderer = m_frameView.nodeToDraw() ? m_frameView.nodeToDraw()
->layoutObject() : 0; |
| 131 Layer* rootLayer = layoutView->layer(); | 131 Layer* rootLayer = layoutView->layer(); |
| 132 | 132 |
| 133 #if ENABLE(ASSERT) | 133 #if ENABLE(ASSERT) |
| 134 layoutView->assertSubtreeIsLaidOut(); | 134 layoutView->assertSubtreeIsLaidOut(); |
| 135 LayoutObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>renderer()); | 135 LayoutObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer-
>layoutObject()); |
| 136 #endif | 136 #endif |
| 137 | 137 |
| 138 LayerPainter layerPainter(*rootLayer); | 138 LayerPainter layerPainter(*rootLayer); |
| 139 | 139 |
| 140 float deviceScaleFactor = blink::deviceScaleFactor(rootLayer->renderer()->fr
ame()); | 140 float deviceScaleFactor = blink::deviceScaleFactor(rootLayer->layoutObject()
->frame()); |
| 141 context->setDeviceScaleFactor(deviceScaleFactor); | 141 context->setDeviceScaleFactor(deviceScaleFactor); |
| 142 | 142 |
| 143 layerPainter.paint(context, LayoutRect(rect), m_frameView.paintBehavior(), r
enderer); | 143 layerPainter.paint(context, LayoutRect(rect), m_frameView.paintBehavior(), r
enderer); |
| 144 | 144 |
| 145 if (rootLayer->containsDirtyOverlayScrollbars()) | 145 if (rootLayer->containsDirtyOverlayScrollbars()) |
| 146 layerPainter.paintOverlayScrollbars(context, LayoutRect(rect), m_frameVi
ew.paintBehavior(), renderer); | 146 layerPainter.paintOverlayScrollbars(context, LayoutRect(rect), m_frameVi
ew.paintBehavior(), renderer); |
| 147 | 147 |
| 148 m_frameView.setIsPainting(false); | 148 m_frameView.setIsPainting(false); |
| 149 | 149 |
| 150 m_frameView.setPaintBehavior(oldPaintBehavior); | 150 m_frameView.setPaintBehavior(oldPaintBehavior); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 228 { |
| 229 IntRect horizontalOverhangRect; | 229 IntRect horizontalOverhangRect; |
| 230 IntRect verticalOverhangRect; | 230 IntRect verticalOverhangRect; |
| 231 m_frameView.calculateOverhangAreasForPainting(horizontalOverhangRect, vertic
alOverhangRect); | 231 m_frameView.calculateOverhangAreasForPainting(horizontalOverhangRect, vertic
alOverhangRect); |
| 232 | 232 |
| 233 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) | 233 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) |
| 234 paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect
, dirtyRect); | 234 paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect
, dirtyRect); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |