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

Side by Side Diff: src/effects/SkXfermodeImageFilter.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/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 GrTexture* foregroundTex = foreground.getTexture(); 141 GrTexture* foregroundTex = foreground.getTexture();
142 GrContext* context = foregroundTex->getContext(); 142 GrContext* context = foregroundTex->getContext();
143 143
144 GrFragmentProcessor* xferProcessor = NULL; 144 GrFragmentProcessor* xferProcessor = NULL;
145 145
146 GrSurfaceDesc desc; 146 GrSurfaceDesc desc;
147 desc.fFlags = kRenderTarget_GrSurfaceFlag; 147 desc.fFlags = kRenderTarget_GrSurfaceFlag;
148 desc.fWidth = src.width(); 148 desc.fWidth = src.width();
149 desc.fHeight = src.height(); 149 desc.fHeight = src.height();
150 desc.fConfig = kSkia8888_GrPixelConfig; 150 desc.fConfig = kSkia8888_GrPixelConfig;
151 SkAutoTUnref<GrTexture> dst( 151 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture(
152 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); 152 desc, GrTextureProvider::kApprox_ScratchTexMatch));
153 if (!dst) { 153 if (!dst) {
154 return false; 154 return false;
155 } 155 }
156 156
157 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) { 157 if (!fMode || !fMode->asFragmentProcessor(&xferProcessor, backgroundTex)) {
158 // canFilterImageGPU() should've taken care of this 158 // canFilterImageGPU() should've taken care of this
159 SkASSERT(false); 159 SkASSERT(false);
160 return false; 160 return false;
161 } 161 }
162 162
(...skipping 18 matching lines...) Expand all
181 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix ::I(), srcRect); 181 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix ::I(), srcRect);
182 182
183 offset->fX = backgroundOffset.fX; 183 offset->fX = backgroundOffset.fX;
184 offset->fY = backgroundOffset.fY; 184 offset->fY = backgroundOffset.fY;
185 WrapTexture(dst, src.width(), src.height(), result); 185 WrapTexture(dst, src.width(), src.height(), result);
186 return true; 186 return true;
187 } 187 }
188 188
189 #endif 189 #endif
190 190
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698