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

Side by Side Diff: third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (!IsValidRasterShapeRect(margin_rect) || 163 if (!IsValidRasterShapeRect(margin_rect) ||
164 !IsValidRasterShapeRect(image_rect)) { 164 !IsValidRasterShapeRect(image_rect)) {
165 layout_box_.GetDocument().AddConsoleMessage( 165 layout_box_.GetDocument().AddConsoleMessage(
166 ConsoleMessage::Create(kRenderingMessageSource, kErrorMessageLevel, 166 ConsoleMessage::Create(kRenderingMessageSource, kErrorMessageLevel,
167 "The shape-outside image is too large.")); 167 "The shape-outside image is too large."));
168 return Shape::CreateEmptyRasterShape(writing_mode, margin); 168 return Shape::CreateEmptyRasterShape(writing_mode, margin);
169 } 169 }
170 170
171 DCHECK(!style_image->IsPendingImage()); 171 DCHECK(!style_image->IsPendingImage());
172 RefPtr<Image> image = 172 RefPtr<Image> image =
173 style_image->GetImage(layout_box_, FlooredIntSize(image_size)); 173 style_image->GetImage(layout_box_, layout_box_.GetDocument(),
174 layout_box_.StyleRef(), FlooredIntSize(image_size));
174 175
175 return Shape::CreateRasterShape(image.Get(), shape_image_threshold, 176 return Shape::CreateRasterShape(image.Get(), shape_image_threshold,
176 image_rect, margin_rect, writing_mode, 177 image_rect, margin_rect, writing_mode,
177 margin); 178 margin);
178 } 179 }
179 180
180 const Shape& ShapeOutsideInfo::ComputedShape() const { 181 const Shape& ShapeOutsideInfo::ComputedShape() const {
181 if (Shape* shape = shape_.get()) 182 if (Shape* shape = shape_.get())
182 return *shape; 183 return *shape;
183 184
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 return result; 444 return result;
444 } 445 }
445 446
446 FloatSize ShapeOutsideInfo::ShapeToLayoutObjectSize(FloatSize size) const { 447 FloatSize ShapeOutsideInfo::ShapeToLayoutObjectSize(FloatSize size) const {
447 if (!layout_box_.Style()->IsHorizontalWritingMode()) 448 if (!layout_box_.Style()->IsHorizontalWritingMode())
448 return size.TransposedSize(); 449 return size.TransposedSize();
449 return size; 450 return size;
450 } 451 }
451 452
452 } // namespace blink 453 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698