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

Unified Diff: Source/core/page/DragController.cpp

Issue 1290133002: SkImage-ify DragImage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: expectations Created 5 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/platform/DragImage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DragController.cpp
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp
index cf92527050e4ae3b4571f4e3221afc814d1c66fa..ae00b0ee805c2759976fd4be4305fc51ea324aae 100644
--- a/Source/core/page/DragController.cpp
+++ b/Source/core/page/DragController.cpp
@@ -800,12 +800,13 @@ static PassOwnPtr<DragImage> dragImageForImage(Element* element, Image* image, c
InterpolationQuality interpolationQuality = element->ensureComputedStyle()->imageRendering() == ImageRenderingPixelated ? InterpolationNone : InterpolationHigh;
if (image->size().height() * image->size().width() <= MaxOriginalImageArea
- && (dragImage = DragImage::create(image, element->layoutObject() ? element->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientation, 1 /* deviceScaleFactor */, interpolationQuality))) {
+ && (dragImage = DragImage::create(image,
+ element->layoutObject() ? element->layoutObject()->shouldRespectImageOrientation() : DoNotRespectImageOrientation,
+ 1 /* deviceScaleFactor */, interpolationQuality, DragImageAlpha,
+ DragImage::clampedImageScale(*image, imageRect.size(), maxDragImageSize())))) {
IntSize originalSize = imageRect.size();
origin = imageRect.location();
- dragImage->fitToMaxSize(imageRect.size(), maxDragImageSize());
- dragImage->dissolveToFraction(DragImageAlpha);
IntSize newSize = dragImage->size();
// Properly orient the drag image and orient it differently if it's smaller than the original
@@ -868,9 +869,7 @@ bool DragController::startDrag(LocalFrame* src, const DragState& state, const Pl
Node* node = state.m_dragSrc.get();
if (state.m_dragType == DragSourceActionSelection) {
if (!dragImage) {
- dragImage = src->dragImageForSelection();
- if (dragImage)
- dragImage->dissolveToFraction(DragImageAlpha);
+ dragImage = src->dragImageForSelection(DragImageAlpha);
dragLocation = dragLocationForSelectionDrag(src);
}
doSystemDrag(dragImage.get(), dragLocation, dragOrigin, dataTransfer, src, false);
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/platform/DragImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698