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

Side by Side Diff: src/core/SkConvolver.cpp

Issue 2270613003: Remove some useless declarations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove a useless check, here, the value of 'a' must be at least 256 Created 4 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 | « 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 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "SkConvolver.h" 5 #include "SkConvolver.h"
6 #include "SkTArray.h" 6 #include "SkTArray.h"
7 7
8 namespace { 8 namespace {
9 9
10 // Converts the argument to an 8-bit unsigned value by clamping to the range 10 // Converts the argument to an 8-bit unsigned value by clamping to the range
11 // 0-255. 11 // 0-255.
12 inline unsigned char ClampTo8(int a) { 12 inline unsigned char ClampTo8(int a) {
13 if (static_cast<unsigned>(a) < 256) { 13 if (static_cast<unsigned>(a) < 256) {
14 return a; // Avoid the extra check in the common case. 14 return a; // Avoid the extra check in the common case.
15 } 15 }
16 if (a < 0) {
17 return 0;
18 }
19 return 255; 16 return 255;
20 } 17 }
21 18
22 // Stores a list of rows in a circular buffer. The usage is you write into i t 19 // Stores a list of rows in a circular buffer. The usage is you write into i t
23 // by calling AdvanceRow. It will keep track of which row in the buffer it 20 // by calling AdvanceRow. It will keep track of which row in the buffer it
24 // should use next, and the total number of rows added. 21 // should use next, and the total number of rows added.
25 class CircularRowBuffer { 22 class CircularRowBuffer {
26 public: 23 public:
27 // The number of pixels in each row is given in |sourceRowPixelWidth|. 24 // The number of pixels in each row is given in |sourceRowPixelWidth|.
28 // The maximum number of rows needed in the buffer is |maxYFilterSize| 25 // The maximum number of rows needed in the buffer is |maxYFilterSize|
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 sourceHasAlpha); 474 sourceHasAlpha);
478 } else { 475 } else {
479 ConvolveVertically(filterValues, filterLength, 476 ConvolveVertically(filterValues, filterLength,
480 firstRowForFilter, 477 firstRowForFilter,
481 filterX.numValues(), curOutputRow, 478 filterX.numValues(), curOutputRow,
482 sourceHasAlpha); 479 sourceHasAlpha);
483 } 480 }
484 } 481 }
485 return true; 482 return true;
486 } 483 }
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