| 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 "core/paint/ViewPainter.h" | 5 #include "core/paint/ViewPainter.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 m_layoutView.scrolledContentOffset()); | 79 m_layoutView.scrolledContentOffset()); |
| 80 } | 80 } |
| 81 | 81 |
| 82 if (DrawingRecorder::useCachedDrawingIfPossible( | 82 if (DrawingRecorder::useCachedDrawingIfPossible( |
| 83 context, *displayItemClient, DisplayItem::kDocumentBackground)) | 83 context, *displayItemClient, DisplayItem::kDocumentBackground)) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 const Document& document = m_layoutView.document(); | 86 const Document& document = m_layoutView.document(); |
| 87 const FrameView& frameView = *m_layoutView.frameView(); | 87 const FrameView& frameView = *m_layoutView.frameView(); |
| 88 bool isMainFrame = document.isInMainFrame(); | 88 bool isMainFrame = document.isInMainFrame(); |
| 89 bool paintsBaseBackground = isMainFrame && !frameView.isTransparent(); | 89 bool paintsBaseBackground = |
| 90 isMainFrame && !frameView.baseBackgroundColor().hasAlpha(); |
| 90 bool shouldClearCanvas = | 91 bool shouldClearCanvas = |
| 91 paintsBaseBackground && | 92 paintsBaseBackground && |
| 92 (document.settings() && | 93 (document.settings() && |
| 93 document.settings()->getShouldClearDocumentBackground()); | 94 document.settings()->getShouldClearDocumentBackground()); |
| 94 Color baseBackgroundColor = | 95 Color baseBackgroundColor = |
| 95 paintsBaseBackground ? frameView.baseBackgroundColor() : Color(); | 96 paintsBaseBackground ? frameView.baseBackgroundColor() : Color(); |
| 96 Color rootBackgroundColor = | 97 Color rootBackgroundColor = |
| 97 m_layoutView.style()->visitedDependentColor(CSSPropertyBackgroundColor); | 98 m_layoutView.style()->visitedDependentColor(CSSPropertyBackgroundColor); |
| 98 const LayoutObject* rootObject = | 99 const LayoutObject* rootObject = |
| 99 document.documentElement() ? document.documentElement()->layoutObject() | 100 document.documentElement() ? document.documentElement()->layoutObject() |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 LayoutRect(paintRect), BackgroundBleedNone); | 224 LayoutRect(paintRect), BackgroundBleedNone); |
| 224 context.restore(); | 225 context.restore(); |
| 225 } | 226 } |
| 226 } | 227 } |
| 227 | 228 |
| 228 if (shouldDrawBackgroundInSeparateBuffer) | 229 if (shouldDrawBackgroundInSeparateBuffer) |
| 229 context.endLayer(); | 230 context.endLayer(); |
| 230 } | 231 } |
| 231 | 232 |
| 232 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |