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

Unified Diff: include/core/SkImage.h

Issue 1301373007: add preroll to image, for chrome's warmup pass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/image/SkImage_Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/image/SkImage_Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698