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

Unified Diff: cc/paint/paint_image.h

Issue 2812763002: paint: Introduce PaintImage that wraps SkImage in paint calls. (Closed)
Patch Set: update 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
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..0ed1edd7a768e1467ac79cdc4132a648f38e2b0c
--- /dev/null
+++ b/cc/paint/paint_image.h
@@ -0,0 +1,40 @@
+// 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 {
+
+// TODO(vmpstr): Add a persistent id to the paint image.
+class CC_PAINT_EXPORT PaintImage {
+ public:
+ // TODO(vmpstr): Work towards removing "UNKNOWN" value.
+ enum class AnimationType { UNKNOWN, ANIMATED, VIDEO, STATIC };
+
+ // 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_

Powered by Google App Engine
This is Rietveld 408576698