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

Unified Diff: Source/core/rendering/style/RenderStyle.h

Issue 643893002: Store [-webkit-]perspective-origin as a LengthPoint. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
Index: Source/core/rendering/style/RenderStyle.h
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index d698450e81135011d07e2c99d8649da744a27931..7aa6c24ad3e04a85c8a6f6b8fe993aa62000623e 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -60,6 +60,7 @@
#include "core/rendering/style/StyleWillChangeData.h"
#include "platform/Length.h"
#include "platform/LengthBox.h"
+#include "platform/LengthPoint.h"
#include "platform/LengthSize.h"
#include "platform/ThemeTypes.h"
#include "platform/fonts/FontBaseline.h"
@@ -912,8 +913,9 @@ public:
EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
float perspective() const { return rareNonInheritedData->m_perspective; }
bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
- const Length& perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
- const Length& perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
+ const LengthPoint& perspectiveOrigin() const { return rareNonInheritedData->m_perspectiveOrigin; }
+ const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); }
+ const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); }
const LengthSize& pageSize() const { return rareNonInheritedData->m_pageSize; }
PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
@@ -1380,8 +1382,9 @@ public:
void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
- void setPerspectiveOriginX(const Length& l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
- void setPerspectiveOriginY(const Length& l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
+ void setPerspectiveOriginX(const Length& v) { setPerspectiveOrigin(LengthPoint(v, perspectiveOriginY())); }
+ void setPerspectiveOriginY(const Length& v) { setPerspectiveOrigin(LengthPoint(perspectiveOriginX(), v)); }
+ void setPerspectiveOrigin(const LengthPoint& p) { SET_VAR(rareNonInheritedData, m_perspectiveOrigin, p); }
void setPageSize(const LengthSize& s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
@@ -1662,6 +1665,7 @@ public:
static float initialPerspective() { return 0; }
static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
+ static LengthPoint initialPerspectiveOrigin() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
static Color initialBackgroundColor() { return Color::transparent; }
static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }

Powered by Google App Engine
This is Rietveld 408576698