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

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

Issue 19335002: Production quality fast image up/downsampler (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: clean up use of filter quality flags Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The Android Open Source Project 2 * Copyright 2009 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 "SkBitmapProcState_opts_SSE2.h" 8 #include "SkBitmapProcState_opts_SSE2.h"
9 #include "SkBitmapProcState_opts_SSSE3.h" 9 #include "SkBitmapProcState_opts_SSSE3.h"
10 #include "SkBitmapFilter_opts_SSE2.h" 10 #include "SkBitmapFilter_opts_SSE2.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return gHasSSE2; 100 return gHasSSE2;
101 } 101 }
102 102
103 static bool cachedHasSSSE3() { 103 static bool cachedHasSSSE3() {
104 static bool gHasSSSE3 = hasSSSE3(); 104 static bool gHasSSSE3 = hasSSSE3();
105 return gHasSSSE3; 105 return gHasSSSE3;
106 } 106 }
107 107
108 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U se SSE optimized version of high quality image filters"); 108 SK_CONF_DECLARE( bool, c_hqfilter_sse, "bitmap.filter.highQualitySSE", false, "U se SSE optimized version of high quality image filters");
109 109
110 void SkBitmapProcState::platformConvolutionProcs() {
111 if (cachedHasSSE2()) {
112 fConvolutionProcs->fExtraHorizontalReads = 3;
113 fConvolutionProcs->fConvolveVertically = &convolveVertically_SSE2;
114 fConvolutionProcs->fConvolve4RowsHorizontally = &convolve4RowsHorizontal ly_SSE2;
115 fConvolutionProcs->fConvolveHorizontally = &convolveHorizontally_SSE2;
116 }
117 }
118
110 void SkBitmapProcState::platformProcs() { 119 void SkBitmapProcState::platformProcs() {
111 if (cachedHasSSSE3()) { 120 if (cachedHasSSSE3()) {
112 #if !defined(SK_BUILD_FOR_ANDROID) 121 #if !defined(SK_BUILD_FOR_ANDROID)
113 // Disable SSSE3 optimization for Android x86 122 // Disable SSSE3 optimization for Android x86
114 if (fSampleProc32 == S32_opaque_D32_filter_DX) { 123 if (fSampleProc32 == S32_opaque_D32_filter_DX) {
115 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3; 124 fSampleProc32 = S32_opaque_D32_filter_DX_SSSE3;
116 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) { 125 } else if (fSampleProc32 == S32_alpha_D32_filter_DX) {
117 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3; 126 fSampleProc32 = S32_alpha_D32_filter_DX_SSSE3;
118 } 127 }
119 128
(...skipping 24 matching lines...) Expand all
144 153
145 if (fMatrixProc == ClampX_ClampY_filter_affine) { 154 if (fMatrixProc == ClampX_ClampY_filter_affine) {
146 fMatrixProc = ClampX_ClampY_filter_affine_SSE2; 155 fMatrixProc = ClampX_ClampY_filter_affine_SSE2;
147 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) { 156 } else if (fMatrixProc == ClampX_ClampY_nofilter_affine) {
148 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2; 157 fMatrixProc = ClampX_ClampY_nofilter_affine_SSE2;
149 } 158 }
150 if (c_hqfilter_sse) { 159 if (c_hqfilter_sse) {
151 if (fShaderProc32 == highQualityFilter) { 160 if (fShaderProc32 == highQualityFilter) {
152 fShaderProc32 = highQualityFilter_SSE2; 161 fShaderProc32 = highQualityFilter_SSE2;
153 } 162 }
154 if (fShaderProc32 == highQualityFilter_ScaleOnly) {
155 fShaderProc32 = highQualityFilter_ScaleOnly_SSE2;
156 }
157 } 163 }
158 } 164 }
159 } 165 }
160 166
161 static SkBlitRow::Proc32 platform_32_procs[] = { 167 static SkBlitRow::Proc32 platform_32_procs[] = {
162 NULL, // S32_Opaque, 168 NULL, // S32_Opaque,
163 S32_Blend_BlitRow32_SSE2, // S32_Blend, 169 S32_Blend_BlitRow32_SSE2, // S32_Blend,
164 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque 170 S32A_Opaque_BlitRow32_SSE2, // S32A_Opaque
165 S32A_Blend_BlitRow32_SSE2, // S32A_Blend, 171 S32A_Blend_BlitRow32_SSE2, // S32A_Blend,
166 }; 172 };
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 252
247 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning 253 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning
248 254
249 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { 255 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
250 if (cachedHasSSE2()) { 256 if (cachedHasSSE2()) {
251 return ColorRect32_SSE2; 257 return ColorRect32_SSE2;
252 } else { 258 } else {
253 return NULL; 259 return NULL;
254 } 260 }
255 } 261 }
OLDNEW
« src/core/SkConvolver.cpp ('K') | « src/opts/SkBitmapProcState_opts_none.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698