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

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

Issue 474443003: Check all scratch texture allocations for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@m38_2125
Patch Set: Created 6 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
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | no next file » | 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 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
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 "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 GrEffect* xferEffect = NULL; 126 GrEffect* xferEffect = NULL;
127 127
128 GrTextureDesc desc; 128 GrTextureDesc desc;
129 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; 129 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
130 desc.fWidth = src.width(); 130 desc.fWidth = src.width();
131 desc.fHeight = src.height(); 131 desc.fHeight = src.height();
132 desc.fConfig = kSkia8888_GrPixelConfig; 132 desc.fConfig = kSkia8888_GrPixelConfig;
133 133
134 GrAutoScratchTexture ast(context, desc); 134 GrAutoScratchTexture ast(context, desc);
135 if (NULL == ast.texture()) {
136 return false;
137 }
135 SkAutoTUnref<GrTexture> dst(ast.detach()); 138 SkAutoTUnref<GrTexture> dst(ast.detach());
136 139
137 GrContext::AutoRenderTarget art(context, dst->asRenderTarget()); 140 GrContext::AutoRenderTarget art(context, dst->asRenderTarget());
138 141
139 if (!fMode || !fMode->asNewEffect(&xferEffect, backgroundTex)) { 142 if (!fMode || !fMode->asNewEffect(&xferEffect, backgroundTex)) {
140 // canFilterImageGPU() should've taken care of this 143 // canFilterImageGPU() should've taken care of this
141 SkASSERT(false); 144 SkASSERT(false);
142 return false; 145 return false;
143 } 146 }
144 147
(...skipping 10 matching lines...) Expand all
155 paint.addColorEffect(xferEffect)->unref(); 158 paint.addColorEffect(xferEffect)->unref();
156 context->drawRect(paint, srcRect); 159 context->drawRect(paint, srcRect);
157 160
158 offset->fX = backgroundOffset.fX; 161 offset->fX = backgroundOffset.fX;
159 offset->fY = backgroundOffset.fY; 162 offset->fY = backgroundOffset.fY;
160 WrapTexture(dst, src.width(), src.height(), result); 163 WrapTexture(dst, src.width(), src.height(), result);
161 return true; 164 return true;
162 } 165 }
163 166
164 #endif 167 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698