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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPainter.cpp

Issue 2513293002: Revert of Avoid special handling of LayoutSVGForeignObject about its paint offset (Closed)
Patch Set: Rebase (with good parts kept) Created 4 years, 1 month 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.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 "core/paint/ObjectPainter.h" 5 #include "core/paint/ObjectPainter.h"
6 6
7 #include "core/layout/LayoutBlock.h" 7 #include "core/layout/LayoutBlock.h"
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/layout/LayoutObject.h" 9 #include "core/layout/LayoutObject.h"
10 #include "core/layout/LayoutTheme.h" 10 #include "core/layout/LayoutTheme.h"
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 m_layoutObject.paint(info, paintOffset); 692 m_layoutObject.paint(info, paintOffset);
693 info.phase = PaintPhaseOutline; 693 info.phase = PaintPhaseOutline;
694 m_layoutObject.paint(info, paintOffset); 694 m_layoutObject.paint(info, paintOffset);
695 } 695 }
696 696
697 #if DCHECK_IS_ON() 697 #if DCHECK_IS_ON()
698 void ObjectPainter::doCheckPaintOffset(const PaintInfo& paintInfo, 698 void ObjectPainter::doCheckPaintOffset(const PaintInfo& paintInfo,
699 const LayoutPoint& paintOffset) { 699 const LayoutPoint& paintOffset) {
700 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 700 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
701 701
702 // Actual paint offsets of SVGInline and SVGInlineText include location() 702 // TODO(pdr,wangxianzhu): Refactor to avoid the special treatment for SVGText,
703 // of the containing SVGText, but PaintPropertyTreeBuilder doesn't output 703 // SVGInline, SVGInlineText and SVGForeignObject.
704 // the paint offsets. TODO(wangxianzhu): Avoid the special treatment. 704 if (m_layoutObject.isSVG() && !m_layoutObject.isSVGRoot() &&
705 if (m_layoutObject.isSVGInline() || m_layoutObject.isSVGInlineText()) 705 !m_layoutObject.isSVGForeignObject()) {
706 if (!m_layoutObject.isSVGInline() && !m_layoutObject.isSVGInlineText())
707 DCHECK(paintOffset == LayoutPoint());
706 return; 708 return;
709 }
707 710
708 // TODO(pdr): Let painter and paint property tree builder generate the same 711 // TODO(pdr): Let painter and paint property tree builder generate the same
709 // paint offset for LayoutScrollbarPart. crbug.com/664249. 712 // paint offset for LayoutScrollbarPart. crbug.com/664249.
710 if (m_layoutObject.isLayoutScrollbarPart()) 713 if (m_layoutObject.isLayoutScrollbarPart())
711 return; 714 return;
712 715
713 LayoutPoint adjustedPaintOffset = paintOffset; 716 LayoutPoint adjustedPaintOffset = paintOffset;
714 // TODO(wangxianzhu): Avoid the special treatment for SVGText. 717 if (m_layoutObject.isBox())
715 if (m_layoutObject.isBox() && !m_layoutObject.isSVGText())
716 adjustedPaintOffset += toLayoutBox(m_layoutObject).location(); 718 adjustedPaintOffset += toLayoutBox(m_layoutObject).location();
717 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset) 719 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset)
718 << " Paint offset mismatch: " << m_layoutObject.debugName() 720 << " Paint offset mismatch: " << m_layoutObject.debugName()
719 << " from PaintPropertyTreeBuilder: " 721 << " from PaintPropertyTreeBuilder: "
720 << m_layoutObject.previousPaintOffset().toString() 722 << m_layoutObject.previousPaintOffset().toString()
721 << " from painter: " << adjustedPaintOffset.toString(); 723 << " from painter: " << adjustedPaintOffset.toString();
722 } 724 }
723 #endif 725 #endif
724 726
725 } // namespace blink 727 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698