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

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

Issue 57823003: Add SK_PREFETCH and use in SkBlurImageFilter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: slimmer change Created 7 years, 1 month 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 | Annotate | Revision Log
« include/core/SkPostConfig.h ('K') | « include/core/SkPostConfig.h ('k') | 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 /* 1 /*
2 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 sumB -= SkGetPackedB32(l); 137 sumB -= SkGetPackedB32(l);
138 } 138 }
139 if (y + bottomOffset + 1 < height) { 139 if (y + bottomOffset + 1 < height) {
140 SkColor r = *(sptr + (bottomOffset + 1) * srcStride); 140 SkColor r = *(sptr + (bottomOffset + 1) * srcStride);
141 sumA += SkGetPackedA32(r); 141 sumA += SkGetPackedA32(r);
142 sumR += SkGetPackedR32(r); 142 sumR += SkGetPackedR32(r);
143 sumG += SkGetPackedG32(r); 143 sumG += SkGetPackedG32(r);
144 sumB += SkGetPackedB32(r); 144 sumB += SkGetPackedB32(r);
145 } 145 }
146 sptr += srcStride; 146 sptr += srcStride;
147 // The next leading pixel seems to be too hard to predict. Hint the fetch.
148 SK_PREFETCH(sptr + (bottomOffset + 1) * srcStride);
147 dptr += dstStride; 149 dptr += dstStride;
148 } 150 }
149 } 151 }
150 } 152 }
151 153
152 static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo wOffset, 154 static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo wOffset,
153 int *highOffset) 155 int *highOffset)
154 { 156 {
155 float pi = SkScalarToFloat(SK_ScalarPI); 157 float pi = SkScalarToFloat(SK_ScalarPI);
156 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi) / 4.0f + 0.5f)); 158 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi) / 4.0f + 0.5f));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 fSigma.width(), 255 fSigma.width(),
254 fSigma.height())); 256 fSigma.height()));
255 offset->fX += rect.fLeft; 257 offset->fX += rect.fLeft;
256 offset->fY += rect.fTop; 258 offset->fY += rect.fTop;
257 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res ult); 259 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res ult);
258 #else 260 #else
259 SkDEBUGFAIL("Should not call in GPU-less build"); 261 SkDEBUGFAIL("Should not call in GPU-less build");
260 return false; 262 return false;
261 #endif 263 #endif
262 } 264 }
OLDNEW
« include/core/SkPostConfig.h ('K') | « include/core/SkPostConfig.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698