Adding the notion of a volatile bitmap to SkBitmap.
Volatility is a hint that indicates that the contents of a bitmap
are ephemeral. SkGpuDevice will not preserve volatile bitmaps
in its texture cache, and will use textures from a pool of
keyless (recyclable) textures to avoid the performance hit of
texture allocation and release.
A subsequent change is required in webkit in order to take advantage
of this optimization. putImageData, and other methods that create
temporary bitmaps will have to mark their bitmaps as volatile.
before rendering them through skia.
git-svn-id: http://skia.googlecode.com/svn/trunk@1769 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrTexture.h b/gpu/include/GrTexture.h
index 7815997..d811b35 100644
--- a/gpu/include/GrTexture.h
+++ b/gpu/include/GrTexture.h
@@ -201,18 +201,21 @@
/**
* Updates a subrectangle of texels in the texture.
*
- * @param x left edge of rectangle to update
- * @param y top edge of rectangle to update
- * @param width width of rectangle to update
- * @param height height of rectangle to update
- * @param srcData width*height texels of data in same format that was used
- * at texture creation.
+ * @param x left edge of rectangle to update
+ * @param y top edge of rectangle to update
+ * @param width width of rectangle to update
+ * @param height height of rectangle to update
+ * @param srcData width*height texels of data in same format that was
+ * used at texture creation.
+ * @param rowBytes number of bytes per row in srcData, 0 means rows are
+ * packed
*/
virtual void uploadTextureData(int x,
int y,
int width,
int height,
- const void* srcData) = 0;
+ const void* srcData,
+ size_t rowBytes) = 0;
/**
* Reads a rectangle of pixels from the texture.