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

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

Issue 883583003: Remove dead control clip code. (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/RenderBox.h ('k') | no next file » | 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo l skipBaseColor) 791 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo l skipBaseColor)
792 { 792 {
793 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), backgroundObject, skipBaseColor); 793 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), backgroundObject, skipBaseColor);
794 } 794 }
795 795
796 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior) 796 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu latedOffset, ContentsClipBehavior contentsClipBehavior)
797 { 797 {
798 if (paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhas eMask) 798 if (paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhas eMask)
799 return false; 799 return false;
800 800
801 bool isControlClip = hasControlClip();
802 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); 801 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer();
803 802 if (!isOverflowClip)
804 if (!isControlClip && !isOverflowClip)
805 return false; 803 return false;
806 804
807 LayoutRect clipRect = isControlClip ? controlClipRect(accumulatedOffset) : o verflowClipRect(accumulatedOffset); 805 LayoutRect clipRect = overflowClipRect(accumulatedOffset);
808 RoundedRect clipRoundedRect(0, 0, 0, 0); 806 RoundedRect clipRoundedRect(0, 0, 0, 0);
809 bool hasBorderRadius = style()->hasBorderRadius(); 807 bool hasBorderRadius = style()->hasBorderRadius();
810 if (hasBorderRadius) 808 if (hasBorderRadius)
811 clipRoundedRect = style()->getRoundedInnerBorderFor(LayoutRect(accumulat edOffset, size())); 809 clipRoundedRect = style()->getRoundedInnerBorderFor(LayoutRect(accumulat edOffset, size()));
812 810
813 if (contentsClipBehavior == SkipContentsClipIfPossible) { 811 if (contentsClipBehavior == SkipContentsClipIfPossible) {
814 LayoutRect contentsVisualOverflow = contentsVisualOverflowRect(); 812 LayoutRect contentsVisualOverflow = contentsVisualOverflowRect();
815 if (contentsVisualOverflow.isEmpty()) 813 if (contentsVisualOverflow.isEmpty())
816 return false; 814 return false;
817 815
(...skipping 11 matching lines...) Expand all
829 paintInfo.phase = PaintPhaseChildOutlines; 827 paintInfo.phase = PaintPhaseChildOutlines;
830 paintInfo.context->save(); 828 paintInfo.context->save();
831 if (hasBorderRadius) 829 if (hasBorderRadius)
832 paintInfo.context->clipRoundedRect(clipRoundedRect); 830 paintInfo.context->clipRoundedRect(clipRoundedRect);
833 paintInfo.context->clip(pixelSnappedIntRect(clipRect)); 831 paintInfo.context->clip(pixelSnappedIntRect(clipRect));
834 return true; 832 return true;
835 } 833 }
836 834
837 void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset) 835 void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset)
838 { 836 {
839 ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLay er())); 837 ASSERT(hasOverflowClip() && !layer()->isSelfPaintingLayer());
840 838
841 paintInfo.context->restore(); 839 paintInfo.context->restore();
842 if (originalPhase == PaintPhaseOutline) { 840 if (originalPhase == PaintPhaseOutline) {
843 paintInfo.phase = PaintPhaseSelfOutline; 841 paintInfo.phase = PaintPhaseSelfOutline;
844 paintObject(paintInfo, accumulatedOffset); 842 paintObject(paintInfo, accumulatedOffset);
845 paintInfo.phase = originalPhase; 843 paintInfo.phase = originalPhase;
846 } 844 }
847 } 845 }
848 846
849 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location) 847 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location)
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 2938
2941 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 2939 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
2942 { 2940 {
2943 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 2941 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
2944 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 2942 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
2945 ASSERT(hasBackground == style.hasBackground()); 2943 ASSERT(hasBackground == style.hasBackground());
2946 hasBorder = style.hasBorder(); 2944 hasBorder = style.hasBorder();
2947 } 2945 }
2948 2946
2949 } // namespace blink 2947 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698