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

Side by Side Diff: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.h

Issue 2600903002: Paint the whole of a table-part background image behind the cells in a table (Closed)
Patch Set: Paint the whole of an image behind the cells in a table Created 3 years, 11 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
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 #ifndef BackgroundImageGeometry_h 5 #ifndef BackgroundImageGeometry_h
6 #define BackgroundImageGeometry_h 6 #define BackgroundImageGeometry_h
7 7
8 #include "core/paint/PaintPhase.h" 8 #include "core/paint/PaintPhase.h"
9 #include "platform/geometry/LayoutPoint.h" 9 #include "platform/geometry/LayoutPoint.h"
10 #include "platform/geometry/LayoutRect.h" 10 #include "platform/geometry/LayoutRect.h"
11 #include "platform/geometry/LayoutSize.h" 11 #include "platform/geometry/LayoutSize.h"
12 #include "wtf/Allocator.h" 12 #include "wtf/Allocator.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class FillLayer; 16 class FillLayer;
17 class LayoutBox;
17 class LayoutBoxModelObject; 18 class LayoutBoxModelObject;
19 class LayoutObject;
18 class LayoutRect; 20 class LayoutRect;
21 class LayoutTableCell;
19 22
20 class BackgroundImageGeometry { 23 class BackgroundImageGeometry {
21 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 24 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
22 25
23 public: 26 public:
24 BackgroundImageGeometry() : m_hasNonLocalGeometry(false) {} 27 BackgroundImageGeometry() : m_hasNonLocalGeometry(false) {}
25 28
26 void calculate(const LayoutBoxModelObject&, 29 void calculate(const LayoutBoxModelObject&,
30 const LayoutObject* backgroundObject,
27 const LayoutBoxModelObject* paintContainer, 31 const LayoutBoxModelObject* paintContainer,
28 const GlobalPaintFlags, 32 const GlobalPaintFlags,
29 const FillLayer&, 33 const FillLayer&,
30 const LayoutRect& paintRect); 34 const LayoutRect& paintRect);
31 35
32 // destRect() is the rect in the space of the containing box into which to 36 // destRect() is the rect in the space of the containing box into which to
33 // draw the image. 37 // draw the image.
34 const LayoutRect& destRect() const { return m_destRect; } 38 const LayoutRect& destRect() const { return m_destRect; }
35 // If the image is repeated via tiling, tileSize() is the size 39 // If the image is repeated via tiling, tileSize() is the size
36 // in pixels of the area into which to draw the entire image once. 40 // in pixels of the area into which to draw the entire image once.
(...skipping 22 matching lines...) Expand all
59 } 63 }
60 void setPhaseX(LayoutUnit x) { m_phase.setX(x); } 64 void setPhaseX(LayoutUnit x) { m_phase.setX(x); }
61 void setPhaseY(LayoutUnit y) { m_phase.setY(y); } 65 void setPhaseY(LayoutUnit y) { m_phase.setY(y); }
62 66
63 void setNoRepeatX(LayoutUnit xOffset); 67 void setNoRepeatX(LayoutUnit xOffset);
64 void setNoRepeatY(LayoutUnit yOffset); 68 void setNoRepeatY(LayoutUnit yOffset);
65 void setRepeatX(const FillLayer&, 69 void setRepeatX(const FillLayer&,
66 LayoutUnit, 70 LayoutUnit,
67 LayoutUnit, 71 LayoutUnit,
68 LayoutUnit, 72 LayoutUnit,
73 LayoutUnit,
69 LayoutUnit); 74 LayoutUnit);
70 void setRepeatY(const FillLayer&, 75 void setRepeatY(const FillLayer&,
71 LayoutUnit, 76 LayoutUnit,
72 LayoutUnit, 77 LayoutUnit,
73 LayoutUnit, 78 LayoutUnit,
79 LayoutUnit,
74 LayoutUnit); 80 LayoutUnit);
75 void setSpaceX(LayoutUnit, LayoutUnit, LayoutUnit); 81 void setSpaceX(LayoutUnit, LayoutUnit, LayoutUnit);
76 void setSpaceY(LayoutUnit, LayoutUnit, LayoutUnit); 82 void setSpaceY(LayoutUnit, LayoutUnit, LayoutUnit);
77 83
78 void useFixedAttachment(const LayoutPoint& attachmentPoint); 84 void useFixedAttachment(const LayoutPoint& attachmentPoint);
79 void setHasNonLocalGeometry() { m_hasNonLocalGeometry = true; } 85 void setHasNonLocalGeometry() { m_hasNonLocalGeometry = true; }
86 LayoutPoint getOffsetForCell(const LayoutTableCell&, const LayoutBox&);
87 LayoutSize getBackgroundObjectDimensions(const LayoutTableCell&,
88 const LayoutBox&);
80 89
81 // TODO(schenney): Convert these to IntPoints for values that we snap 90 // TODO(schenney): Convert these to IntPoints for values that we snap
82 LayoutRect m_destRect; 91 LayoutRect m_destRect;
83 LayoutPoint m_phase; 92 LayoutPoint m_phase;
84 LayoutSize m_tileSize; 93 LayoutSize m_tileSize;
85 LayoutSize m_repeatSpacing; 94 LayoutSize m_repeatSpacing;
86 bool m_hasNonLocalGeometry; 95 bool m_hasNonLocalGeometry;
87 }; 96 };
88 97
89 } // namespace blink 98 } // namespace blink
90 99
91 #endif // BackgroundImageGeometry_h 100 #endif // BackgroundImageGeometry_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698