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 15 matching lines...) Expand all Loading... |
26 bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
Rect& rect, const ComputedStyle& style, | 26 bool NinePieceImagePainter::paint(GraphicsContext* graphicsContext, const Layout
Rect& rect, const ComputedStyle& style, |
27 const NinePieceImage& ninePieceImage, SkXfermode::Mode op) const | 27 const NinePieceImage& ninePieceImage, SkXfermode::Mode op) const |
28 { | 28 { |
29 StyleImage* styleImage = ninePieceImage.image(); | 29 StyleImage* styleImage = ninePieceImage.image(); |
30 if (!styleImage) | 30 if (!styleImage) |
31 return false; | 31 return false; |
32 | 32 |
33 if (!styleImage->isLoaded()) | 33 if (!styleImage->isLoaded()) |
34 return true; // Never paint a nine-piece image incrementally, but don't
paint the fallback borders either. | 34 return true; // Never paint a nine-piece image incrementally, but don't
paint the fallback borders either. |
35 | 35 |
36 if (!styleImage->canRender(m_layoutObject, style.effectiveZoom())) | 36 if (!styleImage->canRender()) |
37 return false; | 37 return false; |
38 | 38 |
39 // Find out if the hasImage() check in ComputedStyle::border*Width had any a
ffect, i.e. if a border is non-zero while border-style is | 39 // Find out if the hasImage() check in ComputedStyle::border*Width had any a
ffect, i.e. if a border is non-zero while border-style is |
40 // none or hidden. | 40 // none or hidden. |
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 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |