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

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

Issue 15600003: Remove SkImageFilter::getInputResult(), since its return value is not (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkBlurImageFilter.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 "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 SkScalarRoundToInt(SkScalarClampMax(r, a)), 74 SkScalarRoundToInt(SkScalarClampMax(r, a)),
75 SkScalarRoundToInt(SkScalarClampMax(g, a)), 75 SkScalarRoundToInt(SkScalarClampMax(g, a)),
76 SkScalarRoundToInt(SkScalarClampMax(b, a))); 76 SkScalarRoundToInt(SkScalarClampMax(b, a)));
77 } 77 }
78 78
79 bool SkBicubicImageFilter::onFilterImage(Proxy* proxy, 79 bool SkBicubicImageFilter::onFilterImage(Proxy* proxy,
80 const SkBitmap& source, 80 const SkBitmap& source,
81 const SkMatrix& matrix, 81 const SkMatrix& matrix,
82 SkBitmap* result, 82 SkBitmap* result,
83 SkIPoint* loc) { 83 SkIPoint* loc) {
84 SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); 84 SkBitmap src = source;
85 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, lo c)) {
86 return false;
87 }
88
85 if (src.config() != SkBitmap::kARGB_8888_Config) { 89 if (src.config() != SkBitmap::kARGB_8888_Config) {
86 return false; 90 return false;
87 } 91 }
88 92
89 SkAutoLockPixels alp(src); 93 SkAutoLockPixels alp(src);
90 if (!src.getPixels()) { 94 if (!src.getPixels()) {
91 return false; 95 return false;
92 } 96 }
93 97
94 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth), 98 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth),
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 GrPaint paint; 367 GrPaint paint;
364 paint.colorStage(0)->setEffect(GrBicubicEffect::Create(srcTexture, fCoeffici ents))->unref(); 368 paint.colorStage(0)->setEffect(GrBicubicEffect::Create(srcTexture, fCoeffici ents))->unref();
365 SkRect srcRect; 369 SkRect srcRect;
366 srcBM.getBounds(&srcRect); 370 srcBM.getBounds(&srcRect);
367 context->drawRectToRect(paint, dstRect, srcRect); 371 context->drawRectToRect(paint, dstRect, srcRect);
368 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t); 372 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul t);
369 } 373 }
370 #endif 374 #endif
371 375
372 /////////////////////////////////////////////////////////////////////////////// 376 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698