| 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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 StyleImage* styleImage = ninePieceImage.image(); | 991 StyleImage* styleImage = ninePieceImage.image(); |
| 992 if (!styleImage) | 992 if (!styleImage) |
| 993 return false; | 993 return false; |
| 994 | 994 |
| 995 if (!styleImage->isLoaded()) | 995 if (!styleImage->isLoaded()) |
| 996 return true; // Never paint a nine-piece image incrementally, but don't
paint the fallback borders either. | 996 return true; // Never paint a nine-piece image incrementally, but don't
paint the fallback borders either. |
| 997 | 997 |
| 998 if (!styleImage->canRender(*this)) | 998 if (!styleImage->canRender(*this)) |
| 999 return false; | 999 return false; |
| 1000 | 1000 |
| 1001 // FIXME: border-image is broken with full page zooming when tiling has to h
appen, since the tiling function | |
| 1002 // doesn't have any understanding of the zoom that is in effect on the tile. | |
| 1003 LayoutRect rectWithOutsets = rect; | 1001 LayoutRect rectWithOutsets = rect; |
| 1004 rectWithOutsets.expand(style->imageOutsets(ninePieceImage)); | 1002 rectWithOutsets.expand(style->imageOutsets(ninePieceImage)); |
| 1005 IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets); | 1003 IntRect borderImageRect = pixelSnappedIntRect(rectWithOutsets); |
| 1006 | 1004 |
| 1007 IntSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImag
eRect.size()); | 1005 IntSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImag
eRect.size()); |
| 1008 | 1006 |
| 1009 // If both values are ‘auto’ then the intrinsic width and/or height of the i
mage should be used, if any. | 1007 // If both values are ‘auto’ then the intrinsic width and/or height of the i
mage should be used, if any. |
| 1010 styleImage->setContainerSizeForRenderer(this, imageSize); | 1008 styleImage->setContainerSizeForRenderer(this, imageSize); |
| 1011 | 1009 |
| 1012 int imageWidth = imageSize.width(); | 1010 int imageWidth = imageSize.width(); |
| (...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 // of the box itself, which is always pixel-aligned. | 2366 // of the box itself, which is always pixel-aligned. |
| 2369 IntRect rectToClipOut = border.rect(); | 2367 IntRect rectToClipOut = border.rect(); |
| 2370 | 2368 |
| 2371 // If the box is opaque, it is unnecessary to clip it out. H
owever, doing so saves time | 2369 // If the box is opaque, it is unnecessary to clip it out. H
owever, doing so saves time |
| 2372 // when painting the shadow. On the other hand, it introduce
s subpixel gaps along the | 2370 // when painting the shadow. On the other hand, it introduce
s subpixel gaps along the |
| 2373 // edges if they are not pixel-aligned. Those are avoided by
insetting the clipping path | 2371 // edges if they are not pixel-aligned. Those are avoided by
insetting the clipping path |
| 2374 // by one pixel. | 2372 // by one pixel. |
| 2375 if (hasOpaqueBackground) { | 2373 if (hasOpaqueBackground) { |
| 2376 // FIXME: The function to decide on the policy based on
the transform should be a named function. | 2374 // FIXME: The function to decide on the policy based on
the transform should be a named function. |
| 2377 // FIXME: It's not clear if this check is right. What ab
out integral scale factors? | 2375 // FIXME: It's not clear if this check is right. What ab
out integral scale factors? |
| 2378 // FIXME: See crbug.com/382491. The use of getCTM may al
so be wrong because it does not include | |
| 2379 // device zoom applied at raster time. | |
| 2380 AffineTransform transform = context->getCTM(); | 2376 AffineTransform transform = context->getCTM(); |
| 2381 if (transform.a() != 1 || (transform.d() != 1 && transfo
rm.d() != -1) || transform.b() || transform.c()) | 2377 if (transform.a() != 1 || (transform.d() != 1 && transfo
rm.d() != -1) || transform.b() || transform.c()) |
| 2382 rectToClipOut.inflate(-1); | 2378 rectToClipOut.inflate(-1); |
| 2383 } | 2379 } |
| 2384 | 2380 |
| 2385 if (!rectToClipOut.isEmpty()) { | 2381 if (!rectToClipOut.isEmpty()) { |
| 2386 context->clipOut(rectToClipOut); | 2382 context->clipOut(rectToClipOut); |
| 2387 } | 2383 } |
| 2388 } | 2384 } |
| 2389 } | 2385 } |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2607 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2603 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2608 for (RenderObject* child = startChild; child && child != endChild; ) { | 2604 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 2609 // Save our next sibling as moveChildTo will clear it. | 2605 // Save our next sibling as moveChildTo will clear it. |
| 2610 RenderObject* nextSibling = child->nextSibling(); | 2606 RenderObject* nextSibling = child->nextSibling(); |
| 2611 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2607 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2612 child = nextSibling; | 2608 child = nextSibling; |
| 2613 } | 2609 } |
| 2614 } | 2610 } |
| 2615 | 2611 |
| 2616 } // namespace blink | 2612 } // namespace blink |
| OLD | NEW |