| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 std::unique_ptr<DragImage> DragImage::create( | 143 std::unique_ptr<DragImage> DragImage::create( |
| 144 Image* image, | 144 Image* image, |
| 145 RespectImageOrientationEnum shouldRespectImageOrientation, | 145 RespectImageOrientationEnum shouldRespectImageOrientation, |
| 146 float deviceScaleFactor, | 146 float deviceScaleFactor, |
| 147 InterpolationQuality interpolationQuality, | 147 InterpolationQuality interpolationQuality, |
| 148 float opacity, | 148 float opacity, |
| 149 FloatSize imageScale) { | 149 FloatSize imageScale) { |
| 150 if (!image) | 150 if (!image) |
| 151 return nullptr; | 151 return nullptr; |
| 152 | 152 |
| 153 sk_sp<SkImage> skImage = image->imageForCurrentFrame(); | 153 // TODO(ccameron): DragImage needs to be color space aware. |
| 154 // https://crbug.com/672316 |
| 155 sk_sp<SkImage> skImage = |
| 156 image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()); |
| 154 if (!skImage) | 157 if (!skImage) |
| 155 return nullptr; | 158 return nullptr; |
| 156 | 159 |
| 157 ImageOrientation orientation; | 160 ImageOrientation orientation; |
| 158 if (shouldRespectImageOrientation == RespectImageOrientation && | 161 if (shouldRespectImageOrientation == RespectImageOrientation && |
| 159 image->isBitmapImage()) | 162 image->isBitmapImage()) |
| 160 orientation = toBitmapImage(image)->currentFrameOrientation(); | 163 orientation = toBitmapImage(image)->currentFrameOrientation(); |
| 161 | 164 |
| 162 SkBitmap bm; | 165 SkBitmap bm; |
| 163 sk_sp<SkImage> resizedImage = | 166 sk_sp<SkImage> resizedImage = |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 m_interpolationQuality == InterpolationNone | 319 m_interpolationQuality == InterpolationNone |
| 317 ? skia::ImageOperations::RESIZE_BOX | 320 ? skia::ImageOperations::RESIZE_BOX |
| 318 : skia::ImageOperations::RESIZE_LANCZOS3; | 321 : skia::ImageOperations::RESIZE_LANCZOS3; |
| 319 int imageWidth = scaleX * m_bitmap.width(); | 322 int imageWidth = scaleX * m_bitmap.width(); |
| 320 int imageHeight = scaleY * m_bitmap.height(); | 323 int imageHeight = scaleY * m_bitmap.height(); |
| 321 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, | 324 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, |
| 322 imageHeight); | 325 imageHeight); |
| 323 } | 326 } |
| 324 | 327 |
| 325 } // namespace blink | 328 } // namespace blink |
| OLD | NEW |