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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 OwnPtr<DragImage> dragImage; | 791 OwnPtr<DragImage> dragImage; |
792 IntPoint origin; | 792 IntPoint origin; |
793 | 793 |
794 InterpolationQuality interpolationQuality = element->ensureComputedStyle()->
imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationH
igh; | 794 InterpolationQuality interpolationQuality = element->ensureComputedStyle()->
imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationH
igh; |
795 RespectImageOrientationEnum shouldRespectImageOrientation = LayoutObject::sh
ouldRespectImageOrientation(element->layoutObject()); | 795 RespectImageOrientationEnum shouldRespectImageOrientation = LayoutObject::sh
ouldRespectImageOrientation(element->layoutObject()); |
796 ImageOrientation orientation; | 796 ImageOrientation orientation; |
797 | 797 |
798 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit
mapImage()) | 798 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit
mapImage()) |
799 orientation = toBitmapImage(image)->currentFrameOrientation(); | 799 orientation = toBitmapImage(image)->currentFrameOrientation(); |
800 | 800 |
801 IntSize imageSize = orientation.usesWidthAsHeight() ? image->size().transpos
edSize() : image->size(); | 801 IntSize imageSize = orientation.usesWidthAsHeight() ? image->defaultConcrete
ObjectSize().transposedSize() : image->defaultConcreteObjectSize(); |
802 | 802 |
803 FloatSize imageScale = DragImage::clampedImageScale(imageSize, imageElementS
izeInPixels, maxDragImageSize(deviceScaleFactor)); | 803 FloatSize imageScale = DragImage::clampedImageScale(imageSize, imageElementS
izeInPixels, maxDragImageSize(deviceScaleFactor)); |
804 | 804 |
805 if (imageSize.area() <= MaxOriginalImageArea | 805 if (imageSize.area() <= MaxOriginalImageArea |
806 && (dragImage = DragImage::create(image, shouldRespectImageOrientation, | 806 && (dragImage = DragImage::create(image, shouldRespectImageOrientation, |
807 deviceScaleFactor, interpolationQuality, DragImageAlpha, imageScale)
)) { | 807 deviceScaleFactor, interpolationQuality, DragImageAlpha, imageScale)
)) { |
808 IntSize originalSize = imageElementSizeInPixels; | 808 IntSize originalSize = imageElementSizeInPixels; |
809 origin = imageElementLocation; | 809 origin = imageElementLocation; |
810 | 810 |
811 IntSize newSize = dragImage->size(); | 811 IntSize newSize = dragImage->size(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 | 973 |
974 DEFINE_TRACE(DragController) | 974 DEFINE_TRACE(DragController) |
975 { | 975 { |
976 visitor->trace(m_page); | 976 visitor->trace(m_page); |
977 visitor->trace(m_documentUnderMouse); | 977 visitor->trace(m_documentUnderMouse); |
978 visitor->trace(m_dragInitiator); | 978 visitor->trace(m_dragInitiator); |
979 visitor->trace(m_fileInputElementUnderMouse); | 979 visitor->trace(m_fileInputElementUnderMouse); |
980 } | 980 } |
981 | 981 |
982 } // namespace blink | 982 } // namespace blink |
OLD | NEW |