| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 std::unique_ptr<DragImage> DragImage::create( | 142 std::unique_ptr<DragImage> DragImage::create( |
| 143 Image* image, | 143 Image* image, |
| 144 RespectImageOrientationEnum shouldRespectImageOrientation, | 144 RespectImageOrientationEnum shouldRespectImageOrientation, |
| 145 float deviceScaleFactor, | 145 float deviceScaleFactor, |
| 146 InterpolationQuality interpolationQuality, | 146 InterpolationQuality interpolationQuality, |
| 147 float opacity, | 147 float opacity, |
| 148 FloatSize imageScale) { | 148 FloatSize imageScale) { |
| 149 if (!image) | 149 if (!image) |
| 150 return nullptr; | 150 return nullptr; |
| 151 | 151 |
| 152 // TODO(ccameron): DragImage needs to be color space aware. | 152 sk_sp<SkImage> skImage = image->imageForCurrentFrame(); |
| 153 // https://crbug.com/672316 | |
| 154 sk_sp<SkImage> skImage = | |
| 155 image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()); | |
| 156 if (!skImage) | 153 if (!skImage) |
| 157 return nullptr; | 154 return nullptr; |
| 158 | 155 |
| 159 ImageOrientation orientation; | 156 ImageOrientation orientation; |
| 160 if (shouldRespectImageOrientation == RespectImageOrientation && | 157 if (shouldRespectImageOrientation == RespectImageOrientation && |
| 161 image->isBitmapImage()) | 158 image->isBitmapImage()) |
| 162 orientation = toBitmapImage(image)->currentFrameOrientation(); | 159 orientation = toBitmapImage(image)->currentFrameOrientation(); |
| 163 | 160 |
| 164 SkBitmap bm; | 161 SkBitmap bm; |
| 165 sk_sp<SkImage> resizedImage = | 162 sk_sp<SkImage> resizedImage = |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 m_interpolationQuality == InterpolationNone | 315 m_interpolationQuality == InterpolationNone |
| 319 ? skia::ImageOperations::RESIZE_BOX | 316 ? skia::ImageOperations::RESIZE_BOX |
| 320 : skia::ImageOperations::RESIZE_LANCZOS3; | 317 : skia::ImageOperations::RESIZE_LANCZOS3; |
| 321 int imageWidth = scaleX * m_bitmap.width(); | 318 int imageWidth = scaleX * m_bitmap.width(); |
| 322 int imageHeight = scaleY * m_bitmap.height(); | 319 int imageHeight = scaleY * m_bitmap.height(); |
| 323 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, | 320 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, |
| 324 imageHeight); | 321 imageHeight); |
| 325 } | 322 } |
| 326 | 323 |
| 327 } // namespace blink | 324 } // namespace blink |
| OLD | NEW |