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

Side by Side Diff: src/core/SkBitmapProcState.h

Issue 22801016: Implement highQualityFilter16 so GM doesn't crash when you give it resources. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkBitmapProcState_DEFINED 10 #ifndef SkBitmapProcState_DEFINED
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 SkScaledImageCache::ID* fScaledCacheID; 159 SkScaledImageCache::ID* fScaledCacheID;
160 160
161 MatrixProc chooseMatrixProc(bool trivial_matrix); 161 MatrixProc chooseMatrixProc(bool trivial_matrix);
162 bool chooseProcs(const SkMatrix& inv, const SkPaint&); 162 bool chooseProcs(const SkMatrix& inv, const SkPaint&);
163 ShaderProc32 chooseShaderProc32(); 163 ShaderProc32 chooseShaderProc32();
164 164
165 void possiblyScaleImage(); 165 void possiblyScaleImage();
166 166
167 SkBitmapFilter* fBitmapFilter; 167 SkBitmapFilter* fBitmapFilter;
168 168
169 ShaderProc32 chooseBitmapFilterProc(); 169 // If supported, sets fShaderProc32 and fShaderProc16 and returns true,
170 // otherwise returns false.
171 bool setBitmapFilterProcs();
170 172
171 // Return false if we failed to setup for fast translate (e.g. overflow) 173 // Return false if we failed to setup for fast translate (e.g. overflow)
172 bool setupForTranslate(); 174 bool setupForTranslate();
173 175
174 #ifdef SK_DEBUG 176 #ifdef SK_DEBUG
175 static void DebugMatrixProc(const SkBitmapProcState&, 177 static void DebugMatrixProc(const SkBitmapProcState&,
176 uint32_t[], int count, int x, int y); 178 uint32_t[], int count, int x, int y);
177 #endif 179 #endif
178 }; 180 };
179 181
(...skipping 21 matching lines...) Expand all
201 #define pack_two_shorts(pri, sec) PACK_TWO_SHORTS(pri, sec) 203 #define pack_two_shorts(pri, sec) PACK_TWO_SHORTS(pri, sec)
202 #endif 204 #endif
203 205
204 // These functions are generated via macros, but are exposed here so that 206 // These functions are generated via macros, but are exposed here so that
205 // platformProcs may test for them by name. 207 // platformProcs may test for them by name.
206 void S32_opaque_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[], 208 void S32_opaque_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[],
207 int count, SkPMColor colors[]); 209 int count, SkPMColor colors[]);
208 void S32_alpha_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[], 210 void S32_alpha_D32_filter_DX(const SkBitmapProcState& s, const uint32_t xy[],
209 int count, SkPMColor colors[]); 211 int count, SkPMColor colors[]);
210 void S32_opaque_D32_filter_DXDY(const SkBitmapProcState& s, 212 void S32_opaque_D32_filter_DXDY(const SkBitmapProcState& s,
211 const uint32_t xy[], int count, SkPMColor colors[]); 213 const uint32_t xy[], int count, SkPMColor colors []);
212 void S32_alpha_D32_filter_DXDY(const SkBitmapProcState& s, 214 void S32_alpha_D32_filter_DXDY(const SkBitmapProcState& s,
213 const uint32_t xy[], int count, SkPMColor colors[]); 215 const uint32_t xy[], int count, SkPMColor colors[ ]);
214 void ClampX_ClampY_filter_scale(const SkBitmapProcState& s, uint32_t xy[], 216 void ClampX_ClampY_filter_scale(const SkBitmapProcState& s, uint32_t xy[],
215 int count, int x, int y); 217 int count, int x, int y);
216 void ClampX_ClampY_nofilter_scale(const SkBitmapProcState& s, uint32_t xy[], 218 void ClampX_ClampY_nofilter_scale(const SkBitmapProcState& s, uint32_t xy[],
217 int count, int x, int y); 219 int count, int x, int y);
218 void ClampX_ClampY_filter_affine(const SkBitmapProcState& s, 220 void ClampX_ClampY_filter_affine(const SkBitmapProcState& s,
219 uint32_t xy[], int count, int x, int y); 221 uint32_t xy[], int count, int x, int y);
220 void ClampX_ClampY_nofilter_affine(const SkBitmapProcState& s, 222 void ClampX_ClampY_nofilter_affine(const SkBitmapProcState& s,
221 uint32_t xy[], int count, int x, int y); 223 uint32_t xy[], int count, int x, int y);
222 void S32_D16_filter_DX(const SkBitmapProcState& s, 224 void S32_D16_filter_DX(const SkBitmapProcState& s,
223 const uint32_t* xy, int count, uint16_t* colo rs); 225 const uint32_t* xy, int count, uint16_t* colors);
224 226
225 void highQualityFilter(const SkBitmapProcState &s, int x, int y, 227 void highQualityFilter32(const SkBitmapProcState &s, int x, int y,
226 SkPMColor *SK_RESTRICT colors, int count); 228 SkPMColor *SK_RESTRICT colors, int count);
229 void highQualityFilter16(const SkBitmapProcState &s, int x, int y,
230 uint16_t *SK_RESTRICT colors, int count);
227 231
228 232
229 #endif 233 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698