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

Side by Side Diff: src/gpu/GrDrawTarget.cpp

Issue 1261643004: Some cleanup in GrTextureProvider and GrResourceProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@pathargs
Patch Set: fix Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrDrawTarget.h" 9 #include "GrDrawTarget.h"
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (!this->getGpu()->initCopySurfaceDstDesc(rt, &desc)) { 88 if (!this->getGpu()->initCopySurfaceDstDesc(rt, &desc)) {
89 desc.fOrigin = kDefault_GrSurfaceOrigin; 89 desc.fOrigin = kDefault_GrSurfaceOrigin;
90 desc.fFlags = kRenderTarget_GrSurfaceFlag; 90 desc.fFlags = kRenderTarget_GrSurfaceFlag;
91 desc.fConfig = rt->config(); 91 desc.fConfig = rt->config();
92 } 92 }
93 93
94 94
95 desc.fWidth = copyRect.width(); 95 desc.fWidth = copyRect.width();
96 desc.fHeight = copyRect.height(); 96 desc.fHeight = copyRect.height();
97 97
98 SkAutoTUnref<GrTexture> copy( 98 static const uint32_t kFlags = 0;
99 fResourceProvider->refScratchTexture(desc, GrTextureProvider::kApprox_Sc ratchTexMatch)); 99 SkAutoTUnref<GrTexture> copy(fResourceProvider->createApproxTexture(desc, kF lags));
100 100
101 if (!copy) { 101 if (!copy) {
102 SkDebugf("Failed to create temporary copy of destination texture.\n"); 102 SkDebugf("Failed to create temporary copy of destination texture.\n");
103 return false; 103 return false;
104 } 104 }
105 SkIPoint dstPoint = {0, 0}; 105 SkIPoint dstPoint = {0, 0};
106 this->copySurface(copy, rt, copyRect, dstPoint); 106 this->copySurface(copy, rt, copyRect, dstPoint);
107 dstTexture->setTexture(copy); 107 dstTexture->setTexture(copy);
108 dstTexture->setOffset(copyRect.fLeft, copyRect.fTop); 108 dstTexture->setOffset(copyRect.fLeft, copyRect.fTop);
109 return true; 109 return true;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 ars, 504 ars,
505 scissorState, 505 scissorState,
506 devBounds); 506 devBounds);
507 } 507 }
508 508
509 void GrClipTarget::purgeResources() { 509 void GrClipTarget::purgeResources() {
510 // The clip mask manager can rebuild all its clip masks so just 510 // The clip mask manager can rebuild all its clip masks so just
511 // get rid of them all. 511 // get rid of them all.
512 fClipMaskManager->purgeResources(); 512 fClipMaskManager->purgeResources();
513 }; 513 };
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrIndexBuffer.h » ('j') | src/gpu/GrTextureProvider.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698