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

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

Issue 853543003: Do some minor pre cleanup work before converting all xfermodes to XPs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Review updates Created 5 years, 11 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/core/SkXfermode.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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 const Context& ctx, 120 const Context& ctx,
121 SkBitmap* result, 121 SkBitmap* result,
122 SkIPoint* offset) const { 122 SkIPoint* offset) const {
123 SkBitmap background = src; 123 SkBitmap background = src;
124 SkIPoint backgroundOffset = SkIPoint::Make(0, 0); 124 SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
125 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &backgro und, 125 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &backgro und,
126 &backgroundOffset)) { 126 &backgroundOffset)) {
127 return onFilterImage(proxy, src, ctx, result, offset); 127 return onFilterImage(proxy, src, ctx, result, offset);
128 } 128 }
129 GrTexture* backgroundTex = background.getTexture(); 129 GrTexture* backgroundTex = background.getTexture();
130
131 if (NULL == backgroundTex) {
132 SkASSERT(false);
133 return false;
134 }
135
130 SkBitmap foreground = src; 136 SkBitmap foreground = src;
131 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); 137 SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
132 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und, 138 if (getInput(1) && !getInput(1)->getInputResultGPU(proxy, src, ctx, &foregro und,
133 &foregroundOffset)) { 139 &foregroundOffset)) {
134 return onFilterImage(proxy, src, ctx, result, offset); 140 return onFilterImage(proxy, src, ctx, result, offset);
135 } 141 }
136 GrTexture* foregroundTex = foreground.getTexture(); 142 GrTexture* foregroundTex = foreground.getTexture();
137 GrContext* context = foregroundTex->getContext(); 143 GrContext* context = foregroundTex->getContext();
138 144
139 GrFragmentProcessor* xferProcessor = NULL; 145 GrFragmentProcessor* xferProcessor = NULL;
(...skipping 30 matching lines...) Expand all
170 context->drawRect(paint, SkMatrix::I(), srcRect); 176 context->drawRect(paint, SkMatrix::I(), srcRect);
171 177
172 offset->fX = backgroundOffset.fX; 178 offset->fX = backgroundOffset.fX;
173 offset->fY = backgroundOffset.fY; 179 offset->fY = backgroundOffset.fY;
174 WrapTexture(dst, src.width(), src.height(), result); 180 WrapTexture(dst, src.width(), src.height(), result);
175 return true; 181 return true;
176 } 182 }
177 183
178 #endif 184 #endif
179 185
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698