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

Unified Diff: Source/core/paint/BackgroundImageGeometry.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BackgroundImageGeometry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BackgroundImageGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698