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

Unified Diff: src/gpu/SkGr.cpp

Issue 864383003: Remove createUncachedTexture function, attempt to recycle scratch in createTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@continue
Patch Set: Comments, fixes 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
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f1c4d2052d5a4b585f308da369e90fa424c28799..2209ea465afd8278875756c33c04217eb0834ee0 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -179,17 +179,9 @@ static GrTexture* create_texture_for_bmp(GrContext* ctx,
GrSurfaceDesc desc,
const void* pixels,
size_t rowBytes) {
- GrTexture* result;
- if (optionalKey.isValid() || GrPixelConfigIsCompressed(desc.fConfig)) {
- result = ctx->createTexture(desc, pixels, rowBytes);
- if (result) {
- SkAssertResult(ctx->addResourceToCache(optionalKey, result));
- }
- } else {
- result = ctx->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch);
- if (pixels && result) {
- result->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, pixels, rowBytes);
- }
+ GrTexture* result = ctx->createTexture(desc, true, pixels, rowBytes);
+ if (result && optionalKey.isValid()) {
+ SkAssertResult(ctx->addResourceToCache(optionalKey, result));
}
return result;
}
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698