OLD | NEW |
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borde
rAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() -
renderBox.paddingBefore()); | 104 LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borde
rAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() -
renderBox.paddingBefore()); |
105 LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.bor
derAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderA
ndPaddingLogicalHeight()); | 105 LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.bor
derAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderA
ndPaddingLogicalHeight()); |
106 return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDe
lta); | 106 return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDe
lta); |
107 } | 107 } |
108 | 108 |
109 static bool isValidRasterShapeRect(const LayoutRect& rect) | 109 static bool isValidRasterShapeRect(const LayoutRect& rect) |
110 { | 110 { |
111 static double maxImageSizeBytes = 0; | 111 static double maxImageSizeBytes = 0; |
112 if (!maxImageSizeBytes) { | 112 if (!maxImageSizeBytes) { |
113 size_t size32MaxBytes = 0xFFFFFFFF / 4; // Some platforms don't limit m
axDecodedImageBytes. | 113 size_t size32MaxBytes = 0xFFFFFFFF / 4; // Some platforms don't limit m
axDecodedImageBytes. |
114 maxImageSizeBytes = std::min(size32MaxBytes, blink::Platform::current()-
>maxDecodedImageBytes()); | 114 maxImageSizeBytes = std::min(size32MaxBytes, Platform::current()->maxDec
odedImageBytes()); |
115 } | 115 } |
116 return (rect.width().toFloat() * rect.height().toFloat() * 4.0) < maxImageSi
zeBytes; | 116 return (rect.width().toFloat() * rect.height().toFloat() * 4.0) < maxImageSi
zeBytes; |
117 } | 117 } |
118 | 118 |
119 PassOwnPtr<Shape> ShapeOutsideInfo::createShapeForImage(StyleImage* styleImage,
float shapeImageThreshold, WritingMode writingMode, float margin) const | 119 PassOwnPtr<Shape> ShapeOutsideInfo::createShapeForImage(StyleImage* styleImage,
float shapeImageThreshold, WritingMode writingMode, float margin) const |
120 { | 120 { |
121 const IntSize& imageSize = m_renderer.calculateImageIntrinsicDimensions(styl
eImage, roundedIntSize(m_referenceBoxLogicalSize), RenderImage::ScaleByEffective
Zoom); | 121 const IntSize& imageSize = m_renderer.calculateImageIntrinsicDimensions(styl
eImage, roundedIntSize(m_referenceBoxLogicalSize), RenderImage::ScaleByEffective
Zoom); |
122 styleImage->setContainerSizeForRenderer(&m_renderer, imageSize, m_renderer.s
tyle()->effectiveZoom()); | 122 styleImage->setContainerSizeForRenderer(&m_renderer, imageSize, m_renderer.s
tyle()->effectiveZoom()); |
123 | 123 |
124 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referen
ceBoxLogicalSize); | 124 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referen
ceBoxLogicalSize); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return result; | 340 return result; |
341 } | 341 } |
342 | 342 |
343 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const | 343 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const |
344 { | 344 { |
345 if (!m_renderer.style()->isHorizontalWritingMode()) | 345 if (!m_renderer.style()->isHorizontalWritingMode()) |
346 return size.transposedSize(); | 346 return size.transposedSize(); |
347 return size; | 347 return size; |
348 } | 348 } |
349 | 349 |
350 } | 350 } // namespace blink |
OLD | NEW |