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

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

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 years, 5 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/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 GrTexture* backgroundTex = background.getTexture(); 117 GrTexture* backgroundTex = background.getTexture();
118 SkBitmap foreground = src; 118 SkBitmap foreground = src;
119 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); 119 SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
120 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und, 120 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und,
121 &foregroundOffset)) { 121 &foregroundOffset)) {
122 return onFilterImage(proxy, src, ctx, result, offset); 122 return onFilterImage(proxy, src, ctx, result, offset);
123 } 123 }
124 GrTexture* foregroundTex = foreground.getTexture(); 124 GrTexture* foregroundTex = foreground.getTexture();
125 GrContext* context = foregroundTex->getContext(); 125 GrContext* context = foregroundTex->getContext();
126 126
127 GrEffectRef* xferEffect = NULL; 127 GrEffect* xferEffect = NULL;
128 128
129 GrTextureDesc desc; 129 GrTextureDesc desc;
130 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit; 130 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
131 desc.fWidth = src.width(); 131 desc.fWidth = src.width();
132 desc.fHeight = src.height(); 132 desc.fHeight = src.height();
133 desc.fConfig = kSkia8888_GrPixelConfig; 133 desc.fConfig = kSkia8888_GrPixelConfig;
134 134
135 GrAutoScratchTexture ast(context, desc); 135 GrAutoScratchTexture ast(context, desc);
136 SkAutoTUnref<GrTexture> dst(ast.detach()); 136 SkAutoTUnref<GrTexture> dst(ast.detach());
137 137
(...skipping 18 matching lines...) Expand all
156 paint.addColorEffect(xferEffect)->unref(); 156 paint.addColorEffect(xferEffect)->unref();
157 context->drawRect(paint, srcRect); 157 context->drawRect(paint, srcRect);
158 158
159 offset->fX = backgroundOffset.fX; 159 offset->fX = backgroundOffset.fX;
160 offset->fY = backgroundOffset.fY; 160 offset->fY = backgroundOffset.fY;
161 WrapTexture(dst, src.width(), src.height(), result); 161 WrapTexture(dst, src.width(), src.height(), result);
162 return true; 162 return true;
163 } 163 }
164 164
165 #endif 165 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698