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

Unified Diff: cc/paint/paint_image.h

Issue 2883593002: Add frame count to paint image. (Closed)
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | cc/paint/paint_image.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_image.h
diff --git a/cc/paint/paint_image.h b/cc/paint/paint_image.h
index 489cef27bd21647b902b0c85367b9f8447904dcd..f6a3587bed23d7d57b4a438f0ebca43e6038ead7 100644
--- a/cc/paint/paint_image.h
+++ b/cc/paint/paint_image.h
@@ -35,10 +35,17 @@ class CC_PAINT_EXPORT PaintImage {
static Id GetNextId();
PaintImage();
+ // - id: stable id for this image; can be generated using GetNextId().
+ // - sk_image: the underlying skia image that this represents.
+ // - animation_type: the animation type of this paint image.
+ // - completion_state: indicates whether the image is completed loading.
+ // - frame_count: the known number of frames in this image. E.g. number of GIF
+ // frames in an animated GIF.
explicit PaintImage(Id id,
sk_sp<SkImage> sk_image,
AnimationType animation_type = AnimationType::STATIC,
- CompletionState completion_state = CompletionState::DONE);
+ CompletionState completion_state = CompletionState::DONE,
+ size_t frame_count = 0);
PaintImage(const PaintImage& other);
PaintImage(PaintImage&& other);
~PaintImage();
@@ -53,12 +60,17 @@ class CC_PAINT_EXPORT PaintImage {
const sk_sp<SkImage>& sk_image() const { return sk_image_; }
AnimationType animation_type() const { return animation_type_; }
CompletionState completion_state() const { return completion_state_; }
+ size_t frame_count() const { return frame_count_; }
private:
Id id_ = kUnknownStableId;
sk_sp<SkImage> sk_image_;
AnimationType animation_type_ = AnimationType::UNKNOWN;
CompletionState completion_state_ = CompletionState::UNKNOWN;
+ // The number of frames known to exist in this image (eg number of GIF frames
+ // loaded). 0 indicates either unknown or only a single frame, both of which
+ // should be treated similarly.
+ size_t frame_count_ = 0;
};
} // namespace cc
« no previous file with comments | « no previous file | cc/paint/paint_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698