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

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: 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 m_layoutBlock.paintSelection(contentsPaintInfo, paintOffset); // Fil l in gaps in selection on lines and between blocks. 220 m_layoutBlock.paintSelection(contentsPaintInfo, paintOffset); // Fil l in gaps in selection on lines and between blocks.
221 221
222 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection | | paintPhase == PaintPhaseTextClip) 222 if (paintPhase == PaintPhaseFloat || paintPhase == PaintPhaseSelection | | paintPhase == PaintPhaseTextClip)
223 m_layoutBlock.paintFloats(contentsPaintInfo, paintOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip); 223 m_layoutBlock.paintFloats(contentsPaintInfo, paintOffset, paintPhase == PaintPhaseSelection || paintPhase == PaintPhaseTextClip);
224 } 224 }
225 225
226 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_layoutBlock.style()->hasOutline() && m_layoutBlock.style()->visibility() = = VISIBLE) { 226 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && m_layoutBlock.style()->hasOutline() && m_layoutBlock.style()->visibility() = = VISIBLE) {
227 // Don't paint focus ring for anonymous block continuation because the 227 // Don't paint focus ring for anonymous block continuation because the
228 // inline element having outline-style:auto paints the whole focus ring. 228 // inline element having outline-style:auto paints the whole focus ring.
229 if (!m_layoutBlock.style()->outlineStyleIsAuto() || !m_layoutBlock.isAno nymousBlockContinuation()) 229 if (!m_layoutBlock.style()->outlineStyleIsAuto() || !m_layoutBlock.isAno nymousBlockContinuation())
230 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, LayoutRect(pain tOffset, m_layoutBlock.size()), visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset)); 230 ObjectPainter(m_layoutBlock).paintOutline(paintInfo, LayoutRect(pain tOffset, m_layoutBlock.size()), visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset), paintOffset);
231 } 231 }
232 232
233 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines ) 233 if (paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseChildOutlines )
234 paintContinuationOutlines(paintInfo, paintOffset); 234 paintContinuationOutlines(paintInfo, paintOffset);
235 235
236 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground, 236 // If the caret's node's layout object's containing block is this block, and the paint action is PaintPhaseForeground,
237 // then paint the caret. 237 // then paint the caret.
238 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret)) { 238 if (paintPhase == PaintPhaseForeground && hasCaret() && !LayoutObjectDrawing Recorder::useCachedDrawingIfPossible(*paintInfo.context, m_layoutBlock, DisplayI tem::Caret, paintOffset)) {
239 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset )); 239 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutBlock, DisplayItem::Caret, visualOverflowRectWithPaintOffset(m_layoutBlock, paintOffset ), paintOffset);
240 paintCarets(paintInfo, paintOffset); 240 paintCarets(paintInfo, paintOffset);
241 } 241 }
242 } 242 }
243 243
244 static inline bool caretBrowsingEnabled(const LocalFrame* frame) 244 static inline bool caretBrowsingEnabled(const LocalFrame* frame)
245 { 245 {
246 Settings* settings = frame->settings(); 246 Settings* settings = frame->settings();
247 return settings && settings->caretBrowsingEnabled(); 247 return settings && settings->caretBrowsingEnabled();
248 } 248 }
249 249
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 LayoutBlock* block = flow->containingBlock(); 354 LayoutBlock* block = flow->containingBlock();
355 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ()) 355 for ( ; block && block != &m_layoutBlock; block = block->containingBlock ())
356 accumulatedPaintOffset.moveBy(block->location()); 356 accumulatedPaintOffset.moveBy(block->location());
357 ASSERT(block); 357 ASSERT(block);
358 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); 358 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset);
359 } 359 }
360 } 360 }
361 361
362 362
363 } // namespace blink 363 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698