Index: include/core/SkImage.h |
diff --git a/include/core/SkImage.h b/include/core/SkImage.h |
index 5b9e2031758f8ebc317041289a0603f8113d1ece..2bcb90b5d3bebec7adb0b79d5dc4dde4c108f7c2 100644 |
--- a/include/core/SkImage.h |
+++ b/include/core/SkImage.h |
@@ -176,6 +176,20 @@ public: |
*/ |
bool peekPixels(SkPixmap* pixmap) const; |
+ /** |
+ * Some images have to perform preliminary work in preparation for drawing. This can be |
+ * decoding, uploading to a GPU, or other tasks. These happen automatically when an image |
+ * is drawn, and often they are cached so that the cost is only paid the first time. |
+ * |
+ * Preroll() can be called before drawing to try to perform this prepatory work ahead of time. |
+ * For images that have no such work, this returns instantly. Others may do some thing to |
+ * prepare their cache and then return. |
+ * |
+ * If the image will drawn to a GPU-backed canvas or surface, pass the associated GrContext. |
+ * If the image will be drawn to any other type of canvas or surface, pass null. |
+ */ |
+ void preroll(GrContext* = nullptr) const; |
+ |
// DEPRECATED |
GrTexture* getTexture() const; |