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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 638403003: Remove uses of GrAutoScratchTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 2 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/GrContext.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index b144caf63e647e19520515da0816bc7f591d2633..e830145cfbf05257c2663ad94384af8b8d1905a9 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -455,15 +455,16 @@ bool GrDrawTarget::setupDstReadIfNecessary(GrDeviceCoordTexture* dstCopy, const
desc.fWidth = copyRect.width();
desc.fHeight = copyRect.height();
- GrAutoScratchTexture ast(fContext, desc, GrContext::kApprox_ScratchTexMatch);
+ SkAutoTUnref<GrTexture> copy(
+ fContext->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch));
- if (NULL == ast.texture()) {
+ if (!copy) {
GrPrintf("Failed to create temporary copy of destination texture.\n");
return false;
}
SkIPoint dstPoint = {0, 0};
- if (this->copySurface(ast.texture(), rt, copyRect, dstPoint)) {
- dstCopy->setTexture(ast.texture());
+ if (this->copySurface(copy, rt, copyRect, dstPoint)) {
+ dstCopy->setTexture(copy);
dstCopy->setOffset(copyRect.fLeft, copyRect.fTop);
return true;
} else {
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698