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

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

Issue 961053002: Assorted cleanup of RenderLayer. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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') | sky/engine/core/rendering/RenderLayer.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) 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 rect.move(absPos.x(), absPos.y()); 274 rect.move(absPos.x(), absPos.y());
275 return rect; 275 return rect;
276 } 276 }
277 277
278 FloatQuad RenderBox::absoluteContentQuad() const 278 FloatQuad RenderBox::absoluteContentQuad() const
279 { 279 {
280 LayoutRect rect = contentBoxRect(); 280 LayoutRect rect = contentBoxRect();
281 return localToAbsoluteQuad(FloatRect(rect)); 281 return localToAbsoluteQuad(FloatRect(rect));
282 } 282 }
283 283
284 FloatPoint RenderBox::perspectiveOrigin() const
285 {
286 if (!hasTransform())
287 return FloatPoint();
288
289 const LayoutRect borderBox = borderBoxRect();
290 return FloatPoint(
291 floatValueForLength(style()->perspectiveOriginX(), borderBox.width().toF loat()),
292 floatValueForLength(style()->perspectiveOriginY(), borderBox.height().to Float()));
293 }
294
284 void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& add itionalOffset, const RenderBox*) const 295 void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& add itionalOffset, const RenderBox*) const
285 { 296 {
286 if (!size().isEmpty()) 297 if (!size().isEmpty())
287 rects.append(pixelSnappedIntRect(additionalOffset, size())); 298 rects.append(pixelSnappedIntRect(additionalOffset, size()));
288 } 299 }
289 300
290 bool RenderBox::needsPreferredWidthsRecalculation() const 301 bool RenderBox::needsPreferredWidthsRecalculation() const
291 { 302 {
292 return style()->paddingStart().isPercent() || style()->paddingEnd().isPercen t(); 303 return style()->paddingStart().isPercent() || style()->paddingEnd().isPercen t();
293 } 304 }
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 if (!rootRelativeBoundsComputed) { 839 if (!rootRelativeBoundsComputed) {
829 rootRelativeBounds = layer()->physicalBoundingBoxIncludingRe flectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot); 840 rootRelativeBounds = layer()->physicalBoundingBoxIncludingRe flectionAndStackingChildren(paintingInfo.rootLayer, offsetFromRoot);
830 rootRelativeBoundsComputed = true; 841 rootRelativeBoundsComputed = true;
831 } 842 }
832 843
833 context->clipPath(clipPath->path(rootRelativeBounds), clipPath-> windRule()); 844 context->clipPath(clipPath->path(rootRelativeBounds), clipPath-> windRule());
834 } 845 }
835 } 846 }
836 } 847 }
837 848
838 if (layer()->isTransparent()) { 849 if (isTransparent()) {
839 context->save(); 850 context->save();
840 LayoutRect clipRect = intersection(paintingInfo.paintDirtyRect, 851 LayoutRect clipRect = intersection(paintingInfo.paintDirtyRect,
841 transparencyClipBox(layer(), localPaintingInfo.rootLayer, localPaint ingInfo.subPixelAccumulation)); 852 transparencyClipBox(layer(), localPaintingInfo.rootLayer, localPaint ingInfo.subPixelAccumulation));
842 context->clip(clipRect); 853 context->clip(clipRect);
843 context->beginTransparencyLayer(opacity()); 854 context->beginTransparencyLayer(opacity());
844 } 855 }
845 856
846 layer()->clipToRect(localPaintingInfo, context, contentRect); 857 layer()->clipToRect(localPaintingInfo, context, contentRect);
847 858
848 FilterEffectRendererHelper filterPainter(layer()->filterRenderer() && hasFil ter()); 859 FilterEffectRendererHelper filterPainter(layer()->filterRenderer() && hasFil ter());
(...skipping 17 matching lines...) Expand all
866 std::stable_sort(layers.begin(), layers.end(), forwardCompareZIndex); 877 std::stable_sort(layers.begin(), layers.end(), forwardCompareZIndex);
867 for (auto& box : layers) { 878 for (auto& box : layers) {
868 box->paintLayer(context, paintingInfo); 879 box->paintLayer(context, paintingInfo);
869 } 880 }
870 881
871 if (filterPainter.hasStartedFilterEffect()) 882 if (filterPainter.hasStartedFilterEffect())
872 context = filterPainter.applyFilterEffect(); 883 context = filterPainter.applyFilterEffect();
873 884
874 layer()->restoreClip(context, localPaintingInfo.paintDirtyRect, contentRect) ; 885 layer()->restoreClip(context, localPaintingInfo.paintDirtyRect, contentRect) ;
875 886
876 if (layer()->isTransparent()) { 887 if (isTransparent()) {
877 context->endLayer(); 888 context->endLayer();
878 context->restore(); 889 context->restore();
879 } 890 }
880 } 891 }
881 892
882 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Vect or<RenderBox*>& layers) 893 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Vect or<RenderBox*>& layers)
883 { 894 {
884 LayoutPoint adjustedPaintOffset = paintOffset + location(); 895 LayoutPoint adjustedPaintOffset = paintOffset + location();
885 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng()) 896 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli ng())
886 child->paint(paintInfo, adjustedPaintOffset, layers); 897 child->paint(paintInfo, adjustedPaintOffset, layers);
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 3025
3015 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3026 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3016 { 3027 {
3017 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3028 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3018 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3029 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3019 ASSERT(hasBackground == style.hasBackground()); 3030 ASSERT(hasBackground == style.hasBackground());
3020 hasBorder = style.hasBorder(); 3031 hasBorder = style.hasBorder();
3021 } 3032 }
3022 3033
3023 } // namespace blink 3034 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698