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

Side by Side Diff: Source/core/paint/ReplacedPainter.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/PartPainter.cpp ('k') | Source/core/paint/SVGClipPainter.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/ReplacedPainter.h" 6 #include "core/paint/ReplacedPainter.h"
7 7
8 #include "core/layout/LayoutReplaced.h" 8 #include "core/layout/LayoutReplaced.h"
9 #include "core/layout/api/SelectionState.h" 9 #include "core/layout/api/SelectionState.h"
10 #include "core/paint/BoxPainter.h" 10 #include "core/paint/BoxPainter.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 BoxPainter(m_layoutReplaced).paintClippingMask(paintInfo, adjust edPaintOffset); 77 BoxPainter(m_layoutReplaced).paintClippingMask(paintInfo, adjust edPaintOffset);
78 } else { 78 } else {
79 m_layoutReplaced.paintReplaced(paintInfo, adjustedPaintOffset); 79 m_layoutReplaced.paintReplaced(paintInfo, adjustedPaintOffset);
80 } 80 }
81 } 81 }
82 } 82 }
83 83
84 // The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of 84 // The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of
85 // surrounding content. 85 // surrounding content.
86 bool drawSelectionTint = paintInfo.phase == PaintPhaseForeground && m_layout Replaced.selectionState() != SelectionNone && !paintInfo.isPrinting(); 86 bool drawSelectionTint = paintInfo.phase == PaintPhaseForeground && m_layout Replaced.selectionState() != SelectionNone && !paintInfo.isPrinting();
87 if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPos sible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint)) { 87 if (drawSelectionTint && !LayoutObjectDrawingRecorder::useCachedDrawingIfPos sible(*paintInfo.context, m_layoutReplaced, DisplayItem::SelectionTint, paintOff set)) {
88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ; 88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ;
89 selectionPaintingRect.moveBy(adjustedPaintOffset); 89 selectionPaintingRect.moveBy(adjustedPaintOffset);
90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect); 90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect);
91 91
92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); 92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect, paintOffset);
93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor()); 93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor());
94 } 94 }
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/SVGClipPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698