Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Unified Diff: third_party/WebKit/Source/platform/graphics/Image.cpp

Issue 2873003002: Add stable id to PaintImage. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d52f82bf77b1e08e01afbca3cdd1883acd333988..fc3378cf38ff66d72f72163250b1159778698aa5 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_(observer), image_observer_disabled_(false) {}
+ : image_observer_(observer),
+ image_observer_disabled_(false),
+ stable_image_id_(PaintImage::GetNextId()) {}
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) {

Powered by Google App Engine
This is Rietveld 408576698