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

Unified Diff: include/gpu/GrContext.h

Issue 864383003: Remove createUncachedTexture function, attempt to recycle scratch in createTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@continue
Patch Set: more Created 5 years, 10 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
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index bbba977d70dedbf0052d66b7f9c101e97e7d2b0e..e76e20aaaef30bfb264c5ee6d64b82c4107a9738 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -218,24 +218,25 @@ public:
* ref on the returned texture which must be balanced by a call to unref.
*
* @param desc Description of the texture properties.
- * @param srcData Pointer to the pixel values.
+ * @param budgeted Does the texture count against the resource cache budget?
+ * @param srcData Pointer to the pixel values (optional).
* @param rowBytes The number of bytes between rows of the texture. Zero
* implies tightly packed rows. For compressed pixel configs, this
* field is ignored.
*/
- GrTexture* createTexture(const GrSurfaceDesc& desc, const void* srcData, size_t rowBytes);
+ GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, const void* srcData,
+ size_t rowBytes);
- GrTexture* createTexture(const GrSurfaceDesc& desc) {
- return this->createTexture(desc, NULL, 0);
+ GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted) {
+ return this->createTexture(desc, budgeted, NULL, 0);
}
/**
- * Creates a texture that is outside the cache. Does not count against
- * cache's budget.
- *
- * TODO: Add a budgeted param to createTexture and remove this function.
+ * DEPRECATED: use createTexture().
*/
- GrTexture* createUncachedTexture(const GrSurfaceDesc& desc, void* srcData, size_t rowBytes);
+ GrTexture* createUncachedTexture(const GrSurfaceDesc& desc, void* srcData, size_t rowBytes) {
+ return this->createTexture(desc, false, srcData, rowBytes);
+ }
/**
* Enum that determines how closely a returned scratch texture must match
@@ -837,12 +838,7 @@ private:
const SkPath&,
const GrStrokeInfo&);
- // TODO: Move this out of GrContext.
- GrTexture* createResizedTexture(const GrSurfaceDesc&,
- const GrContentKey& origKey,
- const void* srcData,
- size_t rowBytes,
- bool filter);
+ GrTexture* internalRefScratchTexture(const GrSurfaceDesc&, uint32_t flags);
/**
* These functions create premul <-> unpremul effects if it is possible to generate a pair
« no previous file with comments | « gm/texdata.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698