michael@0: /*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsDisplayListInvalidation.h" michael@0: #include "nsDisplayList.h" michael@0: #include "nsIFrame.h" michael@0: michael@0: nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) michael@0: { michael@0: MOZ_COUNT_CTOR(nsDisplayItemGeometry); michael@0: bool snap; michael@0: mBounds = aItem->GetBounds(aBuilder, &snap); michael@0: } michael@0: michael@0: nsDisplayItemGeometry::~nsDisplayItemGeometry() michael@0: { michael@0: MOZ_COUNT_DTOR(nsDisplayItemGeometry); michael@0: } michael@0: michael@0: nsDisplayItemGenericGeometry::nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: , mBorderRect(aItem->GetBorderRect()) michael@0: {} michael@0: michael@0: void michael@0: nsDisplayItemGenericGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: mBorderRect.MoveBy(aOffset); michael@0: } michael@0: michael@0: nsDisplayItemBoundsGeometry::nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: { michael@0: nscoord radii[8]; michael@0: mHasRoundedCorners = aItem->Frame()->GetBorderRadii(radii); michael@0: } michael@0: michael@0: void michael@0: nsDisplayItemBoundsGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: } michael@0: michael@0: nsDisplayBorderGeometry::nsDisplayBorderGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: , mContentRect(aItem->GetContentRect()) michael@0: {} michael@0: michael@0: void michael@0: nsDisplayBorderGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: mContentRect.MoveBy(aOffset); michael@0: } michael@0: michael@0: nsDisplayBackgroundGeometry::nsDisplayBackgroundGeometry(nsDisplayBackgroundImage* aItem, michael@0: nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: , mPositioningArea(aItem->GetPositioningArea()) michael@0: {} michael@0: michael@0: void michael@0: nsDisplayBackgroundGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: mPositioningArea.MoveBy(aOffset); michael@0: } michael@0: michael@0: nsDisplayThemedBackgroundGeometry::nsDisplayThemedBackgroundGeometry(nsDisplayThemedBackground* aItem, michael@0: nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: , mPositioningArea(aItem->GetPositioningArea()) michael@0: , mWindowIsActive(aItem->IsWindowActive()) michael@0: {} michael@0: michael@0: void michael@0: nsDisplayThemedBackgroundGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: mPositioningArea.MoveBy(aOffset); michael@0: } michael@0: michael@0: nsDisplayBoxShadowInnerGeometry::nsDisplayBoxShadowInnerGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) michael@0: : nsDisplayItemGeometry(aItem, aBuilder) michael@0: , mPaddingRect(aItem->GetPaddingRect()) michael@0: {} michael@0: michael@0: void michael@0: nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset) michael@0: { michael@0: mBounds.MoveBy(aOffset); michael@0: mPaddingRect.MoveBy(aOffset); michael@0: } michael@0: