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

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

Issue 2489893002: [SPv2] Track paint offset change (Closed)
Patch Set: - Created 4 years, 1 month 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/PartPainter.h" 5 #include "core/paint/PartPainter.h"
6 6
7 #include "core/layout/LayoutPart.h" 7 #include "core/layout/LayoutPart.h"
8 #include "core/paint/BoxPainter.h" 8 #include "core/paint/BoxPainter.h"
9 #include "core/paint/LayoutObjectDrawingRecorder.h" 9 #include "core/paint/LayoutObjectDrawingRecorder.h"
10 #include "core/paint/ObjectPainter.h" 10 #include "core/paint/ObjectPainter.h"
(...skipping 26 matching lines...) Expand all
37 return selectionEnd == end; 37 return selectionEnd == end;
38 if (s == SelectionBoth) 38 if (s == SelectionBoth)
39 return selectionStart == 0 && selectionEnd == end; 39 return selectionStart == 0 && selectionEnd == end;
40 40
41 DCHECK(0); 41 DCHECK(0);
42 return false; 42 return false;
43 } 43 }
44 44
45 void PartPainter::paint(const PaintInfo& paintInfo, 45 void PartPainter::paint(const PaintInfo& paintInfo,
46 const LayoutPoint& paintOffset) { 46 const LayoutPoint& paintOffset) {
47 ObjectPainter(m_layoutPart).checkPaintOffset(paintInfo, paintOffset);
47 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); 48 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location();
48 if (!ReplacedPainter(m_layoutPart) 49 if (!ReplacedPainter(m_layoutPart)
49 .shouldPaint(paintInfo, adjustedPaintOffset)) 50 .shouldPaint(paintInfo, adjustedPaintOffset))
50 return; 51 return;
51 52
52 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); 53 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size());
53 54
54 if (m_layoutPart.hasBoxDecorationBackground() && 55 if (m_layoutPart.hasBoxDecorationBackground() &&
55 (paintInfo.phase == PaintPhaseForeground || 56 (paintInfo.phase == PaintPhaseForeground ||
56 paintInfo.phase == PaintPhaseSelection)) 57 paintInfo.phase == PaintPhaseSelection))
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 IntSize widgetPaintOffset = paintLocation - widget->frameRect().location(); 131 IntSize widgetPaintOffset = paintLocation - widget->frameRect().location();
131 TransformRecorder transform( 132 TransformRecorder transform(
132 paintInfo.context, m_layoutPart, 133 paintInfo.context, m_layoutPart,
133 AffineTransform::translation(widgetPaintOffset.width(), 134 AffineTransform::translation(widgetPaintOffset.width(),
134 widgetPaintOffset.height())); 135 widgetPaintOffset.height()));
135 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset); 136 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset);
136 widget->paint(paintInfo.context, adjustedCullRect); 137 widget->paint(paintInfo.context, adjustedCullRect);
137 } 138 }
138 139
139 } // namespace blink 140 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.cpp ('k') | third_party/WebKit/Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698