コード例 #1
0
  virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
                                            bool& aGeometryChanged)
  {
    ImageLayer* imageLayer = static_cast<ImageLayer*>(mLayer.get());
    
    if (!imageLayer->GetVisibleRegion().IsEqual(mVisibleRegion)) {
      aGeometryChanged = true;
      IntRect result = NewTransformedBounds();
      result = result.Union(OldTransformedBounds());
      return result;
    }

    ImageContainer* container = imageLayer->GetContainer();
    if (mContainer != container ||
        mFilter != imageLayer->GetFilter() ||
        mScaleToSize != imageLayer->GetScaleToSize() ||
        mScaleMode != imageLayer->GetScaleMode()) {
      aGeometryChanged = true;

      if (mIsMask) {
        // Mask layers have an empty visible region, so we have to
        // use the image size instead.
        IntSize size = container->GetCurrentSize();
        IntRect rect(0, 0, size.width, size.height);
        return TransformRect(rect, mLayer->GetLocalTransform());

      } else {
        return NewTransformedBounds();
      }
    }

    return IntRect();
  }
コード例 #2
0
    virtual nsIntRect ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback)
    {
        ImageLayer* image = static_cast<ImageLayer*>(mLayer);

        if (!image->GetVisibleRegion().IsEqual(mVisibleRegion)) {
            nsIntRect result = NewTransformedBounds();
            result = result.Union(OldTransformedBounds());
            return result;
        }

        if (mContainer != image->GetContainer() ||
                mFilter != image->GetFilter() ||
                mScaleToSize != image->GetScaleToSize() ||
                mScaleMode != image->GetScaleMode()) {
            return NewTransformedBounds();
        }

        return nsIntRect();
    }