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

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: Fix bugs caught by unittest failures 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
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // inline element having outline-style:auto paints the whole focus ring. 203 // inline element having outline-style:auto paints the whole focus ring.
204 if (!m_layoutBlock.style()->outlineStyleIsAuto() || !m_layoutBlock.isAno nymousBlockContinuation()) 204 if (!m_layoutBlock.style()->outlineStyleIsAuto() || !m_layoutBlock.isAno nymousBlockContinuation())
205 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, m_layoutBlock.v isualOverflowRect(), m_layoutBlock.size(), paintOffset); 205 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, m_layoutBlock.v isualOverflowRect(), m_layoutBlock.size(), paintOffset);
206 } 206 }
207 207
208 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines ) 208 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines )
209 paintContinuationOutlines(paintInfo, paintOffset); 209 paintContinuationOutlines(paintInfo, paintOffset);
210 210
211 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, 211 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground,
212 // then paint the caret. 212 // then paint the caret.
213 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret)) { 213 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret, paintOffset)) {
214 LayoutRect bounds = m_layoutBlock.visualOverflowRect(); 214 LayoutRect bounds = m_layoutBlock.visualOverflowRect();
215 bounds.moveBy(paintOffset); 215 bounds.moveBy(paintOffset);
216 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, bounds); 216 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, bounds, paintOffset);
217 paintCarets(paintInfo, paintOffset); 217 paintCarets(paintInfo, paintOffset);
218 } 218 }
219 } 219 }
220 220
221 static inline bool caretBrowsingEnabled(const LocalFrame* frame) 221 static inline bool caretBrowsingEnabled(const LocalFrame* frame)
222 { 222 {
223 Settings* settings = frame->settings(); 223 Settings* settings = frame->settings();
224 return settings && settings->caretBrowsingEnabled(); 224 return settings && settings->caretBrowsingEnabled();
225 } 225 }
226 226
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 LayoutBlock* block = flow->containingBlock(); 331 LayoutBlock* block = flow->containingBlock();
332 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ()) 332 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ())
333 accumulatedPaintOffset.moveBy(block->location()); 333 accumulatedPaintOffset.moveBy(block->location());
334 ASSERT(block); 334 ASSERT(block);
335 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); 335 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset);
336 } 336 }
337 } 337 }
338 338
339 339
340 } // namespace blink 340 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698