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

Unified Diff: src/core/SkConvolver.cpp

Issue 23796005: remove fConvolutionProcs from State, and just use it locally (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkConvolver.h ('k') | src/opts/SkBitmapProcState_opts_arm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkConvolver.cpp
diff --git a/src/core/SkConvolver.cpp b/src/core/SkConvolver.cpp
index f426ef00d111277e55d209005198e52364b58a1b..7666e6fadc99ac3b161403c91bee35fa0fdbe529 100644
--- a/src/core/SkConvolver.cpp
+++ b/src/core/SkConvolver.cpp
@@ -337,7 +337,7 @@ void BGRAConvolve2D(const unsigned char* sourceData,
const SkConvolutionFilter1D& filterY,
int outputByteRowStride,
unsigned char* output,
- SkConvolutionProcs* convolveProcs,
+ const SkConvolutionProcs& convolveProcs,
bool useSimdIfPossible) {
int maxYFilterSize = filterY.maxFilter();
@@ -364,7 +364,7 @@ void BGRAConvolve2D(const unsigned char* sourceData,
// convolution pass yet. Somehow Windows does not like it.
int rowBufferWidth = (filterX.numValues() + 15) & ~0xF;
int rowBufferHeight = maxYFilterSize +
- (convolveProcs->fConvolve4RowsHorizontally ? 4 : 0);
+ (convolveProcs.fConvolve4RowsHorizontally ? 4 : 0);
CircularRowBuffer rowBuffer(rowBufferWidth,
rowBufferHeight,
filterOffset);
@@ -387,7 +387,7 @@ void BGRAConvolve2D(const unsigned char* sourceData,
// rows we need to avoid the SSE implementation for here.
filterX.FilterForValue(filterX.numValues() - 1, &lastFilterOffset,
&lastFilterLength);
- int avoidSimdRows = 1 + convolveProcs->fExtraHorizontalReads /
+ int avoidSimdRows = 1 + convolveProcs.fExtraHorizontalReads /
(lastFilterOffset + lastFilterLength);
filterY.FilterForValue(numOutputRows - 1, &lastFilterOffset,
@@ -399,7 +399,7 @@ void BGRAConvolve2D(const unsigned char* sourceData,
// Generate output rows until we have enough to run the current filter.
while (nextXRow < filterOffset + filterLength) {
- if (convolveProcs->fConvolve4RowsHorizontally &&
+ if (convolveProcs.fConvolve4RowsHorizontally &&
nextXRow + 3 < lastFilterOffset + lastFilterLength -
avoidSimdRows) {
const unsigned char* src[4];
@@ -408,14 +408,14 @@ void BGRAConvolve2D(const unsigned char* sourceData,
src[i] = &sourceData[(nextXRow + i) * sourceByteRowStride];
outRow[i] = rowBuffer.advanceRow();
}
- convolveProcs->fConvolve4RowsHorizontally(src, filterX, outRow);
+ convolveProcs.fConvolve4RowsHorizontally(src, filterX, outRow);
nextXRow += 4;
} else {
// Check if we need to avoid SSE2 for this row.
- if (convolveProcs->fConvolveHorizontally &&
+ if (convolveProcs.fConvolveHorizontally &&
nextXRow < lastFilterOffset + lastFilterLength -
avoidSimdRows) {
- convolveProcs->fConvolveHorizontally(
+ convolveProcs.fConvolveHorizontally(
&sourceData[nextXRow * sourceByteRowStride],
filterX, rowBuffer.advanceRow(), sourceHasAlpha);
} else {
@@ -446,8 +446,8 @@ void BGRAConvolve2D(const unsigned char* sourceData,
unsigned char* const* firstRowForFilter =
&rowsToConvolve[filterOffset - firstRowInCircularBuffer];
- if (convolveProcs->fConvolveVertically) {
- convolveProcs->fConvolveVertically(filterValues, filterLength,
+ if (convolveProcs.fConvolveVertically) {
+ convolveProcs.fConvolveVertically(filterValues, filterLength,
firstRowForFilter,
filterX.numValues(), curOutputRow,
sourceHasAlpha);
« no previous file with comments | « src/core/SkConvolver.h ('k') | src/opts/SkBitmapProcState_opts_arm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698