| 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 19 matching lines...) Expand all Loading... |
| 30 #include "platform/fonts/Font.h" | 30 #include "platform/fonts/Font.h" |
| 31 #include "platform/fonts/FontCache.h" | 31 #include "platform/fonts/FontCache.h" |
| 32 #include "platform/fonts/FontDescription.h" | 32 #include "platform/fonts/FontDescription.h" |
| 33 #include "platform/fonts/FontMetrics.h" | 33 #include "platform/fonts/FontMetrics.h" |
| 34 #include "platform/geometry/FloatPoint.h" | 34 #include "platform/geometry/FloatPoint.h" |
| 35 #include "platform/geometry/FloatRect.h" | 35 #include "platform/geometry/FloatRect.h" |
| 36 #include "platform/geometry/IntPoint.h" | 36 #include "platform/geometry/IntPoint.h" |
| 37 #include "platform/graphics/BitmapImage.h" | 37 #include "platform/graphics/BitmapImage.h" |
| 38 #include "platform/graphics/Color.h" | 38 #include "platform/graphics/Color.h" |
| 39 #include "platform/graphics/GraphicsContext.h" | 39 #include "platform/graphics/GraphicsContext.h" |
| 40 #include "platform/graphics/GraphicsScreen.h" |
| 40 #include "platform/graphics/Image.h" | 41 #include "platform/graphics/Image.h" |
| 41 #include "platform/graphics/ImageBuffer.h" | 42 #include "platform/graphics/ImageBuffer.h" |
| 42 #include "platform/graphics/paint/DrawingRecorder.h" | 43 #include "platform/graphics/paint/DrawingRecorder.h" |
| 43 #include "platform/graphics/paint/SkPictureBuilder.h" | 44 #include "platform/graphics/paint/SkPictureBuilder.h" |
| 44 #include "platform/text/BidiTextRun.h" | 45 #include "platform/text/BidiTextRun.h" |
| 45 #include "platform/text/StringTruncator.h" | 46 #include "platform/text/StringTruncator.h" |
| 46 #include "platform/text/TextRun.h" | 47 #include "platform/text/TextRun.h" |
| 47 #include "platform/transforms/AffineTransform.h" | 48 #include "platform/transforms/AffineTransform.h" |
| 48 #include "platform/weborigin/KURL.h" | 49 #include "platform/weborigin/KURL.h" |
| 49 #include "skia/ext/image_operations.h" | 50 #include "skia/ext/image_operations.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return imageScale; | 134 return imageScale; |
| 134 } | 135 } |
| 135 | 136 |
| 136 PassOwnPtr<DragImage> DragImage::create(Image* image, | 137 PassOwnPtr<DragImage> DragImage::create(Image* image, |
| 137 RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScale
Factor, | 138 RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScale
Factor, |
| 138 InterpolationQuality interpolationQuality, float opacity, FloatSize imageSca
le) | 139 InterpolationQuality interpolationQuality, float opacity, FloatSize imageSca
le) |
| 139 { | 140 { |
| 140 if (!image) | 141 if (!image) |
| 141 return nullptr; | 142 return nullptr; |
| 142 | 143 |
| 144 if (imageColorProfilesEnabled() && image->isBitmapImage() && toBitmapImage(i
mage)->hasColorProfile()) |
| 145 toBitmapImage(image)->notifyDeviceProfile(screenColorProfile(currentScre
enId()).get()); |
| 146 |
| 143 RefPtr<SkImage> skImage = image->imageForCurrentFrame(); | 147 RefPtr<SkImage> skImage = image->imageForCurrentFrame(); |
| 144 if (!skImage) | 148 if (!skImage) |
| 145 return nullptr; | 149 return nullptr; |
| 146 | 150 |
| 147 ImageOrientation orientation; | 151 ImageOrientation orientation; |
| 148 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit
mapImage()) | 152 if (shouldRespectImageOrientation == RespectImageOrientation && image->isBit
mapImage()) |
| 149 orientation = toBitmapImage(image)->currentFrameOrientation(); | 153 orientation = toBitmapImage(image)->currentFrameOrientation(); |
| 150 | 154 |
| 151 SkBitmap bm; | 155 SkBitmap bm; |
| 152 RefPtr<SkImage> resizedImage = | 156 RefPtr<SkImage> resizedImage = |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 272 |
| 269 void DragImage::scale(float scaleX, float scaleY) | 273 void DragImage::scale(float scaleX, float scaleY) |
| 270 { | 274 { |
| 271 skia::ImageOperations::ResizeMethod resizeMethod = m_interpolationQuality ==
InterpolationNone ? skia::ImageOperations::RESIZE_BOX : skia::ImageOperations::
RESIZE_LANCZOS3; | 275 skia::ImageOperations::ResizeMethod resizeMethod = m_interpolationQuality ==
InterpolationNone ? skia::ImageOperations::RESIZE_BOX : skia::ImageOperations::
RESIZE_LANCZOS3; |
| 272 int imageWidth = scaleX * m_bitmap.width(); | 276 int imageWidth = scaleX * m_bitmap.width(); |
| 273 int imageHeight = scaleY * m_bitmap.height(); | 277 int imageHeight = scaleY * m_bitmap.height(); |
| 274 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth,
imageHeight); | 278 m_bitmap = skia::ImageOperations::Resize(m_bitmap, resizeMethod, imageWidth,
imageHeight); |
| 275 } | 279 } |
| 276 | 280 |
| 277 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |