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

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

Issue 1314583003: Replace SkPin32 with SkTPin and remove. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment. Created 5 years, 3 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/SkMagnifierImageFilter.cpp ('k') | src/effects/SkTableMaskFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkMatrixConvolutionImageFilter.h" 8 #include "SkMatrixConvolutionImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 class UncheckedPixelFetcher { 119 class UncheckedPixelFetcher {
120 public: 120 public:
121 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) { 121 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) {
122 return *src.getAddr32(x, y); 122 return *src.getAddr32(x, y);
123 } 123 }
124 }; 124 };
125 125
126 class ClampPixelFetcher { 126 class ClampPixelFetcher {
127 public: 127 public:
128 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) { 128 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) {
129 x = SkPin32(x, bounds.fLeft, bounds.fRight - 1); 129 x = SkTPin(x, bounds.fLeft, bounds.fRight - 1);
130 y = SkPin32(y, bounds.fTop, bounds.fBottom - 1); 130 y = SkTPin(y, bounds.fTop, bounds.fBottom - 1);
131 return *src.getAddr32(x, y); 131 return *src.getAddr32(x, y);
132 } 132 }
133 }; 133 };
134 134
135 class RepeatPixelFetcher { 135 class RepeatPixelFetcher {
136 public: 136 public:
137 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) { 137 static inline SkPMColor fetch(const SkBitmap& src, int x, int y, const SkIRe ct& bounds) {
138 x = (x - bounds.left()) % bounds.width() + bounds.left(); 138 x = (x - bounds.left()) % bounds.width() + bounds.left();
139 y = (y - bounds.top()) % bounds.height() + bounds.top(); 139 y = (y - bounds.top()) % bounds.height() + bounds.top();
140 if (x < bounds.left()) { 140 if (x < bounds.left()) {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]); 378 str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
379 } 379 }
380 } 380 }
381 str->appendf(")"); 381 str->appendf(")");
382 str->appendf("gain: %f bias: %f ", fGain, fBias); 382 str->appendf("gain: %f bias: %f ", fGain, fBias);
383 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY); 383 str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
384 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false"); 384 str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
385 str->append(")"); 385 str->append(")");
386 } 386 }
387 #endif 387 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkTableMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698