| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/NinePieceImagePainter.h" | 6 #include "core/paint/NinePieceImagePainter.h" |
| 7 | 7 |
| 8 #include "core/layout/ImageQualityController.h" | 8 #include "core/layout/ImageQualityController.h" |
| 9 #include "core/layout/LayoutBoxModelObject.h" | 9 #include "core/layout/LayoutBoxModelObject.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // FIXME: border-image is broken with full page zooming when tiling has to h
appen, since the tiling function | 38 // FIXME: border-image is broken with full page zooming when tiling has to h
appen, since the tiling function |
| 39 // doesn't have any understanding of the zoom that is in effect on the tile. | 39 // doesn't have any understanding of the zoom that is in effect on the tile. |
| 40 LayoutRect rectWithOutsets = rect; | 40 LayoutRect rectWithOutsets = rect; |
| 41 rectWithOutsets.expand(style.imageOutsets(ninePieceImage)); | 41 rectWithOutsets.expand(style.imageOutsets(ninePieceImage)); |
| 42 IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets); | 42 IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets); |
| 43 | 43 |
| 44 IntSize imageSize = m_layoutObject.calculateImageIntrinsicDimensions(styleIm
age, borderImageRect.size(), | 44 IntSize imageSize = m_layoutObject.calculateImageIntrinsicDimensions(styleIm
age, borderImageRect.size(), |
| 45 LayoutBoxModelObject::DoNotScaleByEffectiveZoom); | 45 LayoutBoxModelObject::DoNotScaleByEffectiveZoom); |
| 46 | 46 |
| 47 // If both values are 'auto' then the intrinsic width and/or height of the i
mage should be used, if any. | |
| 48 styleImage->setContainerSizeForLayoutObject(&m_layoutObject, imageSize, styl
e.effectiveZoom()); | |
| 49 | |
| 50 IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth()
, | 47 IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth()
, |
| 51 style.borderBottomWidth(), style.borderLeftWidth()); | 48 style.borderBottomWidth(), style.borderLeftWidth()); |
| 52 NinePieceImageGrid grid(ninePieceImage, imageSize, borderImageRect, borderWi
dths); | 49 NinePieceImageGrid grid(ninePieceImage, imageSize, borderImageRect, borderWi
dths); |
| 53 | 50 |
| 54 RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize); | 51 RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize); |
| 55 | 52 |
| 56 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ
uality(m_layoutObject, | 53 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ
uality(m_layoutObject, |
| 57 graphicsContext, image.get(), 0, rectWithOutsets.size()); | 54 graphicsContext, image.get(), 0, rectWithOutsets.size()); |
| 58 InterpolationQuality previousInterpolationQuality = graphicsContext->imageIn
terpolationQuality(); | 55 InterpolationQuality previousInterpolationQuality = graphicsContext->imageIn
terpolationQuality(); |
| 59 graphicsContext->setImageInterpolationQuality(interpolationQuality); | 56 graphicsContext->setImageInterpolationQuality(interpolationQuality); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 drawInfo.tileRule.vertical, op); | 70 drawInfo.tileRule.vertical, op); |
| 74 } | 71 } |
| 75 } | 72 } |
| 76 } | 73 } |
| 77 | 74 |
| 78 graphicsContext->setImageInterpolationQuality(previousInterpolationQuality); | 75 graphicsContext->setImageInterpolationQuality(previousInterpolationQuality); |
| 79 return true; | 76 return true; |
| 80 } | 77 } |
| 81 | 78 |
| 82 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |