Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: Source/core/paint/ViewPainter.cpp

Issue 1316163002: Make the LayoutRect->FloatRect constructor explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutBox.h" 10 #include "core/layout/LayoutBox.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 IntRect documentRect = m_layoutView.unscaledDocumentRect(); 55 IntRect documentRect = m_layoutView.unscaledDocumentRect();
56 const Document& document = m_layoutView.document(); 56 const Document& document = m_layoutView.document();
57 const FrameView& frameView = *m_layoutView.frameView(); 57 const FrameView& frameView = *m_layoutView.frameView();
58 bool isMainFrame = !document.ownerElement(); 58 bool isMainFrame = !document.ownerElement();
59 bool paintsBaseBackground = isMainFrame && !frameView.isTransparent(); 59 bool paintsBaseBackground = isMainFrame && !frameView.isTransparent();
60 bool shouldClearCanvas = paintsBaseBackground && (document.settings() && doc ument.settings()->shouldClearDocumentBackground()); 60 bool shouldClearCanvas = paintsBaseBackground && (document.settings() && doc ument.settings()->shouldClearDocumentBackground());
61 Color baseBackgroundColor = paintsBaseBackground ? frameView.baseBackgroundC olor() : Color(); 61 Color baseBackgroundColor = paintsBaseBackground ? frameView.baseBackgroundC olor() : Color();
62 Color rootBackgroundColor = m_layoutView.style()->visitedDependentColor(CSSP ropertyBackgroundColor); 62 Color rootBackgroundColor = m_layoutView.style()->visitedDependentColor(CSSP ropertyBackgroundColor);
63 const LayoutObject* rootObject = document.documentElement() ? document.docum entElement()->layoutObject() : nullptr; 63 const LayoutObject* rootObject = document.documentElement() ? document.docum entElement()->layoutObject() : nullptr;
64 64
65 LayoutObjectDrawingRecorder recorder(context, m_layoutView, DisplayItem::Box DecorationBackground, documentRect); 65 LayoutObjectDrawingRecorder recorder(context, m_layoutView, DisplayItem::Box DecorationBackground, LayoutRect(documentRect));
jbroman 2015/08/26 21:45:09 ditto
chrishtr 2015/08/26 22:32:21 Done
66 66
67 // Special handling for print economy mode. 67 // Special handling for print economy mode.
68 bool forceBackgroundToWhite = BoxPainter::shouldForceWhiteBackgroundForPrint Economy(m_layoutView.styleRef(), document); 68 bool forceBackgroundToWhite = BoxPainter::shouldForceWhiteBackgroundForPrint Economy(m_layoutView.styleRef(), document);
69 if (forceBackgroundToWhite) { 69 if (forceBackgroundToWhite) {
70 // If for any reason the view background is not transparent, paint white instead, otherwise keep transparent as is. 70 // If for any reason the view background is not transparent, paint white instead, otherwise keep transparent as is.
71 if (paintsBaseBackground || rootBackgroundColor.alpha() || m_layoutView. style()->backgroundLayers().image()) 71 if (paintsBaseBackground || rootBackgroundColor.alpha() || m_layoutView. style()->backgroundLayers().image())
72 context.fillRect(documentRect, Color::white, SkXfermode::kSrc_Mode); 72 context.fillRect(documentRect, Color::white, SkXfermode::kSrc_Mode);
73 return; 73 return;
74 } 74 }
75 75
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ASSERT((*it)->clip() == BorderFillBox); 141 ASSERT((*it)->clip() == BorderFillBox);
142 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i t, LayoutRect(paintRect), BackgroundBleedNone); 142 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **i t, LayoutRect(paintRect), BackgroundBleedNone);
143 } 143 }
144 context.restore(); 144 context.restore();
145 145
146 if (shouldDrawBackgroundInSeparateBuffer) 146 if (shouldDrawBackgroundInSeparateBuffer)
147 context.endLayer(); 147 context.endLayer();
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698