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

Side by Side Diff: src/opts/SkBlurImage_opts_neon.cpp

Issue 587543003: Fix skia bug 2845 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/opts/SkBlurImage_opts_arm.cpp ('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 2013 The Android Open Source Project 2 * Copyright 2013 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 8
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 int leftOffset, int rightOffset, int width, int height) 116 int leftOffset, int rightOffset, int width, int height)
117 { 117 {
118 const int rightBorder = SkMin32(rightOffset + 1, width); 118 const int rightBorder = SkMin32(rightOffset + 1, width);
119 const int srcStrideX = srcDirection == kX ? 1 : srcStride; 119 const int srcStrideX = srcDirection == kX ? 1 : srcStride;
120 const int dstStrideX = dstDirection == kX ? 1 : height; 120 const int dstStrideX = dstDirection == kX ? 1 : height;
121 const int srcStrideY = srcDirection == kX ? srcStride : 1; 121 const int srcStrideY = srcDirection == kX ? srcStride : 1;
122 const int dstStrideY = dstDirection == kX ? width : 1; 122 const int dstStrideY = dstDirection == kX ? width : 1;
123 const uint32x4_t scale = vdupq_n_u32((1 << 24) / kernelSize); 123 const uint32x4_t scale = vdupq_n_u32((1 << 24) / kernelSize);
124 const uint32x4_t half = vdupq_n_u32(1 << 23); 124 const uint32x4_t half = vdupq_n_u32(1 << 23);
125 125
126 if (kernelSize < 128) 126 if (1 < kernelSize && kernelSize < 128)
127 { 127 {
128 SkDoubleRowBoxBlur_NEON<srcDirection, dstDirection>(&src, srcStride, &ds t, kernelSize, 128 SkDoubleRowBoxBlur_NEON<srcDirection, dstDirection>(&src, srcStride, &ds t, kernelSize,
129 leftOffset, rightOffset, width, &height); 129 leftOffset, rightOffset, width, &height);
130 } 130 }
131 131
132 for (; height > 0; height--) { 132 for (; height > 0; height--) {
133 uint32x4_t sum = vdupq_n_u32(0); 133 uint32x4_t sum = vdupq_n_u32(0);
134 const SkPMColor* p = src; 134 const SkPMColor* p = src;
135 for (int i = 0; i < rightBorder; ++i) { 135 for (int i = 0; i < rightBorder; ++i) {
136 sum = vaddw_u16(sum, expand(*p)); 136 sum = vaddw_u16(sum, expand(*p));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 bool SkBoxBlurGetPlatformProcs_NEON(SkBoxBlurProc* boxBlurX, 179 bool SkBoxBlurGetPlatformProcs_NEON(SkBoxBlurProc* boxBlurX,
180 SkBoxBlurProc* boxBlurY, 180 SkBoxBlurProc* boxBlurY,
181 SkBoxBlurProc* boxBlurXY, 181 SkBoxBlurProc* boxBlurXY,
182 SkBoxBlurProc* boxBlurYX) { 182 SkBoxBlurProc* boxBlurYX) {
183 *boxBlurX = SkBoxBlur_NEON<kX, kX>; 183 *boxBlurX = SkBoxBlur_NEON<kX, kX>;
184 *boxBlurY = SkBoxBlur_NEON<kY, kY>; 184 *boxBlurY = SkBoxBlur_NEON<kY, kY>;
185 *boxBlurXY = SkBoxBlur_NEON<kX, kY>; 185 *boxBlurXY = SkBoxBlur_NEON<kX, kY>;
186 *boxBlurYX = SkBoxBlur_NEON<kY, kX>; 186 *boxBlurYX = SkBoxBlur_NEON<kY, kX>;
187 return true; 187 return true;
188 } 188 }
OLDNEW
« no previous file with comments | « src/opts/SkBlurImage_opts_arm.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698