Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 1468023002: Rename imageSizeForLayoutObject() to imageSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make LayoutObject::shouldRespectImageOrientation class static and make use of it Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 #endif 790 #endif
791 return maxDragImageSize; 791 return maxDragImageSize;
792 } 792 }
793 793
794 static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c onst IntPoint& dragOrigin, const IntRect& imageRect, IntPoint& dragLocation) 794 static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c onst IntPoint& dragOrigin, const IntRect& imageRect, IntPoint& dragLocation)
795 { 795 {
796 OwnPtr<DragImage> dragImage; 796 OwnPtr<DragImage> dragImage;
797 IntPoint origin; 797 IntPoint origin;
798 798
799 InterpolationQuality interpolationQuality = element->ensureComputedStyle()-> imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationH igh; 799 InterpolationQuality interpolationQuality = element->ensureComputedStyle()-> imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationH igh;
800 RespectImageOrientationEnum shouldRespectImageOrientation = element->layoutO bject() ? element->layoutObject()->shouldRespectImageOrientation() : DoNotRespec tImageOrientation; 800 RespectImageOrientationEnum shouldRespectImageOrientation = LayoutObject::sh ouldRespectImageOrientation(element->layoutObject());
801 ImageOrientation orientation; 801 ImageOrientation orientation;
802 802
803 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit mapImage()) 803 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit mapImage())
804 orientation = toBitmapImage(image)->currentFrameOrientation(); 804 orientation = toBitmapImage(image)->currentFrameOrientation();
805 805
806 if (image->size().height() * image->size().width() <= MaxOriginalImageArea 806 if (image->size().height() * image->size().width() <= MaxOriginalImageArea
807 && (dragImage = DragImage::create(image, shouldRespectImageOrientation, 807 && (dragImage = DragImage::create(image, shouldRespectImageOrientation,
808 1 /* deviceScaleFactor */, interpolationQuality, DragImageAlpha, 808 1 /* deviceScaleFactor */, interpolationQuality, DragImageAlpha,
809 DragImage::clampedImageScale(orientation.usesWidthAsHeight() ? image ->size().transposedSize() : image->size(), imageRect.size(), maxDragImageSize()) ))) { 809 DragImage::clampedImageScale(orientation.usesWidthAsHeight() ? image ->size().transposedSize() : image->size(), imageRect.size(), maxDragImageSize()) ))) {
810 IntSize originalSize = imageRect.size(); 810 IntSize originalSize = imageRect.size();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 961
962 DEFINE_TRACE(DragController) 962 DEFINE_TRACE(DragController)
963 { 963 {
964 visitor->trace(m_page); 964 visitor->trace(m_page);
965 visitor->trace(m_documentUnderMouse); 965 visitor->trace(m_documentUnderMouse);
966 visitor->trace(m_dragInitiator); 966 visitor->trace(m_dragInitiator);
967 visitor->trace(m_fileInputElementUnderMouse); 967 visitor->trace(m_fileInputElementUnderMouse);
968 } 968 }
969 969
970 } // namespace blink 970 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698