Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/Image.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp |
| index 8af49d6721cc861d07342dd7c231efe26879dcb1..be2a1d1525ceb304ff6628014244171ae1a12fbe 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/Image.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp |
| @@ -52,7 +52,9 @@ |
| namespace blink { |
| Image::Image(ImageObserver* observer) |
| - : image_observer_disabled_(false), image_observer_(observer) {} |
| + : image_observer_disabled_(false), |
| + image_observer_(observer), |
| + stable_image_id_(PaintImage::GetNextId()) {} |
|
chrishtr
2017/05/10 22:56:11
How about making Image the class which creates its
vmpstr
2017/05/10 23:21:47
Hm.. You mean have the id generation happen from I
|
| Image::~Image() {} |
| @@ -297,7 +299,8 @@ void Image::DrawPattern(GraphicsContext& context, |
| auto image_id = image.sk_image()->uniqueID(); |
| image = |
| - PaintImage(image.sk_image()->makeSubset(EnclosingIntRect(norm_src_rect)), |
| + PaintImage(stable_image_id_, |
| + image.sk_image()->makeSubset(EnclosingIntRect(norm_src_rect)), |
| image.animation_type(), image.completion_state()); |
| if (!image) |
| return; |
| @@ -345,7 +348,8 @@ PaintImage Image::PaintImageForCurrentFrame() { |
| auto completion_state = CurrentFrameIsComplete() |
| ? PaintImage::CompletionState::DONE |
| : PaintImage::CompletionState::PARTIALLY_DONE; |
| - return PaintImage(ImageForCurrentFrame(), animation_type, completion_state); |
| + return PaintImage(stable_image_id_, ImageForCurrentFrame(), animation_type, |
| + completion_state); |
| } |
| bool Image::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) { |