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

Side by Side Diff: sky/engine/core/rendering/RenderBlock.cpp

Issue 895483002: Remove the last remnant of paint phases. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/rendering/PaintPhase.h ('k') | sky/engine/core/rendering/RenderBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 TrackedRendererListHashSet::iterator end = positionedDescendants->end(); 443 TrackedRendererListHashSet::iterator end = positionedDescendants->end();
444 for (TrackedRendererListHashSet::iterator it = positionedDescendants->be gin(); it != end; ++it) 444 for (TrackedRendererListHashSet::iterator it = positionedDescendants->be gin(); it != end; ++it)
445 (*it)->setChildNeedsLayout(); 445 (*it)->setChildNeedsLayout();
446 } 446 }
447 } 447 }
448 448
449 void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 449 void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
450 { 450 {
451 LayoutPoint adjustedPaintOffset = paintOffset + location(); 451 LayoutPoint adjustedPaintOffset = paintOffset + location();
452 452
453 PaintPhase phase = paintInfo.phase;
454
455 LayoutRect overflowBox; 453 LayoutRect overflowBox;
456 // Check if we need to do anything at all. 454 // Check if we need to do anything at all.
457 // FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the RenderView 455 // FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the RenderView
458 // paints the root's background. 456 // paints the root's background.
459 if (!isDocumentElement()) { 457 if (!isDocumentElement()) {
460 overflowBox = visualOverflowRect(); 458 overflowBox = visualOverflowRect();
461 overflowBox.moveBy(adjustedPaintOffset); 459 overflowBox.moveBy(adjustedPaintOffset);
462 if (!overflowBox.intersects(paintInfo.rect)) 460 if (!overflowBox.intersects(paintInfo.rect))
463 return; 461 return;
464 } 462 }
465 463
466 // There are some cases where not all clipped visual overflow is accounted f or. 464 // There are some cases where not all clipped visual overflow is accounted f or.
467 // FIXME: reduce the number of such cases. 465 // FIXME: reduce the number of such cases.
468 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; 466 ContentsClipBehavior contentsClipBehavior = ForceContentsClip;
469 if (hasOverflowClip() && !(shouldPaintSelectionGaps() && phase == PaintPhase Foreground) && !hasCaret()) 467 if (hasOverflowClip() && !shouldPaintSelectionGaps() && !hasCaret())
470 contentsClipBehavior = SkipContentsClipIfPossible; 468 contentsClipBehavior = SkipContentsClipIfPossible;
471 469
472 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsC lipBehavior); 470 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsC lipBehavior);
473 paintObject(paintInfo, adjustedPaintOffset); 471 paintObject(paintInfo, adjustedPaintOffset);
474 if (pushedClip) 472 if (pushedClip)
475 popContentsClip(paintInfo, phase, adjustedPaintOffset); 473 popContentsClip(paintInfo, adjustedPaintOffset);
476 } 474 }
477 475
478 void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 476 void RenderBlock::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
479 { 477 {
480 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) { 478 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) {
481 if (!child->hasSelfPaintingLayer()) 479 if (!child->hasSelfPaintingLayer())
482 child->paint(paintInfo, paintOffset); 480 child->paint(paintInfo, paintOffset);
483 } 481 }
484 } 482 }
485 483
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 1769 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
1772 { 1770 {
1773 showRenderObject(); 1771 showRenderObject();
1774 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 1772 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
1775 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 1773 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
1776 } 1774 }
1777 1775
1778 #endif 1776 #endif
1779 1777
1780 } // namespace blink 1778 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/PaintPhase.h ('k') | sky/engine/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698