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

Side by Side Diff: src/effects/SkGpuBlurUtils.cpp

Issue 938383004: Dynamically create stencil buffer when needed. (Closed) Base URL: https://skia.googlesource.com/skia.git@bigstencil
Patch Set: Actually save file before uploading 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMorphologyImageFilter.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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 scale_rect(&srcRect, static_cast<float>(scaleFactorX), 160 scale_rect(&srcRect, static_cast<float>(scaleFactorX),
161 static_cast<float>(scaleFactorY)); 161 static_cast<float>(scaleFactorY));
162 162
163 GrContext::AutoClip acs(context, SkRect::MakeWH(srcRect.width(), srcRect.hei ght())); 163 GrContext::AutoClip acs(context, SkRect::MakeWH(srcRect.width(), srcRect.hei ght()));
164 164
165 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() || 165 SkASSERT(kBGRA_8888_GrPixelConfig == srcTexture->config() ||
166 kRGBA_8888_GrPixelConfig == srcTexture->config() || 166 kRGBA_8888_GrPixelConfig == srcTexture->config() ||
167 kAlpha_8_GrPixelConfig == srcTexture->config()); 167 kAlpha_8_GrPixelConfig == srcTexture->config());
168 168
169 GrSurfaceDesc desc; 169 GrSurfaceDesc desc;
170 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; 170 desc.fFlags = kRenderTarget_GrSurfaceFlag;
171 desc.fWidth = SkScalarFloorToInt(srcRect.width()); 171 desc.fWidth = SkScalarFloorToInt(srcRect.width());
172 desc.fHeight = SkScalarFloorToInt(srcRect.height()); 172 desc.fHeight = SkScalarFloorToInt(srcRect.height());
173 desc.fConfig = srcTexture->config(); 173 desc.fConfig = srcTexture->config();
174 174
175 GrTexture* dstTexture; 175 GrTexture* dstTexture;
176 GrTexture* tempTexture; 176 GrTexture* tempTexture;
177 SkAutoTUnref<GrTexture> temp1, temp2; 177 SkAutoTUnref<GrTexture> temp1, temp2;
178 178
179 temp1.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMa tch)); 179 temp1.reset(context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMa tch));
180 dstTexture = temp1.get(); 180 dstTexture = temp1.get();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 srcRect); 293 srcRect);
294 srcRect = dstRect; 294 srcRect = dstRect;
295 srcTexture = dstTexture; 295 srcTexture = dstTexture;
296 SkTSwap(dstTexture, tempTexture); 296 SkTSwap(dstTexture, tempTexture);
297 } 297 }
298 return SkRef(srcTexture); 298 return SkRef(srcTexture);
299 } 299 }
300 #endif 300 #endif
301 301
302 } 302 }
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698