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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 orientation = toBitmapImage(image)->currentFrameOrientation(); | 160 orientation = toBitmapImage(image)->currentFrameOrientation(); |
161 | 161 |
162 SkBitmap bm; | 162 SkBitmap bm; |
163 sk_sp<SkImage> resizedImage = | 163 sk_sp<SkImage> resizedImage = |
164 resizeAndOrientImage(std::move(skImage), orientation, imageScale, opacity, | 164 resizeAndOrientImage(std::move(skImage), orientation, imageScale, opacity, |
165 interpolationQuality); | 165 interpolationQuality); |
166 if (!resizedImage || | 166 if (!resizedImage || |
167 !resizedImage->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode)) | 167 !resizedImage->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode)) |
168 return nullptr; | 168 return nullptr; |
169 | 169 |
170 return wrapUnique(new DragImage(bm, deviceScaleFactor, interpolationQuality)); | 170 return WTF::wrapUnique( |
| 171 new DragImage(bm, deviceScaleFactor, interpolationQuality)); |
171 } | 172 } |
172 | 173 |
173 static Font deriveDragLabelFont(int size, | 174 static Font deriveDragLabelFont(int size, |
174 FontWeight fontWeight, | 175 FontWeight fontWeight, |
175 const FontDescription& systemFont) { | 176 const FontDescription& systemFont) { |
176 FontDescription description = systemFont; | 177 FontDescription description = systemFont; |
177 description.setWeight(fontWeight); | 178 description.setWeight(fontWeight); |
178 description.setSpecifiedSize(size); | 179 description.setSpecifiedSize(size); |
179 description.setComputedSize(size); | 180 description.setComputedSize(size); |
180 Font result(description); | 181 Font result(description); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 m_interpolationQuality == InterpolationNone | 316 m_interpolationQuality == InterpolationNone |
316 ? skia::ImageOperations::RESIZE_BOX | 317 ? skia::ImageOperations::RESIZE_BOX |
317 : skia::ImageOperations::RESIZE_LANCZOS3; | 318 : skia::ImageOperations::RESIZE_LANCZOS3; |
318 int imageWidth = scaleX * m_bitmap.width(); | 319 int imageWidth = scaleX * m_bitmap.width(); |
319 int imageHeight = scaleY * m_bitmap.height(); | 320 int imageHeight = scaleY * m_bitmap.height(); |
320 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, | 321 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth, |
321 imageHeight); | 322 imageHeight); |
322 } | 323 } |
323 | 324 |
324 } // namespace blink | 325 } // namespace blink |
OLD | NEW |