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

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

Issue 234833003: 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/SkBlurImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.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 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 SkBitmap* dst, 198 SkBitmap* dst,
199 SkIPoint* offset) const { 199 SkIPoint* offset) const {
200 SkBitmap displ = src, color = src; 200 SkBitmap displ = src, color = src;
201 const SkImageFilter* colorInput = getColorInput(); 201 const SkImageFilter* colorInput = getColorInput();
202 const SkImageFilter* displInput = getDisplacementInput(); 202 const SkImageFilter* displInput = getDisplacementInput();
203 SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0); 203 SkIPoint colorOffset = SkIPoint::Make(0, 0), displOffset = SkIPoint::Make(0, 0);
204 if ((colorInput && !colorInput->filterImage(proxy, src, ctx, &color, &colorO ffset)) || 204 if ((colorInput && !colorInput->filterImage(proxy, src, ctx, &color, &colorO ffset)) ||
205 (displInput && !displInput->filterImage(proxy, src, ctx, &displ, &displO ffset))) { 205 (displInput && !displInput->filterImage(proxy, src, ctx, &displ, &displO ffset))) {
206 return false; 206 return false;
207 } 207 }
208 if ((displ.colorType() != kN32_SkColorType) || 208 if ((displ.colorType() != kPMColor_SkColorType) ||
209 (color.colorType() != kN32_SkColorType)) { 209 (color.colorType() != kPMColor_SkColorType)) {
210 return false; 210 return false;
211 } 211 }
212 SkIRect bounds; 212 SkIRect bounds;
213 // Since computeDisplacement does bounds checking on color pixel access, we don't need to pad 213 // Since computeDisplacement does bounds checking on color pixel access, we don't need to pad
214 // the color bitmap to bounds here. 214 // the color bitmap to bounds here.
215 if (!this->applyCropRect(ctx, color, colorOffset, &bounds)) { 215 if (!this->applyCropRect(ctx, color, colorOffset, &bounds)) {
216 return false; 216 return false;
217 } 217 }
218 SkIRect displBounds; 218 SkIRect displBounds;
219 if (!this->applyCropRect(ctx, proxy, displ, &displOffset, &displBounds, &dis pl)) { 219 if (!this->applyCropRect(ctx, proxy, displ, &displOffset, &displBounds, &dis pl)) {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 const GrGLCaps&) { 604 const GrGLCaps&) {
605 const GrDisplacementMapEffect& displacementMap = 605 const GrDisplacementMapEffect& displacementMap =
606 drawEffect.castEffect<GrDisplacementMapEffect>(); 606 drawEffect.castEffect<GrDisplacementMapEffect>();
607 607
608 EffectKey xKey = displacementMap.xChannelSelector(); 608 EffectKey xKey = displacementMap.xChannelSelector();
609 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi ts; 609 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi ts;
610 610
611 return xKey | yKey; 611 return xKey | yKey;
612 } 612 }
613 #endif 613 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698