Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp |
| index 0ff71704405a5f5f9a62075c1b0161e2d3e7f6ac..4e9bd685c154dc2c69b912222e5e614d88d32365 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp |
| @@ -8,6 +8,7 @@ |
| #include "platform/graphics/GraphicsContext.h" |
| #include "platform/graphics/ImageObserver.h" |
| #include "platform/graphics/UnacceleratedStaticBitmapImage.h" |
| +#include "platform/graphics/paint/PaintImage.h" |
| #include "third_party/skia/include/core/SkCanvas.h" |
| #include "third_party/skia/include/core/SkImage.h" |
| #include "third_party/skia/include/core/SkPaint.h" |
| @@ -35,8 +36,15 @@ void StaticBitmapImage::DrawHelper(PaintCanvas* canvas, |
| if (dst_rect.IsEmpty() || adjusted_src_rect.IsEmpty()) |
| return; // Nothing to draw. |
| - canvas->drawImageRect(std::move(image), adjusted_src_rect, dst_rect, &flags, |
| - WebCoreClampingModeToSkiaRectConstraint(clamp_mode)); |
| + auto animation_type = MaybeAnimated() ? PaintImage::AnimationType::ANIMATED |
|
pdr.
2017/04/12 17:37:05
WDYT of just changing the return type of MaybeAnim
vmpstr
2017/04/12 18:58:44
Hmm, there are callers outside of graphics that us
|
| + : PaintImage::AnimationType::STATIC; |
| + auto completion_state = CurrentFrameIsComplete() |
| + ? PaintImage::CompletionState::DONE |
| + : PaintImage::CompletionState::PARTIALLY_DONE; |
| + canvas->drawImageRect( |
| + PaintImage(std::move(image), animation_type, completion_state), |
| + adjusted_src_rect, dst_rect, &flags, |
| + WebCoreClampingModeToSkiaRectConstraint(clamp_mode)); |
| } |
| } // namespace blink |