Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Side by Side Diff: Source/core/paint/InlineFlowBoxPainter.cpp

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/EllipsisBoxPainter.cpp ('k') | Source/core/paint/InlineTextBoxPainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 bool hasFillImage = img && img->canRender(m_inlineFlowBox.layoutObject(), m_ inlineFlowBox.layoutObject().style()->effectiveZoom()); 102 bool hasFillImage = img && img->canRender(m_inlineFlowBox.layoutObject(), m_ inlineFlowBox.layoutObject().style()->effectiveZoom());
103 if ((!hasFillImage && !m_inlineFlowBox.layoutObject().style()->hasBorderRadi us()) || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || ! m_inlineFlowBox.parent()) { 103 if ((!hasFillImage && !m_inlineFlowBox.layoutObject().style()->hasBorderRadi us()) || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || ! m_inlineFlowBox.parent()) {
104 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op); 104 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op);
105 } else if (m_inlineFlowBox.layoutObject().style()->boxDecorationBreak() == D CLONE) { 105 } else if (m_inlineFlowBox.layoutObject().style()->boxDecorationBreak() == D CLONE) {
106 GraphicsContextStateSaver stateSaver(*paintInfo.context); 106 GraphicsContextStateSaver stateSaver(*paintInfo.context);
107 paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.w idth(), m_inlineFlowBox.height())); 107 paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.w idth(), m_inlineFlowBox.height()));
108 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op); 108 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op);
109 } else { 109 } else {
110 // We have a fill image that spans multiple lines. 110 // We have a fill image that spans multiple lines.
111 // FIXME: frameSize ought to be the same as rect.size(). 111 // FIXME: frameSize ought to be the same as rect.size().
112 LayoutSize frameSize(m_inlineFlowBox.width().toLayoutUnit(), m_inlineFlo wBox.height().toLayoutUnit()); 112 LayoutSize frameSize(m_inlineFlowBox.width(), m_inlineFlowBox.height());
113 LayoutRect imageStripPaintRect = paintRectForImageStrip(rect.location(), frameSize, m_inlineFlowBox.layoutObject().style()->direction()); 113 LayoutRect imageStripPaintRect = paintRectForImageStrip(rect.location(), frameSize, m_inlineFlowBox.layoutObject().style()->direction());
114 GraphicsContextStateSaver stateSaver(*paintInfo.context); 114 GraphicsContextStateSaver stateSaver(*paintInfo.context);
115 paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.w idth(), m_inlineFlowBox.height())); 115 paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.w idth(), m_inlineFlowBox.height()));
116 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, imageStripPaintRect, BackgroundBleedNone, &m_inlineFlowBo x, rect.size(), op); 116 BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), pa intInfo, c, fillLayer, imageStripPaintRect, BackgroundBleedNone, &m_inlineFlowBo x, rect.size(), op);
117 } 117 }
118 } 118 }
119 119
120 void InlineFlowBoxPainter::paintBoxShadow(const PaintInfo& info, const ComputedS tyle& s, ShadowStyle shadowStyle, const LayoutRect& paintRect) 120 void InlineFlowBoxPainter::paintBoxShadow(const PaintInfo& info, const ComputedS tyle& s, ShadowStyle shadowStyle, const LayoutRect& paintRect)
121 { 121 {
122 if ((!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || !m _inlineFlowBox.parent()) { 122 if ((!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || !m _inlineFlowBox.parent()) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/paint/EllipsisBoxPainter.cpp ('k') | Source/core/paint/InlineTextBoxPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698