aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-10-14 11:47:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-14 11:47:22 -0700
commite30597375c19dfb5197fd065a3d1768401eb00fa (patch)
treed61474ce6dc1ed158456299951a194800e119ad4 /include
parentec87dc64dd40c1a4f80088023c94764caca79bf9 (diff)
Remove uses of GrAutoScratchTexture.
Rename GrContext::lockAndRefScratchTexture to refScratchTexture. GrSurface::writePixels returns bool instead of void. BUG=skia:2889 Review URL: https://codereview.chromium.org/638403003
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContext.h23
-rw-r--r--include/gpu/GrSurface.h3
2 files changed, 15 insertions, 11 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 2b3b814397..536b17b9b8 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -280,27 +280,28 @@ public:
};
/**
- * Returns a texture matching the desc. It's contents are unknown. Subsequent
- * requests with the same descriptor are not guaranteed to return the same
- * texture. The same texture is guaranteed not be returned again until it is
- * unlocked. Call must be balanced with an unlockTexture() call. The caller
+ * Returns a texture matching the desc. It's contents are unknown. The caller
* owns a ref on the returned texture and must balance with a call to unref.
+ * It is guaranteed that the same texture will not be returned in subsequent
+ * calls until all refs to the texture are dropped.
*
- * Textures created by createAndLockTexture() hide the complications of
+ * Textures created by createTexture() hide the complications of
* tiling non-power-of-two textures on APIs that don't support this (e.g.
- * unextended GLES2). Tiling a NPOT texture created by lockScratchTexture on
- * such an API will create gaps in the tiling pattern. This includes clamp
- * mode. (This may be addressed in a future update.)7
+ * unextended GLES2). NPOT scratch textures are not tilable on such APIs.
*
* internalFlag is a temporary workaround until changes in the internal
* architecture are complete. Use the default value.
*/
- GrTexture* lockAndRefScratchTexture(const GrTextureDesc&, ScratchTexMatch match,
- bool internalFlag = false);
+ GrTexture* refScratchTexture(const GrTextureDesc&, ScratchTexMatch match,
+ bool internalFlag = false);
/**
* Creates a texture that is outside the cache. Does not count against
* cache's budget.
+ *
+ * Textures created by createTexture() hide the complications of
+ * tiling non-power-of-two textures on APIs that don't support this (e.g.
+ * unextended GLES2). NPOT uncached textures are not tilable on such APIs.
*/
GrTexture* createUncachedTexture(const GrTextureDesc& desc,
void* srcData,
@@ -1092,7 +1093,7 @@ public:
fContext = context;
if (fContext) {
- fTexture = fContext->lockAndRefScratchTexture(desc, match, internalFlag);
+ fTexture = fContext->refScratchTexture(desc, match, internalFlag);
if (NULL == fTexture) {
fContext = NULL;
}
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index ba51f3b3c8..7a7f55dd3b 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -105,6 +105,9 @@ public:
* @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly
* packed.
* @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
+ *
+ * @return true if the read succeeded, false if not. The read can fail because of an unsupported
+ * pixel config.
*/
bool writePixels(int left, int top, int width, int height,
GrPixelConfig config,