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

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

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase more (world moved in the past hour) 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
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/PartPainter.h" 6 #include "core/paint/PartPainter.h"
7 7
8 #include "core/layout/LayoutPart.h" 8 #include "core/layout/LayoutPart.h"
9 #include "core/paint/BoxPainter.h" 9 #include "core/paint/BoxPainter.h"
10 #include "core/paint/DeprecatedPaintLayer.h" 10 #include "core/paint/DeprecatedPaintLayer.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())), 53 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())),
54 true, true); 54 true, true);
55 clipper.emplace(m_layoutPart, paintInfo, borderRect, roundedInnerRec t, ApplyToDisplayListIfEnabled); 55 clipper.emplace(m_layoutPart, paintInfo, borderRect, roundedInnerRec t, ApplyToDisplayListIfEnabled);
56 } 56 }
57 57
58 if (m_layoutPart.widget()) 58 if (m_layoutPart.widget())
59 m_layoutPart.paintContents(paintInfo, paintOffset); 59 m_layoutPart.paintContents(paintInfo, paintOffset);
60 } 60 }
61 61
62 // Paint a partially transparent wash over selected widgets. 62 // Paint a partially transparent wash over selected widgets.
63 if (m_layoutPart.isSelected() && !paintInfo.isPrinting() && !LayoutObjectDra wingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutPart, paint Info.phase)) { 63 if (m_layoutPart.isSelected() && !paintInfo.isPrinting() && !LayoutObjectDra wingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutPart, paint Info.phase, adjustedPaintOffset)) {
64 LayoutRect rect = m_layoutPart.localSelectionRect(); 64 LayoutRect rect = m_layoutPart.localSelectionRect();
65 rect.moveBy(adjustedPaintOffset); 65 rect.moveBy(adjustedPaintOffset);
66 IntRect selectionRect = pixelSnappedIntRect(rect); 66 IntRect selectionRect = pixelSnappedIntRect(rect);
67 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Part, paintInfo.phase, selectionRect); 67 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Part, paintInfo.phase, selectionRect, adjustedPaintOffset);
68 paintInfo.context->fillRect(selectionRect, m_layoutPart.selectionBackgro undColor()); 68 paintInfo.context->fillRect(selectionRect, m_layoutPart.selectionBackgro undColor());
69 } 69 }
70 70
71 if (m_layoutPart.canResize()) 71 if (m_layoutPart.canResize())
72 ScrollableAreaPainter(*m_layoutPart.layer()->scrollableArea()).paintResi zer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect); 72 ScrollableAreaPainter(*m_layoutPart.layer()->scrollableArea()).paintResi zer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
73 } 73 }
74 74
75 void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset) 75 void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& p aintOffset)
76 { 76 {
77 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location(); 77 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location();
(...skipping 11 matching lines...) Expand all
89 IntSize widgetPaintOffset = paintLocation - widgetLocation; 89 IntSize widgetPaintOffset = paintLocation - widgetLocation;
90 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer, 90 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
91 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plugin drawing. 91 // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plugin drawing.
92 TransformRecorder transform(*paintInfo.context, m_layoutPart, 92 TransformRecorder transform(*paintInfo.context, m_layoutPart,
93 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse t.height())); 93 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse t.height()));
94 paintRect.move(-widgetPaintOffset); 94 paintRect.move(-widgetPaintOffset);
95 widget->paint(paintInfo.context, paintRect); 95 widget->paint(paintInfo.context, paintRect);
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698