@@ -53,8 +53,11 @@ this.createjs = this.createjs||{};
5353 * Caching is also a co-requisite for applying filters to prevent expensive filters running constantly without need,
5454 * and to physically enable some effects. The BitmapCache is also responsible for applying filters to objects and
5555 * reads each {{#crossLink "Filter"}}{{/crossLink}} due to this relationship. Real-time Filters are not recommended
56- * performance wise when dealing with a Context2D canvas. For best performance and to still allow for some visual
57- * effects use a compositeOperation when possible.
56+ * performance wise when dealing with a Context2D canvas. On a StageGL performance is better so the presence of a
57+ * filter will automatically create a cache if one is not made manually.
58+ *
59+ * Some visual effects can be achieved with a {{#crossLink "DisplayObject/compositeOperation:property"}}{{/crossLink}}
60+ * so check out that setting before settling on a filter.
5861 * @class BitmapCache
5962 * @constructor
6063 **/
@@ -352,8 +355,8 @@ this.createjs = this.createjs||{};
352355 * specifics of how to use the options object.
353356 *
354357 * - If options.useGL is set to "new" a StageGL is created and contained on this for use when rendering the cache.
355- * - If options.useGL is set to "stage" if the current stage is a StageGL it will be used. If not then it will default to "new" .
356- * - If options.useGL is a StageGL instance it will not create one but use the one provided .
358+ * - If options.useGL is set to "stage" if the current stage is a StageGL it will be used. Must be added to a stage first to work .
359+ * - If options.useGL is a StageGL instance then it will use it to cache. Warning, caches made on one StageGL will not render on any other StageGL .
357360 * - If options.useGL is undefined a Context 2D cache will be performed.
358361 *
359362 * This means you can use any combination of StageGL and 2D with either, neither, or both the stage and cache being
@@ -382,16 +385,21 @@ this.createjs = this.createjs||{};
382385 *
383386 * var stageGL = new createjs.StageGL();
384387 * var bmp = new createjs.Bitmap(src);
385- * bmp.cache(0, 0, bmp.width, bmp.height, 1, {gl: "stage"}); // use our StageGL to cache
388+ *
389+ * // option 1
390+ * stageGL.addChild(bmp);
391+ * bmp.cache(0, 0, bmp.width, bmp.height, 1, {gl: "stage"}); // when added to the display list we can look it up
392+ * // option 2
393+ * bmp.cache(0, 0, bmp.width, bmp.height, 1, {gl: stageGL}); // we can specify it explicitly if we add it later
394+ * stageGL.addChild(bmp);
386395 *
387396 * var shape = new createjs.Shape();
388397 * shape.graphics.clear().fill("red").drawRect(0,0,20,20);
389398 * shape.cache(0, 0, 20, 20, 1); // cannot use WebGL cache
390399 *
391400 * You may wish to create your own StageGL instance to control factors like clear color, transparency, AA, and
392- * others. If you do, pass a new instance in instead of "true", the library will automatically set the
393- * {{#crossLink "StageGL/isCacheControlled"}}{{/crossLink}} to true on your instance. This will trigger it to behave
394- * correctly, and not assume your main context is WebGL.
401+ * others. If the specified stage is not rendering content and just the cache set{{#crossLink "StageGL/isCacheControlled"}}{{/crossLink}}
402+ * to true on your instance. This will trigger it to behave correctly for rendering your output.
395403 *
396404 * @public
397405 * @method BitmapCache.cache
0 commit comments