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

Side by Side Diff: src/effects/SkGpuBlurUtils.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/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.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 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkGpuBlurUtils.h" 8 #include "SkGpuBlurUtils.h"
9 9
10 #include "SkRect.h" 10 #include "SkRect.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 GrSurfaceDesc desc; 173 GrSurfaceDesc desc;
174 desc.fFlags = kRenderTarget_GrSurfaceFlag; 174 desc.fFlags = kRenderTarget_GrSurfaceFlag;
175 desc.fWidth = SkScalarFloorToInt(srcRect.width()); 175 desc.fWidth = SkScalarFloorToInt(srcRect.width());
176 desc.fHeight = SkScalarFloorToInt(srcRect.height()); 176 desc.fHeight = SkScalarFloorToInt(srcRect.height());
177 desc.fConfig = srcTexture->config(); 177 desc.fConfig = srcTexture->config();
178 178
179 GrTexture* dstTexture; 179 GrTexture* dstTexture;
180 GrTexture* tempTexture; 180 GrTexture* tempTexture;
181 SkAutoTUnref<GrTexture> temp1, temp2; 181 SkAutoTUnref<GrTexture> temp1, temp2;
182 182
183 temp1.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMa tch)); 183 temp1.reset(context->textureProvider()->refScratchTexture(
184 desc, GrTextureProvider::kApprox_ScratchTexMatch));
184 dstTexture = temp1.get(); 185 dstTexture = temp1.get();
185 if (canClobberSrc) { 186 if (canClobberSrc) {
186 tempTexture = srcTexture; 187 tempTexture = srcTexture;
187 } else { 188 } else {
188 temp2.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchT exMatch)); 189 temp2.reset(context->textureProvider()->refScratchTexture(
190 desc, GrTextureProvider::kApprox_ScratchTexMatch));
189 tempTexture = temp2.get(); 191 tempTexture = temp2.get();
190 } 192 }
191 193
192 if (NULL == dstTexture || NULL == tempTexture) { 194 if (NULL == dstTexture || NULL == tempTexture) {
193 return NULL; 195 return NULL;
194 } 196 }
195 197
196 for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) { 198 for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
197 GrPaint paint; 199 GrPaint paint;
198 SkMatrix matrix; 200 SkMatrix matrix;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 SkMatrix::I(), dstRect, srcRect); 301 SkMatrix::I(), dstRect, srcRect);
300 srcRect = dstRect; 302 srcRect = dstRect;
301 srcTexture = dstTexture; 303 srcTexture = dstTexture;
302 SkTSwap(dstTexture, tempTexture); 304 SkTSwap(dstTexture, tempTexture);
303 } 305 }
304 return SkRef(srcTexture); 306 return SkRef(srcTexture);
305 } 307 }
306 #endif 308 #endif
307 309
308 } 310 }
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698