| 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/ViewPainter.h" | 6 #include "core/paint/ViewPainter.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/paint/BlockPainter.h" | 9 #include "core/paint/BlockPainter.h" |
| 10 #include "core/paint/GraphicsContextAnnotator.h" | 10 #include "core/paint/GraphicsContextAnnotator.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (!shouldPaintBackground) | 68 if (!shouldPaintBackground) |
| 69 return; | 69 return; |
| 70 | 70 |
| 71 // This code typically only executes if the root element's visibility has be
en set to hidden, | 71 // This code typically only executes if the root element's visibility has be
en set to hidden, |
| 72 // if there is a transform on the <html>, or if there is a page scale factor
less than 1. | 72 // if there is a transform on the <html>, or if there is a page scale factor
less than 1. |
| 73 // Only fill with the base background color (typically white) if we're the r
oot document, | 73 // Only fill with the base background color (typically white) if we're the r
oot document, |
| 74 // since iframes/frames with no background in the child document should show
the parent's background. | 74 // since iframes/frames with no background in the child document should show
the parent's background. |
| 75 if (!m_renderView.frameView()->isTransparent()) { | 75 if (!m_renderView.frameView()->isTransparent()) { |
| 76 Color baseColor = m_renderView.frameView()->baseBackgroundColor(); | 76 Color baseColor = m_renderView.frameView()->baseBackgroundColor(); |
| 77 if (baseColor.alpha()) { | 77 if (baseColor.alpha()) { |
| 78 CompositeOperator previousOperator = paintInfo.context->compositeOpe
ration(); | 78 SkXfermode::Mode previousOperation = paintInfo.context->compositeOpe
ration(); |
| 79 paintInfo.context->setCompositeOperation(CompositeCopy); | 79 paintInfo.context->setCompositeOperation(SkXfermode::kSrc_Mode); |
| 80 paintInfo.context->fillRect(paintInfo.rect, baseColor); | 80 paintInfo.context->fillRect(paintInfo.rect, baseColor); |
| 81 paintInfo.context->setCompositeOperation(previousOperator); | 81 paintInfo.context->setCompositeOperation(previousOperation); |
| 82 } else { | 82 } else { |
| 83 paintInfo.context->clearRect(paintInfo.rect); | 83 paintInfo.context->clearRect(paintInfo.rect); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool ViewPainter::rootFillsViewportBackground(RenderBox* rootBox) const | 88 bool ViewPainter::rootFillsViewportBackground(RenderBox* rootBox) const |
| 89 { | 89 { |
| 90 ASSERT(rootBox); | 90 ASSERT(rootBox); |
| 91 // CSS Boxes always fill the viewport background (see paintRootBoxFillLayers
) | 91 // CSS Boxes always fill the viewport background (see paintRootBoxFillLayers
) |
| 92 if (!rootBox->isSVG()) | 92 if (!rootBox->isSVG()) |
| 93 return true; | 93 return true; |
| 94 | 94 |
| 95 return rootBox->frameRect().contains(m_renderView.frameRect()); | 95 return rootBox->frameRect().contains(m_renderView.frameRect()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |