| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ASSERT(opacity >= 0 && opacity <= 1); | 108 ASSERT(opacity >= 0 && opacity <= 1); |
| 109 paint.setAlpha(opacity * 255); | 109 paint.setAlpha(opacity * 255); |
| 110 paint.setFilterQuality(interpolation_quality == kInterpolationNone | 110 paint.setFilterQuality(interpolation_quality == kInterpolationNone |
| 111 ? kNone_SkFilterQuality | 111 ? kNone_SkFilterQuality |
| 112 : kHigh_SkFilterQuality); | 112 : kHigh_SkFilterQuality); |
| 113 | 113 |
| 114 SkCanvas* canvas = surface->getCanvas(); | 114 SkCanvas* canvas = surface->getCanvas(); |
| 115 canvas->concat(AffineTransformToSkMatrix(transform)); | 115 canvas->concat(AffineTransformToSkMatrix(transform)); |
| 116 canvas->drawImage(image.sk_image(), 0, 0, &paint); | 116 canvas->drawImage(image.sk_image(), 0, 0, &paint); |
| 117 | 117 |
| 118 return PaintImage(image.stable_id(), surface->makeImageSnapshot(), | 118 return PaintImage(surface->makeImageSnapshot(), image.animation_type(), |
| 119 image.animation_type(), image.completion_state()); | 119 image.completion_state()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 FloatSize DragImage::ClampedImageScale(const IntSize& image_size, | 122 FloatSize DragImage::ClampedImageScale(const IntSize& image_size, |
| 123 const IntSize& size, | 123 const IntSize& size, |
| 124 const IntSize& max_size) { | 124 const IntSize& max_size) { |
| 125 // Non-uniform scaling for size mapping. | 125 // Non-uniform scaling for size mapping. |
| 126 FloatSize image_scale( | 126 FloatSize image_scale( |
| 127 static_cast<float>(size.Width()) / image_size.Width(), | 127 static_cast<float>(size.Width()) / image_size.Width(), |
| 128 static_cast<float>(size.Height()) / image_size.Height()); | 128 static_cast<float>(size.Height()) / image_size.Height()); |
| 129 | 129 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 interpolation_quality_ == kInterpolationNone | 321 interpolation_quality_ == kInterpolationNone |
| 322 ? skia::ImageOperations::RESIZE_BOX | 322 ? skia::ImageOperations::RESIZE_BOX |
| 323 : skia::ImageOperations::RESIZE_LANCZOS3; | 323 : skia::ImageOperations::RESIZE_LANCZOS3; |
| 324 int image_width = scale_x * bitmap_.width(); | 324 int image_width = scale_x * bitmap_.width(); |
| 325 int image_height = scale_y * bitmap_.height(); | 325 int image_height = scale_y * bitmap_.height(); |
| 326 bitmap_ = skia::ImageOperations::Resize(bitmap_, resize_method, image_width, | 326 bitmap_ = skia::ImageOperations::Resize(bitmap_, resize_method, image_width, |
| 327 image_height); | 327 image_height); |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace blink | 330 } // namespace blink |
| OLD | NEW |