aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-09-01 12:22:32 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-01 12:22:32 -0700
commit86e90fafe17321964d975e9a6e2f242df280e74e (patch)
tree566f0f6f3698e406980afcfe0e52a3b525198b2d /include/core
parent12d40c18b9f624f3a6b674f10a11504fd3ea5642 (diff)
add preroll to image, for chrome's warmup pass
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkImage.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkImage.h b/include/core/SkImage.h
index 5b9e203175..2bcb90b5d3 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;