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/SkBicubicImageFilter.cpp

Issue 234243002: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/SkAlphaThresholdFilter.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 const SkBitmap& source, 84 const SkBitmap& source,
85 const Context& ctx, 85 const Context& ctx,
86 SkBitmap* result, 86 SkBitmap* result,
87 SkIPoint* offset) const { 87 SkIPoint* offset) const {
88 SkBitmap src = source; 88 SkBitmap src = source;
89 SkIPoint srcOffset = SkIPoint::Make(0, 0); 89 SkIPoint srcOffset = SkIPoint::Make(0, 0);
90 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO ffset)) { 90 if (getInput(0) && !getInput(0)->filterImage(proxy, source, ctx, &src, &srcO ffset)) {
91 return false; 91 return false;
92 } 92 }
93 93
94 if (src.colorType() != kN32_SkColorType) { 94 if (src.colorType() != kPMColor_SkColorType) {
95 return false; 95 return false;
96 } 96 }
97 97
98 SkAutoLockPixels alp(src); 98 SkAutoLockPixels alp(src);
99 if (!src.getPixels()) { 99 if (!src.getPixels()) {
100 return false; 100 return false;
101 } 101 }
102 102
103 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth), 103 SkRect dstRect = SkRect::MakeWH(SkScalarMul(SkIntToScalar(src.width()), fSca le.fWidth),
104 SkScalarMul(SkIntToScalar(src.height()), fSc ale.fHeight)); 104 SkScalarMul(SkIntToScalar(src.height()), fSc ale.fHeight));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref(); 196 paint.addColorEffect(GrBicubicEffect::Create(srcTexture, fCoefficients))->un ref();
197 SkRect srcRect; 197 SkRect srcRect;
198 srcBM.getBounds(&srcRect); 198 srcBM.getBounds(&srcRect);
199 context->drawRectToRect(paint, dstRect, srcRect); 199 context->drawRectToRect(paint, dstRect, srcRect);
200 WrapTexture(dst, desc.fWidth, desc.fHeight, result); 200 WrapTexture(dst, desc.fWidth, desc.fHeight, result);
201 return true; 201 return true;
202 } 202 }
203 #endif 203 #endif
204 204
205 /////////////////////////////////////////////////////////////////////////////// 205 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkBlurImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698