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

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

Issue 1302033004: Return failure if getInputResultsGPU fails in SkXfermodeImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy, 129 bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
130 const SkBitmap& src, 130 const SkBitmap& src,
131 const Context& ctx, 131 const Context& ctx,
132 SkBitmap* result, 132 SkBitmap* result,
133 SkIPoint* offset) const { 133 SkIPoint* offset) const {
134 SkBitmap background = src; 134 SkBitmap background = src;
135 SkIPoint backgroundOffset = SkIPoint::Make(0, 0); 135 SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
136 if (this->getInput(0) && 136 if (this->getInput(0) &&
137 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &background, &bac kgroundOffset)) { 137 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &background, &bac kgroundOffset)) {
138 return this->onFilterImage(proxy, src, ctx, result, offset); 138 return false;
139 } 139 }
140 140
141 GrTexture* backgroundTex = background.getTexture(); 141 GrTexture* backgroundTex = background.getTexture();
142 if (NULL == backgroundTex) { 142 if (NULL == backgroundTex) {
143 SkASSERT(false); 143 SkASSERT(false);
144 return false; 144 return false;
145 } 145 }
146 146
147 SkBitmap foreground = src; 147 SkBitmap foreground = src;
148 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); 148 SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
149 if (this->getInput(1) && 149 if (this->getInput(1) &&
150 !this->getInput(1)->getInputResultGPU(proxy, src, ctx, &foreground, &for egroundOffset)) { 150 !this->getInput(1)->getInputResultGPU(proxy, src, ctx, &foreground, &for egroundOffset)) {
151 return this->onFilterImage(proxy, src, ctx, result, offset); 151 return false;
152 } 152 }
153 GrTexture* foregroundTex = foreground.getTexture(); 153 GrTexture* foregroundTex = foreground.getTexture();
154 GrContext* context = foregroundTex->getContext(); 154 GrContext* context = foregroundTex->getContext();
155 155
156 GrFragmentProcessor* xferProcessor = NULL; 156 GrFragmentProcessor* xferProcessor = NULL;
157 157
158 GrSurfaceDesc desc; 158 GrSurfaceDesc desc;
159 desc.fFlags = kRenderTarget_GrSurfaceFlag; 159 desc.fFlags = kRenderTarget_GrSurfaceFlag;
160 desc.fWidth = src.width(); 160 desc.fWidth = src.width();
161 desc.fHeight = src.height(); 161 desc.fHeight = src.height();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 SkMatrix::I(), srcRect); 201 SkMatrix::I(), srcRect);
202 202
203 offset->fX = backgroundOffset.fX; 203 offset->fX = backgroundOffset.fX;
204 offset->fY = backgroundOffset.fY; 204 offset->fY = backgroundOffset.fY;
205 WrapTexture(dst, src.width(), src.height(), result); 205 WrapTexture(dst, src.width(), src.height(), result);
206 return true; 206 return true;
207 } 207 }
208 208
209 #endif 209 #endif
210 210
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698