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

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

Issue 929223003: Move and rename RenderFrame and RenderFrameSet. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/paint/FrameSetPainter.h ('k') | Source/core/rendering/RenderFrame.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/FrameSetPainter.h" 6 #include "core/paint/FrameSetPainter.h"
7 7
8 #include "core/html/HTMLFrameSetElement.h" 8 #include "core/html/HTMLFrameSetElement.h"
9 #include "core/layout/LayoutFrameSet.h"
9 #include "core/layout/PaintInfo.h" 10 #include "core/layout/PaintInfo.h"
10 #include "core/paint/GraphicsContextAnnotator.h" 11 #include "core/paint/GraphicsContextAnnotator.h"
11 #include "core/rendering/RenderFrameSet.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 static Color borderStartEdgeColor() 15 static Color borderStartEdgeColor()
16 { 16 {
17 return Color(170, 170, 170); 17 return Color(170, 170, 170);
18 } 18 }
19 19
20 static Color borderEndEdgeColor() 20 static Color borderEndEdgeColor()
21 { 21 {
22 return Color::black; 22 return Color::black;
23 } 23 }
24 24
25 static Color borderFillColor() 25 static Color borderFillColor()
26 { 26 {
27 return Color(208, 208, 208); 27 return Color(208, 208, 208);
28 } 28 }
29 29
30 void FrameSetPainter::paintColumnBorder(const PaintInfo& paintInfo, const IntRec t& borderRect) 30 void FrameSetPainter::paintColumnBorder(const PaintInfo& paintInfo, const IntRec t& borderRect)
31 { 31 {
32 if (!paintInfo.rect.intersects(borderRect)) 32 if (!paintInfo.rect.intersects(borderRect))
33 return; 33 return;
34 34
35 // FIXME: We should do something clever when borders from distinct framesets meet at a join. 35 // FIXME: We should do something clever when borders from distinct framesets meet at a join.
36 36
37 // Fill first. 37 // Fill first.
38 GraphicsContext* context = paintInfo.context; 38 GraphicsContext* context = paintInfo.context;
39 context->fillRect(borderRect, m_renderFrameSet.frameSet()->hasBorderColor() ? m_renderFrameSet.resolveColor(CSSPropertyBorderLeftColor) : borderFillColor()) ; 39 context->fillRect(borderRect, m_layoutFrameSet.frameSet()->hasBorderColor() ? m_layoutFrameSet.resolveColor(CSSPropertyBorderLeftColor) : borderFillColor()) ;
40 40
41 // Now stroke the edges but only if we have enough room to paint both edges with a little 41 // Now stroke the edges but only if we have enough room to paint both edges with a little
42 // bit of the fill color showing through. 42 // bit of the fill color showing through.
43 if (borderRect.width() >= 3) { 43 if (borderRect.width() >= 3) {
44 context->fillRect(IntRect(borderRect.location(), IntSize(1, m_renderFram eSet.size().height())), borderStartEdgeColor()); 44 context->fillRect(IntRect(borderRect.location(), IntSize(1, m_layoutFram eSet.size().height())), borderStartEdgeColor());
45 context->fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y() ), IntSize(1, m_renderFrameSet.size().height())), borderEndEdgeColor()); 45 context->fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y() ), IntSize(1, m_layoutFrameSet.size().height())), borderEndEdgeColor());
46 } 46 }
47 } 47 }
48 48
49 void FrameSetPainter::paintRowBorder(const PaintInfo& paintInfo, const IntRect& borderRect) 49 void FrameSetPainter::paintRowBorder(const PaintInfo& paintInfo, const IntRect& borderRect)
50 { 50 {
51 if (!paintInfo.rect.intersects(borderRect)) 51 if (!paintInfo.rect.intersects(borderRect))
52 return; 52 return;
53 53
54 // FIXME: We should do something clever when borders from distinct framesets meet at a join. 54 // FIXME: We should do something clever when borders from distinct framesets meet at a join.
55 55
56 // Fill first. 56 // Fill first.
57 GraphicsContext* context = paintInfo.context; 57 GraphicsContext* context = paintInfo.context;
58 context->fillRect(borderRect, m_renderFrameSet.frameSet()->hasBorderColor() ? m_renderFrameSet.resolveColor(CSSPropertyBorderLeftColor) : borderFillColor()) ; 58 context->fillRect(borderRect, m_layoutFrameSet.frameSet()->hasBorderColor() ? m_layoutFrameSet.resolveColor(CSSPropertyBorderLeftColor) : borderFillColor()) ;
59 59
60 // Now stroke the edges but only if we have enough room to paint both edges with a little 60 // Now stroke the edges but only if we have enough room to paint both edges with a little
61 // bit of the fill color showing through. 61 // bit of the fill color showing through.
62 if (borderRect.height() >= 3) { 62 if (borderRect.height() >= 3) {
63 context->fillRect(IntRect(borderRect.location(), IntSize(m_renderFrameSe t.size().width(), 1)), borderStartEdgeColor()); 63 context->fillRect(IntRect(borderRect.location(), IntSize(m_layoutFrameSe t.size().width(), 1)), borderStartEdgeColor());
64 context->fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1 ), IntSize(m_renderFrameSet.size().width(), 1)), borderEndEdgeColor()); 64 context->fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1 ), IntSize(m_layoutFrameSet.size().width(), 1)), borderEndEdgeColor());
65 } 65 }
66 } 66 }
67 67
68 void FrameSetPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset) 68 void FrameSetPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint Offset)
69 { 69 {
70 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderFrameSet); 70 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutFrameSet);
71 71
72 if (paintInfo.phase != PaintPhaseForeground) 72 if (paintInfo.phase != PaintPhaseForeground)
73 return; 73 return;
74 74
75 LayoutObject* child = m_renderFrameSet.firstChild(); 75 LayoutObject* child = m_layoutFrameSet.firstChild();
76 if (!child) 76 if (!child)
77 return; 77 return;
78 78
79 LayoutPoint adjustedPaintOffset = paintOffset + m_renderFrameSet.location(); 79 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location();
80 80
81 size_t rows = m_renderFrameSet.rows().m_sizes.size(); 81 size_t rows = m_layoutFrameSet.rows().m_sizes.size();
82 size_t cols = m_renderFrameSet.columns().m_sizes.size(); 82 size_t cols = m_layoutFrameSet.columns().m_sizes.size();
83 LayoutUnit borderThickness = m_renderFrameSet.frameSet()->border(); 83 LayoutUnit borderThickness = m_layoutFrameSet.frameSet()->border();
84 84
85 LayoutUnit yPos = 0; 85 LayoutUnit yPos = 0;
86 for (size_t r = 0; r < rows; r++) { 86 for (size_t r = 0; r < rows; r++) {
87 LayoutUnit xPos = 0; 87 LayoutUnit xPos = 0;
88 for (size_t c = 0; c < cols; c++) { 88 for (size_t c = 0; c < cols; c++) {
89 child->paint(paintInfo, adjustedPaintOffset); 89 child->paint(paintInfo, adjustedPaintOffset);
90 xPos += m_renderFrameSet.columns().m_sizes[c]; 90 xPos += m_layoutFrameSet.columns().m_sizes[c];
91 if (borderThickness && m_renderFrameSet.columns().m_allowBorder[c + 1]) { 91 if (borderThickness && m_layoutFrameSet.columns().m_allowBorder[c + 1]) {
92 paintColumnBorder(paintInfo, pixelSnappedIntRect( 92 paintColumnBorder(paintInfo, pixelSnappedIntRect(
93 LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffs et.y() + yPos, borderThickness, m_renderFrameSet.size().height()))); 93 LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffs et.y() + yPos, borderThickness, m_layoutFrameSet.size().height())));
94 xPos += borderThickness; 94 xPos += borderThickness;
95 } 95 }
96 child = child->nextSibling(); 96 child = child->nextSibling();
97 if (!child) 97 if (!child)
98 return; 98 return;
99 } 99 }
100 yPos += m_renderFrameSet.rows().m_sizes[r]; 100 yPos += m_layoutFrameSet.rows().m_sizes[r];
101 if (borderThickness && m_renderFrameSet.rows().m_allowBorder[r + 1]) { 101 if (borderThickness && m_layoutFrameSet.rows().m_allowBorder[r + 1]) {
102 paintRowBorder(paintInfo, pixelSnappedIntRect( 102 paintRowBorder(paintInfo, pixelSnappedIntRect(
103 LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yP os, m_renderFrameSet.size().width(), borderThickness))); 103 LayoutRect(adjustedPaintOffset.x(), adjustedPaintOffset.y() + yP os, m_layoutFrameSet.size().width(), borderThickness)));
104 yPos += borderThickness; 104 yPos += borderThickness;
105 } 105 }
106 } 106 }
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/FrameSetPainter.h ('k') | Source/core/rendering/RenderFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698