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

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

Issue 559733005: Move painting code from RenderBoxModelObject into BoxPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged. Created 6 years, 3 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/BackgroundImageGeometry.h ('k') | Source/core/paint/BoxPainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/BackgroundImageGeometry.h"
7
8 namespace blink {
9
10 void BackgroundImageGeometry::setNoRepeatX(int xOffset)
11 {
12 m_destRect.move(std::max(xOffset, 0), 0);
13 m_phase.setX(-std::min(xOffset, 0));
14 m_destRect.setWidth(m_tileSize.width() + std::min(xOffset, 0));
15 }
16 void BackgroundImageGeometry::setNoRepeatY(int yOffset)
17 {
18 m_destRect.move(0, std::max(yOffset, 0));
19 m_phase.setY(-std::min(yOffset, 0));
20 m_destRect.setHeight(m_tileSize.height() + std::min(yOffset, 0));
21 }
22
23 void BackgroundImageGeometry::useFixedAttachment(const IntPoint& attachmentPoint )
24 {
25 IntPoint alignedPoint = attachmentPoint;
26 m_phase.move(std::max(alignedPoint.x() - m_destRect.x(), 0), std::max(aligne dPoint.y() - m_destRect.y(), 0));
27 }
28
29 void BackgroundImageGeometry::clip(const IntRect& clipRect)
30 {
31 m_destRect.intersect(clipRect);
32 }
33
34 IntPoint BackgroundImageGeometry::relativePhase() const
35 {
36 IntPoint phase = m_phase;
37 phase += m_destRect.location() - m_destOrigin;
38 return phase;
39 }
40
41 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BackgroundImageGeometry.h ('k') | Source/core/paint/BoxPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698