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

Side by Side Diff: Source/core/paint/BlockPainter.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/BlockFlowPainter.cpp ('k') | Source/core/paint/BoxPainter.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/BlockPainter.h" 6 #include "core/paint/BlockPainter.h"
7 7
8 #include "core/editing/DragCaretController.h" 8 #include "core/editing/DragCaretController.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection | | paintPhase == PaintPhaseTextClip) 197 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection | | paintPhase == PaintPhaseTextClip)
198 m_layoutBlock.paintFloats(contentsPaintInfo, paintOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); 198 m_layoutBlock.paintFloats(contentsPaintInfo, paintOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip);
199 } 199 }
200 200
201 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_layoutBlock.style()->hasOutline() && m_layoutBlock.style()->visibility() = = VISIBLE) 201 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_layoutBlock.style()->hasOutline() && m_layoutBlock.style()->visibility() = = VISIBLE)
202 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset); 202 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, paintOffset);
203 203
204 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, 204 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground,
205 // then paint the caret. 205 // then paint the caret.
206 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret)) { 206 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret, paintOffset)) {
207 LayoutRect bounds = m_layoutBlock.visualOverflowRect(); 207 LayoutRect bounds = m_layoutBlock.visualOverflowRect();
208 bounds.moveBy(paintOffset); 208 bounds.moveBy(paintOffset);
209 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, bounds); 209 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, bounds, paintOffset);
210 paintCarets(paintInfo, paintOffset); 210 paintCarets(paintInfo, paintOffset);
211 } 211 }
212 } 212 }
213 213
214 static inline bool caretBrowsingEnabled(const LocalFrame* frame) 214 static inline bool caretBrowsingEnabled(const LocalFrame* frame)
215 { 215 {
216 Settings* settings = frame->settings(); 216 Settings* settings = frame->settings();
217 return settings && settings->caretBrowsingEnabled(); 217 return settings && settings->caretBrowsingEnabled();
218 } 218 }
219 219
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 // We don't paint our own background, but we do let the kids paint their backgrounds. 278 // We don't paint our own background, but we do let the kids paint their backgrounds.
279 PaintInfo paintInfoForChild(paintInfo); 279 PaintInfo paintInfoForChild(paintInfo);
280 paintInfoForChild.phase = newPhase; 280 paintInfoForChild.phase = newPhase;
281 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); 281 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock);
282 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); 282 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset);
283 } 283 }
284 } 284 }
285 285
286 } // namespace blink 286 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BlockFlowPainter.cpp ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698