| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/InlineFlowBoxPainter.h" | 6 #include "core/paint/InlineFlowBoxPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutBlock.h" | 8 #include "core/layout/LayoutBlock.h" |
| 9 #include "core/layout/LayoutInline.h" | 9 #include "core/layout/LayoutInline.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 LayoutUnit stripY = paintOffset.y() - (m_inlineFlowBox.isHorizontal() ? Layo
utUnit() : logicalOffsetOnLine); | 183 LayoutUnit stripY = paintOffset.y() - (m_inlineFlowBox.isHorizontal() ? Layo
utUnit() : logicalOffsetOnLine); |
| 184 LayoutUnit stripWidth = m_inlineFlowBox.isHorizontal() ? totalLogicalWidth :
frameSize.width(); | 184 LayoutUnit stripWidth = m_inlineFlowBox.isHorizontal() ? totalLogicalWidth :
frameSize.width(); |
| 185 LayoutUnit stripHeight = m_inlineFlowBox.isHorizontal() ? frameSize.height()
: totalLogicalWidth; | 185 LayoutUnit stripHeight = m_inlineFlowBox.isHorizontal() ? frameSize.height()
: totalLogicalWidth; |
| 186 return LayoutRect(stripX, stripY, stripWidth, stripHeight); | 186 return LayoutRect(stripX, stripY, stripWidth, stripHeight); |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 InlineFlowBoxPainter::BorderPaintingType InlineFlowBoxPainter::getBorderPaintTyp
e(const LayoutRect& adjustedFrameRect, LayoutRect& adjustedClipRect) const | 190 InlineFlowBoxPainter::BorderPaintingType InlineFlowBoxPainter::getBorderPaintTyp
e(const LayoutRect& adjustedFrameRect, LayoutRect& adjustedClipRect) const |
| 191 { | 191 { |
| 192 adjustedClipRect = adjustedFrameRect; | 192 adjustedClipRect = adjustedFrameRect; |
| 193 if (m_inlineFlowBox.parent() && m_inlineFlowBox.layoutObject().style()->hasB
order()) { | 193 if (m_inlineFlowBox.parent() && m_inlineFlowBox.layoutObject().style()->hasB
orderDecoration()) { |
| 194 const NinePieceImage& borderImage = m_inlineFlowBox.layoutObject().style
()->borderImage(); | 194 const NinePieceImage& borderImage = m_inlineFlowBox.layoutObject().style
()->borderImage(); |
| 195 StyleImage* borderImageSource = borderImage.image(); | 195 StyleImage* borderImageSource = borderImage.image(); |
| 196 const ComputedStyle* styleToUse = m_inlineFlowBox.layoutObject().style(m
_inlineFlowBox.isFirstLineStyle()); | 196 const ComputedStyle* styleToUse = m_inlineFlowBox.layoutObject().style(m
_inlineFlowBox.isFirstLineStyle()); |
| 197 bool hasBorderImage = borderImageSource && borderImageSource->canRender(
m_inlineFlowBox.layoutObject(), styleToUse->effectiveZoom()); | 197 bool hasBorderImage = borderImageSource && borderImageSource->canRender(
m_inlineFlowBox.layoutObject(), styleToUse->effectiveZoom()); |
| 198 if (hasBorderImage && !borderImageSource->isLoaded()) | 198 if (hasBorderImage && !borderImageSource->isLoaded()) |
| 199 return DontPaintBorders; | 199 return DontPaintBorders; |
| 200 | 200 |
| 201 // The simple case is where we either have no border image or we are the
only box for this object. | 201 // The simple case is where we either have no border image or we are the
only box for this object. |
| 202 // In those cases only a single call to draw is required. | 202 // In those cases only a single call to draw is required. |
| 203 if (!hasBorderImage || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowB
ox.nextLineBox())) | 203 if (!hasBorderImage || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowB
ox.nextLineBox())) |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 rect.setHeight(logicalHeight); | 351 rect.setHeight(logicalHeight); |
| 352 } else { | 352 } else { |
| 353 rect.setX(logicalTop); | 353 rect.setX(logicalTop); |
| 354 rect.setWidth(logicalHeight); | 354 rect.setWidth(logicalHeight); |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 return rect; | 357 return rect; |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |