| 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/frame/UseCounter.h" | 8 #include "core/frame/UseCounter.h" |
| 9 #include "core/layout/ImageQualityController.h" | 9 #include "core/layout/ImageQualityController.h" |
| 10 #include "core/layout/LayoutBoxModelObject.h" | 10 #include "core/layout/LayoutBoxModelObject.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if ((style.borderLeftWidth() && (style.borderLeft().style() == BNONE || styl
e.borderLeft().style() == BHIDDEN)) | 41 if ((style.borderLeftWidth() && (style.borderLeft().style() == BNONE || styl
e.borderLeft().style() == BHIDDEN)) |
| 42 || (style.borderRightWidth() && (style.borderRight().style() == BNONE ||
style.borderRight().style() == BHIDDEN)) | 42 || (style.borderRightWidth() && (style.borderRight().style() == BNONE ||
style.borderRight().style() == BHIDDEN)) |
| 43 || (style.borderTopWidth() && (style.borderTop().style() == BNONE || sty
le.borderTop().style() == BHIDDEN)) | 43 || (style.borderTopWidth() && (style.borderTop().style() == BNONE || sty
le.borderTop().style() == BHIDDEN)) |
| 44 || (style.borderBottomWidth() && (style.borderBottom().style() == BNONE
|| style.borderBottom().style() == BHIDDEN))) | 44 || (style.borderBottomWidth() && (style.borderBottom().style() == BNONE
|| style.borderBottom().style() == BHIDDEN))) |
| 45 UseCounter::count(m_layoutObject.document(), UseCounter::BorderImageWith
BorderStyleNone); | 45 UseCounter::count(m_layoutObject.document(), UseCounter::BorderImageWith
BorderStyleNone); |
| 46 | 46 |
| 47 // FIXME: border-image is broken with full page zooming when tiling has to h
appen, since the tiling function | 47 // FIXME: border-image is broken with full page zooming when tiling has to h
appen, since the tiling function |
| 48 // doesn't have any understanding of the zoom that is in effect on the tile. | 48 // doesn't have any understanding of the zoom that is in effect on the tile. |
| 49 LayoutRect rectWithOutsets = rect; | 49 LayoutRect rectWithOutsets = rect; |
| 50 rectWithOutsets.expand(style.imageOutsets(ninePieceImage)); | 50 rectWithOutsets.expand(style.imageOutsets(ninePieceImage)); |
| 51 IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets); | 51 LayoutRect borderImageRect = rectWithOutsets; |
| 52 | 52 |
| 53 IntSize imageSize = m_layoutObject.calculateImageIntrinsicDimensions(styleIm
age, borderImageRect.size(), | 53 IntSize imageSize = roundedIntSize(m_layoutObject.calculateImageIntrinsicDim
ensions(styleImage, borderImageRect.size(), |
| 54 LayoutBoxModelObject::DoNotScaleByEffectiveZoom); | 54 LayoutBoxModelObject::DoNotScaleByEffectiveZoom)); |
| 55 | 55 |
| 56 IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth()
, | 56 IntRectOutsets borderWidths(style.borderTopWidth(), style.borderRightWidth()
, |
| 57 style.borderBottomWidth(), style.borderLeftWidth()); | 57 style.borderBottomWidth(), style.borderLeftWidth()); |
| 58 NinePieceImageGrid grid(ninePieceImage, imageSize, borderImageRect, borderWi
dths); | 58 NinePieceImageGrid grid(ninePieceImage, imageSize, pixelSnappedIntRect(borde
rImageRect), borderWidths); |
| 59 | 59 |
| 60 RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize, style.ef
fectiveZoom()); | 60 RefPtr<Image> image = styleImage->image(&m_layoutObject, imageSize, style.ef
fectiveZoom()); |
| 61 | 61 |
| 62 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ
uality(m_layoutObject, | 62 InterpolationQuality interpolationQuality = BoxPainter::chooseInterpolationQ
uality(m_layoutObject, |
| 63 graphicsContext, image.get(), 0, rectWithOutsets.size()); | 63 graphicsContext, image.get(), 0, rectWithOutsets.size()); |
| 64 InterpolationQuality previousInterpolationQuality = graphicsContext->imageIn
terpolationQuality(); | 64 InterpolationQuality previousInterpolationQuality = graphicsContext->imageIn
terpolationQuality(); |
| 65 graphicsContext->setImageInterpolationQuality(interpolationQuality); | 65 graphicsContext->setImageInterpolationQuality(interpolationQuality); |
| 66 | 66 |
| 67 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", | 67 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage", "
data", |
| 68 InspectorPaintImageEvent::data(m_layoutObject, *styleImage)); | 68 InspectorPaintImageEvent::data(m_layoutObject, *styleImage)); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 79 drawInfo.tileRule.vertical, op); | 79 drawInfo.tileRule.vertical, op); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 graphicsContext->setImageInterpolationQuality(previousInterpolationQuality); | 84 graphicsContext->setImageInterpolationQuality(previousInterpolationQuality); |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace blink | 88 } // namespace blink |
| OLD | NEW |