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

Unified Diff: sky/engine/core/rendering/RenderObject.h

Issue 856563006: Remove background obscuration checks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.h ('k') | sky/engine/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderObject.h
diff --git a/sky/engine/core/rendering/RenderObject.h b/sky/engine/core/rendering/RenderObject.h
index fff79736b3b4ee2c97770e9d1e995e6d27195d52..b262ea1e8008d0c829311d62f81c8ae8e9a90b24 100644
--- a/sky/engine/core/rendering/RenderObject.h
+++ b/sky/engine/core/rendering/RenderObject.h
@@ -342,17 +342,7 @@ public:
bool hasLayer() const { return m_bitfields.hasLayer(); }
- // "Box decoration background" includes all box decorations and backgrounds
- // that are painted as the background of the object. It includes borders,
- // box-shadows, background-color and background-image, etc.
- enum BoxDecorationBackgroundState {
- NoBoxDecorationBackground,
- HasBoxDecorationBackgroundObscurationStatusInvalid,
- HasBoxDecorationBackgroundKnownToBeObscured,
- HasBoxDecorationBackgroundMayBeVisible,
- };
- bool hasBoxDecorationBackground() const { return m_bitfields.boxDecorationBackgroundState() != NoBoxDecorationBackground; }
- bool boxDecorationBackgroundIsKnownToBeObscured();
+ bool hasBoxDecorationBackground() const { return m_bitfields.hasBoxDecorationBackground(); }
bool canRenderBorderImage() const;
bool hasBackground() const { return style()->hasBackground(); }
bool hasEntirelyFixedBackground() const;
@@ -445,16 +435,13 @@ public:
void setInline(bool isInline) { m_bitfields.setIsInline(isInline); }
- void setHasBoxDecorationBackground(bool);
- void invalidateBackgroundObscurationStatus();
- virtual bool computeBackgroundIsKnownToBeObscured() { return false; }
-
void setIsText() { m_bitfields.setIsText(true); }
void setIsBox() { m_bitfields.setIsBox(true); }
void setReplaced(bool isReplaced) { m_bitfields.setIsReplaced(isReplaced); }
void setHasOverflowClip(bool hasOverflowClip) { m_bitfields.setHasOverflowClip(hasOverflowClip); }
void setHasLayer(bool hasLayer) { m_bitfields.setHasLayer(hasLayer); }
void setHasTransform(bool hasTransform) { m_bitfields.setHasTransform(hasTransform); }
+ void setHasBoxDecorationBackground(bool b) { m_bitfields.setHasBoxDecorationBackground(b); }
void scheduleRelayout();
@@ -782,12 +769,12 @@ private:
, m_hasLayer(false)
, m_hasOverflowClip(false)
, m_hasTransform(false)
+ , m_hasBoxDecorationBackground(false)
, m_everHadLayout(false)
, m_ancestorLineBoxDirty(false)
, m_alwaysCreateLineBoxesForRenderInline(false)
, m_positionedState(IsStaticallyPositioned)
, m_selectionState(SelectionNone)
- , m_boxDecorationBackgroundState(NoBoxDecorationBackground)
{
}
@@ -813,6 +800,7 @@ private:
ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer);
ADD_BOOLEAN_BITFIELD(hasOverflowClip, HasOverflowClip); // Set in the case of overflow:auto/scroll/hidden
ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform);
+ ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, HasBoxDecorationBackground);
ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout);
ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty);
@@ -823,7 +811,6 @@ private:
private:
unsigned m_positionedState : 2; // PositionedState
unsigned m_selectionState : 3; // SelectionState
- unsigned m_boxDecorationBackgroundState : 2; // BoxDecorationBackgroundState
public:
bool isOutOfFlowPositioned() const { return m_positionedState == IsOutOfFlowPositioned; }
@@ -838,9 +825,6 @@ private:
ALWAYS_INLINE SelectionState selectionState() const { return static_cast<SelectionState>(m_selectionState); }
ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { m_selectionState = selectionState; }
-
- ALWAYS_INLINE BoxDecorationBackgroundState boxDecorationBackgroundState() const { return static_cast<BoxDecorationBackgroundState>(m_boxDecorationBackgroundState); }
- ALWAYS_INLINE void setBoxDecorationBackgroundState(BoxDecorationBackgroundState s) { m_boxDecorationBackgroundState = s; }
};
#undef ADD_BOOLEAN_BITFIELD
@@ -933,33 +917,6 @@ inline void RenderObject::setSelectionStateIfNeeded(SelectionState state)
setSelectionState(state);
}
-inline void RenderObject::setHasBoxDecorationBackground(bool b)
-{
- if (!b) {
- m_bitfields.setBoxDecorationBackgroundState(NoBoxDecorationBackground);
- return;
- }
- if (hasBoxDecorationBackground())
- return;
- m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscurationStatusInvalid);
-}
-
-inline void RenderObject::invalidateBackgroundObscurationStatus()
-{
- if (!hasBoxDecorationBackground())
- return;
- m_bitfields.setBoxDecorationBackgroundState(HasBoxDecorationBackgroundObscurationStatusInvalid);
-}
-
-inline bool RenderObject::boxDecorationBackgroundIsKnownToBeObscured()
-{
- if (m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgroundObscurationStatusInvalid) {
- BoxDecorationBackgroundState state = computeBackgroundIsKnownToBeObscured() ? HasBoxDecorationBackgroundKnownToBeObscured : HasBoxDecorationBackgroundMayBeVisible;
- m_bitfields.setBoxDecorationBackgroundState(state);
- }
- return m_bitfields.boxDecorationBackgroundState() == HasBoxDecorationBackgroundKnownToBeObscured;
-}
-
inline void makeMatrixRenderable(TransformationMatrix& matrix)
{
// FIXME(sky): We shouldn't need to do this once Skia has 4x4 matrix support.
« no previous file with comments | « sky/engine/core/rendering/RenderLayerModelObject.h ('k') | sky/engine/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698