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

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

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 years, 7 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (!this->getGpu()->initCopySurfaceDstDesc(rt, &desc)) { 115 if (!this->getGpu()->initCopySurfaceDstDesc(rt, &desc)) {
116 desc.fOrigin = kDefault_GrSurfaceOrigin; 116 desc.fOrigin = kDefault_GrSurfaceOrigin;
117 desc.fFlags = kRenderTarget_GrSurfaceFlag; 117 desc.fFlags = kRenderTarget_GrSurfaceFlag;
118 desc.fConfig = rt->config(); 118 desc.fConfig = rt->config();
119 } 119 }
120 120
121 121
122 desc.fWidth = copyRect.width(); 122 desc.fWidth = copyRect.width();
123 desc.fHeight = copyRect.height(); 123 desc.fHeight = copyRect.height();
124 124
125 SkAutoTUnref<GrTexture> copy( 125 SkAutoTUnref<GrTexture> copy(fContext->textureProvider()->refScratchTexture( desc,
126 fContext->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); 126 GrTextureProvider::kApprox_ScratchTexMatch));
127 127
128 if (!copy) { 128 if (!copy) {
129 SkDebugf("Failed to create temporary copy of destination texture.\n"); 129 SkDebugf("Failed to create temporary copy of destination texture.\n");
130 return false; 130 return false;
131 } 131 }
132 SkIPoint dstPoint = {0, 0}; 132 SkIPoint dstPoint = {0, 0};
133 if (this->copySurface(copy, rt, copyRect, dstPoint)) { 133 if (this->copySurface(copy, rt, copyRect, dstPoint)) {
134 dstCopy->setTexture(copy); 134 dstCopy->setTexture(copy);
135 dstCopy->setOffset(copyRect.fLeft, copyRect.fTop); 135 dstCopy->setOffset(copyRect.fLeft, copyRect.fTop);
136 return true; 136 return true;
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp, 785 GrPipelineBuilder::AutoRestoreFragmentProcessors* a rfp,
786 GrPipelineBuilder::AutoRestoreStencil* ars, 786 GrPipelineBuilder::AutoRestoreStencil* ars,
787 GrScissorState* scissorState, 787 GrScissorState* scissorState,
788 const SkRect* devBounds) { 788 const SkRect* devBounds) {
789 return fClipMaskManager.setupClipping(pipelineBuilder, 789 return fClipMaskManager.setupClipping(pipelineBuilder,
790 arfp, 790 arfp,
791 ars, 791 ars,
792 scissorState, 792 scissorState,
793 devBounds); 793 devBounds);
794 } 794 }
OLDNEW
« 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