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

Side by Side Diff: Source/core/layout/LayoutBox.cpp

Issue 1300103003: Refactor code for calculating background image geometry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | Source/core/paint/BackgroundImageGeometry.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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 } 1172 }
1173 1173
1174 if (!style()->backgroundLayers().image() || style()->backgroundLayers().next ()) { 1174 if (!style()->backgroundLayers().image() || style()->backgroundLayers().next ()) {
1175 paintedExtent = backgroundRect; 1175 paintedExtent = backgroundRect;
1176 return true; 1176 return true;
1177 } 1177 }
1178 1178
1179 BackgroundImageGeometry geometry; 1179 BackgroundImageGeometry geometry;
1180 // TODO(jchaffraix): This function should be rethought as it's called during and outside 1180 // TODO(jchaffraix): This function should be rethought as it's called during and outside
1181 // of the paint phase. Potentially returning different results at different phases. 1181 // of the paint phase. Potentially returning different results at different phases.
1182 BoxPainter::calculateBackgroundImageGeometry(*this, 0, GlobalPaintNormalPhas e, style()->backgroundLayers(), backgroundRect, geometry); 1182 geometry.calculate(*this, nullptr, GlobalPaintNormalPhase, style()->backgrou ndLayers(), backgroundRect);
1183 if (geometry.hasNonLocalGeometry()) 1183 if (geometry.hasNonLocalGeometry())
1184 return false; 1184 return false;
1185 paintedExtent = LayoutRect(geometry.destRect()); 1185 paintedExtent = LayoutRect(geometry.destRect());
1186 return true; 1186 return true;
1187 } 1187 }
1188 1188
1189 bool LayoutBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c onst 1189 bool LayoutBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c onst
1190 { 1190 {
1191 if (isDocumentElement() || backgroundStolenForBeingBody()) 1191 if (isDocumentElement() || backgroundStolenForBeingBody())
1192 return false; 1192 return false;
(...skipping 3535 matching lines...) Expand 10 before | Expand all | Expand 10 after
4728 StyleImage* borderImage = style()->borderImage().image(); 4728 StyleImage* borderImage = style()->borderImage().image();
4729 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4729 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4730 } 4730 }
4731 4731
4732 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const 4732 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const
4733 { 4733 {
4734 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; 4734 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr;
4735 } 4735 }
4736 4736
4737 } // namespace blink 4737 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/BackgroundImageGeometry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698