1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/nsDisplayListInvalidation.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 +/*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsDisplayListInvalidation.h" 1.10 +#include "nsDisplayList.h" 1.11 +#include "nsIFrame.h" 1.12 + 1.13 +nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) 1.14 +{ 1.15 + MOZ_COUNT_CTOR(nsDisplayItemGeometry); 1.16 + bool snap; 1.17 + mBounds = aItem->GetBounds(aBuilder, &snap); 1.18 +} 1.19 + 1.20 +nsDisplayItemGeometry::~nsDisplayItemGeometry() 1.21 +{ 1.22 + MOZ_COUNT_DTOR(nsDisplayItemGeometry); 1.23 +} 1.24 + 1.25 +nsDisplayItemGenericGeometry::nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) 1.26 + : nsDisplayItemGeometry(aItem, aBuilder) 1.27 + , mBorderRect(aItem->GetBorderRect()) 1.28 +{} 1.29 + 1.30 +void 1.31 +nsDisplayItemGenericGeometry::MoveBy(const nsPoint& aOffset) 1.32 +{ 1.33 + mBounds.MoveBy(aOffset); 1.34 + mBorderRect.MoveBy(aOffset); 1.35 +} 1.36 + 1.37 +nsDisplayItemBoundsGeometry::nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) 1.38 + : nsDisplayItemGeometry(aItem, aBuilder) 1.39 +{ 1.40 + nscoord radii[8]; 1.41 + mHasRoundedCorners = aItem->Frame()->GetBorderRadii(radii); 1.42 +} 1.43 + 1.44 +void 1.45 +nsDisplayItemBoundsGeometry::MoveBy(const nsPoint& aOffset) 1.46 +{ 1.47 + mBounds.MoveBy(aOffset); 1.48 +} 1.49 + 1.50 +nsDisplayBorderGeometry::nsDisplayBorderGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) 1.51 + : nsDisplayItemGeometry(aItem, aBuilder) 1.52 + , mContentRect(aItem->GetContentRect()) 1.53 +{} 1.54 + 1.55 +void 1.56 +nsDisplayBorderGeometry::MoveBy(const nsPoint& aOffset) 1.57 +{ 1.58 + mBounds.MoveBy(aOffset); 1.59 + mContentRect.MoveBy(aOffset); 1.60 +} 1.61 + 1.62 +nsDisplayBackgroundGeometry::nsDisplayBackgroundGeometry(nsDisplayBackgroundImage* aItem, 1.63 + nsDisplayListBuilder* aBuilder) 1.64 + : nsDisplayItemGeometry(aItem, aBuilder) 1.65 + , mPositioningArea(aItem->GetPositioningArea()) 1.66 +{} 1.67 + 1.68 +void 1.69 +nsDisplayBackgroundGeometry::MoveBy(const nsPoint& aOffset) 1.70 +{ 1.71 + mBounds.MoveBy(aOffset); 1.72 + mPositioningArea.MoveBy(aOffset); 1.73 +} 1.74 + 1.75 +nsDisplayThemedBackgroundGeometry::nsDisplayThemedBackgroundGeometry(nsDisplayThemedBackground* aItem, 1.76 + nsDisplayListBuilder* aBuilder) 1.77 + : nsDisplayItemGeometry(aItem, aBuilder) 1.78 + , mPositioningArea(aItem->GetPositioningArea()) 1.79 + , mWindowIsActive(aItem->IsWindowActive()) 1.80 +{} 1.81 + 1.82 +void 1.83 +nsDisplayThemedBackgroundGeometry::MoveBy(const nsPoint& aOffset) 1.84 +{ 1.85 + mBounds.MoveBy(aOffset); 1.86 + mPositioningArea.MoveBy(aOffset); 1.87 +} 1.88 + 1.89 +nsDisplayBoxShadowInnerGeometry::nsDisplayBoxShadowInnerGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) 1.90 + : nsDisplayItemGeometry(aItem, aBuilder) 1.91 + , mPaddingRect(aItem->GetPaddingRect()) 1.92 +{} 1.93 + 1.94 +void 1.95 +nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset) 1.96 +{ 1.97 + mBounds.MoveBy(aOffset); 1.98 + mPaddingRect.MoveBy(aOffset); 1.99 +} 1.100 +