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

Unified Diff: cc/paint/paint_image.h

Issue 2857923004: cc: Keep PaintImage in DrawImage. (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
« no previous file with comments | « cc/paint/image_id.h ('k') | 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 5aec3cfcdf21402c7813de51a8227295c5465ee1..489cef27bd21647b902b0c85367b9f8447904dcd 100644
--- a/cc/paint/paint_image.h
+++ b/cc/paint/paint_image.h
@@ -21,6 +21,11 @@ class CC_PAINT_EXPORT PaintImage {
// GetNextId to generate a stable id for such images.
static const Id kNonLazyStableId = -1;
+ // This is the id used in places where we are currently not plumbing the
+ // correct image id from blink.
+ // TODO(khushalsagar): Eliminate these cases. See crbug.com/722559.
+ static const Id kUnknownStableId = -2;
+
// TODO(vmpstr): Work towards removing "UNKNOWN" value.
enum class AnimationType { UNKNOWN, ANIMATED, VIDEO, STATIC };
@@ -41,7 +46,7 @@ class CC_PAINT_EXPORT PaintImage {
PaintImage& operator=(const PaintImage& other);
PaintImage& operator=(PaintImage&& other);
- bool operator==(const PaintImage& other);
+ bool operator==(const PaintImage& other) const;
explicit operator bool() const { return sk_image_; }
Id stable_id() const { return id_; }
@@ -50,7 +55,7 @@ class CC_PAINT_EXPORT PaintImage {
CompletionState completion_state() const { return completion_state_; }
private:
- Id id_ = kNonLazyStableId;
+ Id id_ = kUnknownStableId;
sk_sp<SkImage> sk_image_;
AnimationType animation_type_ = AnimationType::UNKNOWN;
CompletionState completion_state_ = CompletionState::UNKNOWN;
« no previous file with comments | « cc/paint/image_id.h ('k') | cc/paint/paint_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698