layout/base/nsDisplayListInvalidation.cpp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     4  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsDisplayListInvalidation.h"
     7 #include "nsDisplayList.h"
     8 #include "nsIFrame.h"
    10 nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
    11 {
    12   MOZ_COUNT_CTOR(nsDisplayItemGeometry);
    13   bool snap;
    14   mBounds = aItem->GetBounds(aBuilder, &snap);
    15 }
    17 nsDisplayItemGeometry::~nsDisplayItemGeometry()
    18 {
    19   MOZ_COUNT_DTOR(nsDisplayItemGeometry);
    20 }
    22 nsDisplayItemGenericGeometry::nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
    23   : nsDisplayItemGeometry(aItem, aBuilder)
    24   , mBorderRect(aItem->GetBorderRect())
    25 {}
    27 void
    28 nsDisplayItemGenericGeometry::MoveBy(const nsPoint& aOffset)
    29 {
    30   mBounds.MoveBy(aOffset);
    31   mBorderRect.MoveBy(aOffset);
    32 }
    34 nsDisplayItemBoundsGeometry::nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
    35   : nsDisplayItemGeometry(aItem, aBuilder)
    36 {
    37   nscoord radii[8];
    38   mHasRoundedCorners = aItem->Frame()->GetBorderRadii(radii);
    39 }
    41 void
    42 nsDisplayItemBoundsGeometry::MoveBy(const nsPoint& aOffset)
    43 {
    44   mBounds.MoveBy(aOffset);
    45 }
    47 nsDisplayBorderGeometry::nsDisplayBorderGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
    48   : nsDisplayItemGeometry(aItem, aBuilder)
    49   , mContentRect(aItem->GetContentRect())
    50 {}
    52 void
    53 nsDisplayBorderGeometry::MoveBy(const nsPoint& aOffset)
    54 {
    55   mBounds.MoveBy(aOffset);
    56   mContentRect.MoveBy(aOffset);
    57 }
    59 nsDisplayBackgroundGeometry::nsDisplayBackgroundGeometry(nsDisplayBackgroundImage* aItem,
    60                                                          nsDisplayListBuilder* aBuilder)
    61   : nsDisplayItemGeometry(aItem, aBuilder)
    62   , mPositioningArea(aItem->GetPositioningArea())
    63 {}
    65 void
    66 nsDisplayBackgroundGeometry::MoveBy(const nsPoint& aOffset)
    67 {
    68   mBounds.MoveBy(aOffset);
    69   mPositioningArea.MoveBy(aOffset);
    70 }
    72 nsDisplayThemedBackgroundGeometry::nsDisplayThemedBackgroundGeometry(nsDisplayThemedBackground* aItem,
    73                                                                      nsDisplayListBuilder* aBuilder)
    74   : nsDisplayItemGeometry(aItem, aBuilder)
    75   , mPositioningArea(aItem->GetPositioningArea())
    76   , mWindowIsActive(aItem->IsWindowActive())
    77 {}
    79 void
    80 nsDisplayThemedBackgroundGeometry::MoveBy(const nsPoint& aOffset)
    81 {
    82   mBounds.MoveBy(aOffset);
    83   mPositioningArea.MoveBy(aOffset);
    84 }
    86 nsDisplayBoxShadowInnerGeometry::nsDisplayBoxShadowInnerGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
    87   : nsDisplayItemGeometry(aItem, aBuilder)
    88   , mPaddingRect(aItem->GetPaddingRect())
    89 {}
    91 void
    92 nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset)
    93 {
    94   mBounds.MoveBy(aOffset);
    95   mPaddingRect.MoveBy(aOffset);
    96 }

mercurial