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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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
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 "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"
11 #include "core/paint/BlockPainter.h" 11 #include "core/paint/BlockPainter.h"
12 #include "core/paint/BoxPainter.h" 12 #include "core/paint/BoxPainter.h"
13 #include "core/paint/LayoutObjectDrawingRecorder.h" 13 #include "core/paint/LayoutObjectDrawingRecorder.h"
14 #include "core/paint/PaintInfo.h" 14 #include "core/paint/PaintInfo.h"
15 #include "core/paint/PaintLayer.h" 15 #include "core/paint/PaintLayer.h"
16 #include "platform/RuntimeEnabledFeatures.h" 16 #include "platform/RuntimeEnabledFeatures.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs et) 20 void ViewPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs et)
21 { 21 {
22 // If we ever require layout but receive a paint anyway, something has gone horribly wrong. 22 // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
23 ASSERT(!m_layoutView.needsLayout()); 23 DCHECK(!m_layoutView.needsLayout());
24 // LayoutViews should never be called to paint with an offset not on device pixels. 24 // LayoutViews should never be called to paint with an offset not on device pixels.
25 ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) == paintOffse t); 25 DCHECK(LayoutPoint(IntPoint(paintOffset.x().toInt(), paintOffset.y().toInt() )) == paintOffset);
26 26
27 const FrameView* frameView = m_layoutView.frameView(); 27 const FrameView* frameView = m_layoutView.frameView();
28 if (frameView->shouldThrottleRendering()) 28 if (frameView->shouldThrottleRendering())
29 return; 29 return;
30 30
31 m_layoutView.paintObject(paintInfo, paintOffset); 31 m_layoutView.paintObject(paintInfo, paintOffset);
32 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set); 32 BlockPainter(m_layoutView).paintOverflowControlsIfNeeded(paintInfo, paintOff set);
33 } 33 }
34 34
35 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) 35 void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L ayoutRect(paintRect), BackgroundBleedNone); 151 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L ayoutRect(paintRect), BackgroundBleedNone);
152 context.restore(); 152 context.restore();
153 } 153 }
154 } 154 }
155 155
156 if (shouldDrawBackgroundInSeparateBuffer) 156 if (shouldDrawBackgroundInSeparateBuffer)
157 context.endLayer(); 157 context.endLayer();
158 } 158 }
159 159
160 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ThemePainterDefault.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698