| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Google Inc. | 3 * Copyright (C) 2008 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 static const IntSize maxDragImageSize(200, 200); | 797 static const IntSize maxDragImageSize(200, 200); |
| 798 #endif | 798 #endif |
| 799 return maxDragImageSize; | 799 return maxDragImageSize; |
| 800 } | 800 } |
| 801 | 801 |
| 802 static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c
onst IntPoint& dragOrigin, const IntRect& imageRect, IntPoint& dragLocation) | 802 static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c
onst IntPoint& dragOrigin, const IntRect& imageRect, IntPoint& dragLocation) |
| 803 { | 803 { |
| 804 OwnPtr<DragImage> dragImage; | 804 OwnPtr<DragImage> dragImage; |
| 805 IntPoint origin; | 805 IntPoint origin; |
| 806 | 806 |
| 807 InterpolationQuality interpolationQuality = element->computedStyle()->imageR
endering() == ImageRenderingPixelated ? InterpolationNone : InterpolationHigh; | 807 InterpolationQuality interpolationQuality = element->ensureComputedStyle()->
imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationH
igh; |
| 808 if (image->size().height() * image->size().width() <= MaxOriginalImageArea | 808 if (image->size().height() * image->size().width() <= MaxOriginalImageArea |
| 809 && (dragImage = DragImage::create(image, element->layoutObject() ? eleme
nt->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientati
on, 1 /* deviceScaleFactor */, interpolationQuality))) { | 809 && (dragImage = DragImage::create(image, element->layoutObject() ? eleme
nt->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientati
on, 1 /* deviceScaleFactor */, interpolationQuality))) { |
| 810 IntSize originalSize = imageRect.size(); | 810 IntSize originalSize = imageRect.size(); |
| 811 origin = imageRect.location(); | 811 origin = imageRect.location(); |
| 812 | 812 |
| 813 dragImage->fitToMaxSize(imageRect.size(), maxDragImageSize()); | 813 dragImage->fitToMaxSize(imageRect.size(), maxDragImageSize()); |
| 814 dragImage->dissolveToFraction(DragImageAlpha); | 814 dragImage->dissolveToFraction(DragImageAlpha); |
| 815 IntSize newSize = dragImage->size(); | 815 IntSize newSize = dragImage->size(); |
| 816 | 816 |
| 817 // Properly orient the drag image and orient it differently if it's smal
ler than the original | 817 // Properly orient the drag image and orient it differently if it's smal
ler than the original |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 965 |
| 966 DEFINE_TRACE(DragController) | 966 DEFINE_TRACE(DragController) |
| 967 { | 967 { |
| 968 visitor->trace(m_page); | 968 visitor->trace(m_page); |
| 969 visitor->trace(m_documentUnderMouse); | 969 visitor->trace(m_documentUnderMouse); |
| 970 visitor->trace(m_dragInitiator); | 970 visitor->trace(m_dragInitiator); |
| 971 visitor->trace(m_fileInputElementUnderMouse); | 971 visitor->trace(m_fileInputElementUnderMouse); |
| 972 } | 972 } |
| 973 | 973 |
| 974 } // namespace blink | 974 } // namespace blink |
| OLD | NEW |