| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 // Clip to the overflow area. | 434 // Clip to the overflow area. |
| 435 RenderBox* thisBox = toRenderBox(this); | 435 RenderBox* thisBox = toRenderBox(this); |
| 436 context->clip(thisBox->overflowClipRect(rect.location())); | 436 context->clip(thisBox->overflowClipRect(rect.location())); |
| 437 | 437 |
| 438 // Adjust the paint rect to reflect a scrolled content box with borders
at the ends. | 438 // Adjust the paint rect to reflect a scrolled content box with borders
at the ends. |
| 439 scrolledPaintRect.setWidth(bLeft + thisBox->clientWidth() + bRight); | 439 scrolledPaintRect.setWidth(bLeft + thisBox->clientWidth() + bRight); |
| 440 scrolledPaintRect.setHeight(borderTop() + thisBox->clientHeight() + bord
erBottom()); | 440 scrolledPaintRect.setHeight(borderTop() + thisBox->clientHeight() + bord
erBottom()); |
| 441 } | 441 } |
| 442 | 442 |
| 443 GraphicsContextStateSaver backgroundClipStateSaver(*context, false); | 443 GraphicsContextStateSaver backgroundClipStateSaver(*context, false); |
| 444 IntRect maskRect; | |
| 445 | 444 |
| 446 switch (bgLayer.clip()) { | 445 switch (bgLayer.clip()) { |
| 447 case PaddingFillBox: | 446 case PaddingFillBox: |
| 448 case ContentFillBox: { | 447 case ContentFillBox: { |
| 449 if (clipToBorderRadius) | 448 if (clipToBorderRadius) |
| 450 break; | 449 break; |
| 451 | 450 |
| 452 // Clip to the padding or content boxes as necessary. | 451 // Clip to the padding or content boxes as necessary. |
| 453 bool includePadding = bgLayer.clip() == ContentFillBox; | 452 bool includePadding = bgLayer.clip() == ContentFillBox; |
| 454 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includ
ePadding ? pLeft : LayoutUnit()), | 453 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includ
ePadding ? pLeft : LayoutUnit()), |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // no progressive loading of the background image | 492 // no progressive loading of the background image |
| 494 if (shouldPaintBackgroundImage) { | 493 if (shouldPaintBackgroundImage) { |
| 495 BackgroundImageGeometry geometry; | 494 BackgroundImageGeometry geometry; |
| 496 calculateBackgroundImageGeometry(paintInfo.paintContainer(), bgLayer, sc
rolledPaintRect, geometry, backgroundObject); | 495 calculateBackgroundImageGeometry(paintInfo.paintContainer(), bgLayer, sc
rolledPaintRect, geometry, backgroundObject); |
| 497 geometry.clip(paintInfo.rect); | 496 geometry.clip(paintInfo.rect); |
| 498 if (!geometry.destRect().isEmpty()) { | 497 if (!geometry.destRect().isEmpty()) { |
| 499 // FIXME(sky): Is it possible for the bgLayer to be something other
that CompositeSourceOver? | 498 // FIXME(sky): Is it possible for the bgLayer to be something other
that CompositeSourceOver? |
| 500 CompositeOperator compositeOp = bgLayer.composite(); | 499 CompositeOperator compositeOp = bgLayer.composite(); |
| 501 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou
ndObject : this; | 500 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou
ndObject : this; |
| 502 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome
try.tileSize()); | 501 RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geome
try.tileSize()); |
| 503 if (bgLayer.maskSourceType() == MaskLuminance) | |
| 504 context->setColorFilter(ColorFilterLuminanceToAlpha); | |
| 505 InterpolationQuality previousInterpolationQuality = context->imageIn
terpolationQuality(); | 502 InterpolationQuality previousInterpolationQuality = context->imageIn
terpolationQuality(); |
| 506 context->setImageInterpolationQuality(InterpolationLow); | 503 context->setImageInterpolationQuality(InterpolationLow); |
| 507 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r
elativePhase(), geometry.tileSize(), | 504 context->drawTiledImage(image.get(), geometry.destRect(), geometry.r
elativePhase(), geometry.tileSize(), |
| 508 compositeOp, bgLayer.blendMode(), geometry.spaceSize()); | 505 compositeOp, bgLayer.blendMode(), geometry.spaceSize()); |
| 509 context->setImageInterpolationQuality(previousInterpolationQuality); | 506 context->setImageInterpolationQuality(previousInterpolationQuality); |
| 510 } | 507 } |
| 511 } | 508 } |
| 512 } | 509 } |
| 513 | 510 |
| 514 static inline int resolveWidthForRatio(int height, const FloatSize& intrinsicRat
io) | 511 static inline int resolveWidthForRatio(int height, const FloatSize& intrinsicRat
io) |
| (...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2461 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2458 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2462 for (RenderObject* child = slowFirstChild(); child; ) { | 2459 for (RenderObject* child = slowFirstChild(); child; ) { |
| 2463 // Save our next sibling as moveChildTo will clear it. | 2460 // Save our next sibling as moveChildTo will clear it. |
| 2464 RenderObject* nextSibling = child->nextSibling(); | 2461 RenderObject* nextSibling = child->nextSibling(); |
| 2465 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2462 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2466 child = nextSibling; | 2463 child = nextSibling; |
| 2467 } | 2464 } |
| 2468 } | 2465 } |
| 2469 | 2466 |
| 2470 } // namespace blink | 2467 } // namespace blink |
| OLD | NEW |