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

Side by Side Diff: src/effects/SkXfermodeImageFilter.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/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrClipMaskManager.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 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und, 138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und,
139 &foregroundOffset)) { 139 &foregroundOffset)) {
140 return onFilterImage(proxy, src, ctx, result, offset); 140 return onFilterImage(proxy, src, ctx, result, offset);
141 } 141 }
142 GrTexture* foregroundTex = foreground.getTexture(); 142 GrTexture* foregroundTex = foreground.getTexture();
143 GrContext* context = foregroundTex->getContext(); 143 GrContext* context = foregroundTex->getContext();
144 144
145 GrFragmentProcessor* xferProcessor = NULL; 145 GrFragmentProcessor* xferProcessor = NULL;
146 146
147 GrSurfaceDesc desc; 147 GrSurfaceDesc desc;
148 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; 148 desc.fFlags = kRenderTarget_GrSurfaceFlag;
149 desc.fWidth = src.width(); 149 desc.fWidth = src.width();
150 desc.fHeight = src.height(); 150 desc.fHeight = src.height();
151 desc.fConfig = kSkia8888_GrPixelConfig; 151 desc.fConfig = kSkia8888_GrPixelConfig;
152 SkAutoTUnref<GrTexture> dst( 152 SkAutoTUnref<GrTexture> dst(
153 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); 153 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch));
154 if (!dst) { 154 if (!dst) {
155 return false; 155 return false;
156 } 156 }
157 157
158 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { 158 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) {
(...skipping 16 matching lines...) Expand all
175 context->drawRect(dst->asRenderTarget(), paint, SkMatrix::I(), srcRect); 175 context->drawRect(dst->asRenderTarget(), paint, SkMatrix::I(), srcRect);
176 176
177 offset->fX = backgroundOffset.fX; 177 offset->fX = backgroundOffset.fX;
178 offset->fY = backgroundOffset.fY; 178 offset->fY = backgroundOffset.fY;
179 WrapTexture(dst, src.width(), src.height(), result); 179 WrapTexture(dst, src.width(), src.height(), result);
180 return true; 180 return true;
181 } 181 }
182 182
183 #endif 183 #endif
184 184
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698