| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/StaticBitmapImage.h" | 5 #include "platform/graphics/StaticBitmapImage.h" |
| 6 | 6 |
| 7 #include "platform/graphics/AcceleratedStaticBitmapImage.h" | 7 #include "platform/graphics/AcceleratedStaticBitmapImage.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/ImageObserver.h" | 9 #include "platform/graphics/ImageObserver.h" |
| 10 #include "platform/graphics/UnacceleratedStaticBitmapImage.h" | 10 #include "platform/graphics/UnacceleratedStaticBitmapImage.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const FloatRect& dstRect, | 28 const FloatRect& dstRect, |
| 29 const FloatRect& srcRect, | 29 const FloatRect& srcRect, |
| 30 ImageClampingMode clampMode, | 30 ImageClampingMode clampMode, |
| 31 sk_sp<SkImage> image) { | 31 sk_sp<SkImage> image) { |
| 32 FloatRect adjustedSrcRect = srcRect; | 32 FloatRect adjustedSrcRect = srcRect; |
| 33 adjustedSrcRect.intersect(SkRect::Make(image->bounds())); | 33 adjustedSrcRect.intersect(SkRect::Make(image->bounds())); |
| 34 | 34 |
| 35 if (dstRect.isEmpty() || adjustedSrcRect.isEmpty()) | 35 if (dstRect.isEmpty() || adjustedSrcRect.isEmpty()) |
| 36 return; // Nothing to draw. | 36 return; // Nothing to draw. |
| 37 | 37 |
| 38 canvas->drawImageRect(image.get(), adjustedSrcRect, dstRect, &flags, | 38 canvas->drawImageRect(std::move(image), adjustedSrcRect, dstRect, &flags, |
| 39 WebCoreClampingModeToSkiaRectConstraint(clampMode)); | 39 WebCoreClampingModeToSkiaRectConstraint(clampMode)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace blink | 42 } // namespace blink |
| OLD | NEW |