[go: nahoru, domu]

Add images to render in skottie animation frame to Canvas API.

This change is purely plumbing for the images through the Canvas API.
No application logic. The calling code (which decides which images to
draw on the Canvas) will come in the next CL.

Bug: 1266051
Bug: b:203584064
Test: cc_unittests, gfx_unittests, blink_platform_unittests
Change-Id: I4e03822b425bf94eae1ce260f122a878965714af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3265889
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Eric Sum <esum@google.com>
Cr-Commit-Position: refs/heads/main@{#939669}
diff --git a/cc/paint/paint_canvas.h b/cc/paint/paint_canvas.h
index ec98004..7781c0ad 100644
--- a/cc/paint/paint_canvas.h
+++ b/cc/paint/paint_canvas.h
@@ -11,6 +11,7 @@
 #include "cc/paint/node_id.h"
 #include "cc/paint/paint_export.h"
 #include "cc/paint/paint_image.h"
+#include "cc/paint/skottie_frame_data.h"
 #include "third_party/skia/include/core/SkCanvas.h"
 
 class SkTextBlob;
@@ -181,10 +182,13 @@
 
   // Draws the frame of the |skottie| animation specified by the normalized time
   // t [0->first frame..1->last frame] at the destination bounds given by |dst|
-  // onto the canvas.
+  // onto the canvas. |images| is a map from asset id to the corresponding image
+  // to use when rendering this frame; it may be empty if this animation frame
+  // does not contain any images in it.
   virtual void drawSkottie(scoped_refptr<SkottieWrapper> skottie,
                            const SkRect& dst,
-                           float t) = 0;
+                           float t,
+                           SkottieFrameDataMap images) = 0;
 
   virtual void drawTextBlob(sk_sp<SkTextBlob> blob,
                             SkScalar x,