Reland 6914 w/ fixes.
git-svn-id: http://skia.googlecode.com/svn/trunk@6916 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 06d2682..b1e9dd6 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -118,22 +118,21 @@
// Textures
/**
- * Create a new entry, based on the specified key and texture, and return
- * a "locked" texture. Must call be balanced with an unlockTexture() call.
+ * Create a new entry, based on the specified key and texture and return it.
*
* @param params The texture params used to draw a texture may help determine
* the cache entry used. (e.g. different versions may exist
* for different wrap modes on GPUs with limited NPOT
* texture support). NULL implies clamp wrap modes.
* @param desc Description of the texture properties.
- * @param cacheData Cache-specific properties (e.g., texture gen ID)
+ * @param cacheID Cache-specific properties (e.g., texture gen ID)
* @param srcData Pointer to the pixel values.
* @param rowBytes The number of bytes between rows of the texture. Zero
* implies tightly packed rows.
*/
GrTexture* createTexture(const GrTextureParams* params,
const GrTextureDesc& desc,
- const GrCacheData& cacheData,
+ const GrCacheID& cacheID,
void* srcData, size_t rowBytes);
/**
@@ -141,14 +140,14 @@
* return it. The return value will be NULL if not found.
*
* @param desc Description of the texture properties.
- * @param cacheData Cache-specific properties (e.g., texture gen ID)
+ * @param cacheID Cache-specific properties (e.g., texture gen ID)
* @param params The texture params used to draw a texture may help determine
* the cache entry used. (e.g. different versions may exist
* for different wrap modes on GPUs with limited NPOT
* texture support). NULL implies clamp wrap modes.
*/
GrTexture* findTexture(const GrTextureDesc& desc,
- const GrCacheData& cacheData,
+ const GrCacheID& cacheID,
const GrTextureParams* params);
/**
* Determines whether a texture is in the cache. If the texture is found it
@@ -156,7 +155,7 @@
* the texture for deletion.
*/
bool isTextureInCache(const GrTextureDesc& desc,
- const GrCacheData& cacheData,
+ const GrCacheID& cacheID,
const GrTextureParams* params) const;
/**
@@ -191,11 +190,10 @@
* such an API will create gaps in the tiling pattern. This includes clamp
* mode. (This may be addressed in a future update.)
*/
- GrTexture* lockScratchTexture(const GrTextureDesc& desc,
- ScratchTexMatch match);
+ GrTexture* lockScratchTexture(const GrTextureDesc&, ScratchTexMatch match);
/**
- * When done with an entry, call unlockTexture(entry) on it, which returns
+ * When done with an entry, call unlockScratchTexture(entry) on it, which returns
* it to the cache, where it may be purged.
*/
void unlockScratchTexture(GrTexture* texture);
@@ -913,7 +911,7 @@
void internalDrawPath(const GrPaint& paint, const SkPath& path, const SkStrokeRec& stroke);
GrTexture* createResizedTexture(const GrTextureDesc& desc,
- const GrCacheData& cacheData,
+ const GrCacheID& cacheID,
void* srcData,
size_t rowBytes,
bool needsFiltering);
@@ -951,8 +949,7 @@
GrAutoScratchTexture(GrContext* context,
const GrTextureDesc& desc,
- GrContext::ScratchTexMatch match =
- GrContext::kApprox_ScratchTexMatch)
+ GrContext::ScratchTexMatch match = GrContext::kApprox_ScratchTexMatch)
: fContext(NULL)
, fTexture(NULL) {
this->set(context, desc, match);
@@ -996,8 +993,7 @@
GrTexture* set(GrContext* context,
const GrTextureDesc& desc,
- GrContext::ScratchTexMatch match =
- GrContext::kApprox_ScratchTexMatch) {
+ GrContext::ScratchTexMatch match = GrContext::kApprox_ScratchTexMatch) {
this->reset();
fContext = context;