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

Unified Diff: cc/paint/paint_image.h

Issue 2812763002: paint: Introduce PaintImage that wraps SkImage in paint calls. (Closed)
Patch Set: Created 3 years, 8 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/paint_canvas.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
new file mode 100644
index 0000000000000000000000000000000000000000..cab5c36f7e2b99c99ac1d711644f02ff968a412b
--- /dev/null
+++ b/cc/paint/paint_image.h
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_PAINT_PAINT_IMAGE_H_
+#define CC_PAINT_PAINT_IMAGE_H_
+
+#include "cc/paint/paint_export.h"
+
+#include "third_party/skia/include/core/SkImage.h"
+
+namespace cc {
+
+class CC_PAINT_EXPORT PaintImage {
Khushal 2017/04/11 02:19:46 Add a TODO for a persistent id for PaintImage, whi
vmpstr 2017/04/11 18:58:33 Done.
+ public:
+ // TODO(vmpstr): Work towards removing "UNKNOWN" value.
+ enum class AnimationType { UNKNOWN, ANIMATED, STATIC };
Khushal 2017/04/11 02:19:46 Do you think we actually need the animation and co
vmpstr 2017/04/11 18:58:33 I'd rather keep the logic for deciding that in cc.
Khushal 2017/04/11 20:55:01 We are using ANIMATED here for the frames in skcan
+
+ // TODO(vmpstr): Work towards removing "UNKNOWN" value.
+ enum class CompletionState { UNKNOWN, DONE, PARTIALLY_DONE };
+
+ PaintImage(sk_sp<const SkImage> sk_image,
+ AnimationType animation_type,
+ CompletionState completion_state);
+ ~PaintImage();
+
+ const sk_sp<const SkImage>& sk_image() const { return sk_image_; }
+ AnimationType animation_type() const { return animation_type_; }
+ CompletionState completion_state() const { return completion_state_; }
+
+ private:
+ sk_sp<const SkImage> sk_image_;
+ AnimationType animation_type_;
+ CompletionState completion_state_;
+};
+
+} // namespace cc
+
+#endif // CC_PAINT_PAINT_IMAGE_H_
« no previous file with comments | « cc/paint/paint_canvas.h ('k') | cc/paint/paint_image.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698