Bug 949310. r=BenWa

This commit is contained in:
Kartikaya Gupta 2013-12-12 13:34:50 -05:00
parent 0fa48bbcb2
commit f5fa7a6026
6 changed files with 14 additions and 23 deletions

View File

@ -175,7 +175,8 @@ Layer::Layer(LayerManager* aManager, void* aImplData) :
mIsFixedPosition(false),
mMargins(0, 0, 0, 0),
mStickyPositionData(nullptr),
mIsScrollbar(false),
mScrollbarTargetId(FrameMetrics::NULL_SCROLL_ID),
mScrollbarDirection(ScrollDirection::NONE),
mDebugColorIndex(0),
mAnimationGeneration(0)
{}
@ -1268,12 +1269,11 @@ Layer::PrintInfo(nsACString& aTo, const char* aPrefix)
if (GetContentFlags() & CONTENT_COMPONENT_ALPHA) {
aTo += " [componentAlpha]";
}
if (GetIsScrollbar()) {
if (GetScrollbarDirection() == VERTICAL) {
aTo.AppendPrintf(" [vscrollbar=%lld]", GetScrollbarTargetContainerId());
} else {
aTo.AppendPrintf(" [hscrollbar=%lld]", GetScrollbarTargetContainerId());
}
if (GetScrollbarDirection() == VERTICAL) {
aTo.AppendPrintf(" [vscrollbar=%lld]", GetScrollbarTargetContainerId());
}
if (GetScrollbarDirection() == HORIZONTAL) {
aTo.AppendPrintf(" [hscrollbar=%lld]", GetScrollbarTargetContainerId());
}
if (GetIsFixedPosition()) {
aTo.AppendPrintf(" [isFixedPosition anchor=%f,%f]", mAnchor.x, mAnchor.y);

View File

@ -967,6 +967,7 @@ public:
}
enum ScrollDirection {
NONE,
VERTICAL,
HORIZONTAL
};
@ -978,11 +979,9 @@ public:
*/
void SetScrollbarData(FrameMetrics::ViewID aScrollId, ScrollDirection aDir)
{
if (mIsScrollbar ||
mScrollbarTargetId != aScrollId ||
if (mScrollbarTargetId != aScrollId ||
mScrollbarDirection != aDir) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ScrollbarData", this));
mIsScrollbar = true;
mScrollbarTargetId = aScrollId;
mScrollbarDirection = aDir;
Mutated();
@ -1013,7 +1012,6 @@ public:
FrameMetrics::ViewID GetStickyScrollContainerId() { return mStickyPositionData->mScrollId; }
const LayerRect& GetStickyScrollRangeOuter() { return mStickyPositionData->mOuter; }
const LayerRect& GetStickyScrollRangeInner() { return mStickyPositionData->mInner; }
bool GetIsScrollbar() { return mIsScrollbar; }
FrameMetrics::ViewID GetScrollbarTargetContainerId() { return mScrollbarTargetId; }
ScrollDirection GetScrollbarDirection() { return mScrollbarDirection; }
Layer* GetMaskLayer() const { return mMaskLayer; }
@ -1387,7 +1385,6 @@ protected:
LayerRect mInner;
};
nsAutoPtr<StickyPositionData> mStickyPositionData;
bool mIsScrollbar;
FrameMetrics::ViewID mScrollbarTargetId;
ScrollDirection mScrollbarDirection;
DebugOnly<uint32_t> mDebugColorIndex;

View File

@ -525,7 +525,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFram
appliedTransform = true;
}
if (container->GetIsScrollbar()) {
if (container->GetScrollbarDirection() != Layer::NONE) {
ApplyAsyncTransformToScrollbar(container);
}
return appliedTransform;

View File

@ -280,10 +280,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
common.stickyScrollRangeOuter(),
common.stickyScrollRangeInner());
}
if (common.isScrollbar()) {
layer->SetScrollbarData(common.scrollbarTargetContainerId(),
static_cast<Layer::ScrollDirection>(common.scrollbarDirection()));
}
layer->SetScrollbarData(common.scrollbarTargetContainerId(),
static_cast<Layer::ScrollDirection>(common.scrollbarDirection()));
if (PLayerParent* maskLayer = common.maskLayerParent()) {
layer->SetMaskLayer(cast(maskLayer)->AsLayer());
} else {

View File

@ -198,7 +198,6 @@ struct CommonLayerAttributes {
uint64_t stickyScrollContainerId;
LayerRect stickyScrollRangeOuter;
LayerRect stickyScrollRangeInner;
bool isScrollbar;
uint64_t scrollbarTargetContainerId;
uint32_t scrollbarDirection;
nullable PLayer maskLayer;

View File

@ -501,11 +501,8 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies, bool
common.stickyScrollRangeOuter() = mutant->GetStickyScrollRangeOuter();
common.stickyScrollRangeInner() = mutant->GetStickyScrollRangeInner();
}
common.isScrollbar() = mutant->GetIsScrollbar();
if (mutant->GetIsScrollbar()) {
common.scrollbarTargetContainerId() = mutant->GetScrollbarTargetContainerId();
common.scrollbarDirection() = mutant->GetScrollbarDirection();
}
common.scrollbarTargetContainerId() = mutant->GetScrollbarTargetContainerId();
common.scrollbarDirection() = mutant->GetScrollbarDirection();
if (Layer* maskLayer = mutant->GetMaskLayer()) {
common.maskLayerChild() = Shadow(maskLayer->AsShadowableLayer());
} else {