| 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 19 matching lines...) Expand all Loading... |
| 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, &paint, | 38 canvas->drawImageRect(image.get(), adjustedSrcRect, dstRect, &paint, |
| 39 WebCoreClampingModeToSkiaRectConstraint(clampMode)); | 39 WebCoreClampingModeToSkiaRectConstraint(clampMode)); |
| 40 | |
| 41 if (ImageObserver* observer = getImageObserver()) | |
| 42 observer->didDraw(this); | |
| 43 } | 40 } |
| 44 | 41 |
| 45 } // namespace blink | 42 } // namespace blink |
| OLD | NEW |