| Index: Source/core/paint/BackgroundImageGeometry.h
|
| diff --git a/Source/core/paint/BackgroundImageGeometry.h b/Source/core/paint/BackgroundImageGeometry.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4f9fe191a4e8b9968a07215b349f6fba52c8bfcf
|
| --- /dev/null
|
| +++ b/Source/core/paint/BackgroundImageGeometry.h
|
| @@ -0,0 +1,79 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BackgroundImageGeometry_h
|
| +#define BackgroundImageGeometry_h
|
| +
|
| +#include "platform/geometry/IntPoint.h"
|
| +#include "platform/geometry/IntRect.h"
|
| +#include "platform/geometry/IntSize.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class BackgroundImageGeometry {
|
| +public:
|
| + BackgroundImageGeometry()
|
| + : m_hasNonLocalGeometry(false)
|
| + { }
|
| +
|
| + IntPoint destOrigin() const { return m_destOrigin; }
|
| + void setDestOrigin(const IntPoint& destOrigin)
|
| + {
|
| + m_destOrigin = destOrigin;
|
| + }
|
| +
|
| + IntRect destRect() const { return m_destRect; }
|
| + void setDestRect(const IntRect& destRect)
|
| + {
|
| + m_destRect = destRect;
|
| + }
|
| +
|
| + // Returns the phase relative to the destination rectangle.
|
| + IntPoint relativePhase() const;
|
| +
|
| + IntPoint phase() const { return m_phase; }
|
| + void setPhase(const IntPoint& phase)
|
| + {
|
| + m_phase = phase;
|
| + }
|
| +
|
| + IntSize tileSize() const { return m_tileSize; }
|
| + void setTileSize(const IntSize& tileSize)
|
| + {
|
| + m_tileSize = tileSize;
|
| + }
|
| +
|
| + // Space-size represents extra width and height that may be added to
|
| + // the image if used as a pattern with repeat: space
|
| + IntSize spaceSize() const { return m_repeatSpacing; }
|
| + void setSpaceSize(const IntSize& repeatSpacing)
|
| + {
|
| + m_repeatSpacing = repeatSpacing;
|
| + }
|
| +
|
| + void setPhaseX(int x) { m_phase.setX(x); }
|
| + void setPhaseY(int y) { m_phase.setY(y); }
|
| +
|
| + void setNoRepeatX(int xOffset);
|
| + void setNoRepeatY(int yOffset);
|
| +
|
| + void useFixedAttachment(const IntPoint& attachmentPoint);
|
| +
|
| + void clip(const IntRect&);
|
| +
|
| + void setHasNonLocalGeometry(bool hasNonLocalGeometry = true) { m_hasNonLocalGeometry = hasNonLocalGeometry; }
|
| + bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; }
|
| +
|
| +private:
|
| + IntRect m_destRect;
|
| + IntPoint m_destOrigin;
|
| + IntPoint m_phase;
|
| + IntSize m_tileSize;
|
| + IntSize m_repeatSpacing;
|
| + bool m_hasNonLocalGeometry; // Has background-attachment: fixed. Implies that we can't always cheaply compute destRect.
|
| +};
|
| +
|
| +#endif // BackgroundImageGeometry_h
|
| +
|
| +} // namespace blink
|
|
|