OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 Google Inc. |
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 // The copyright below was added in 2009, but I see no record of moto contributi
ons...? | 8 // The copyright below was added in 2009, but I see no record of moto contributi
ons...? |
9 | 9 |
10 /* NEON optimized code (C) COPYRIGHT 2009 Motorola | 10 /* NEON optimized code (C) COPYRIGHT 2009 Motorola |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 321 } |
322 #else | 322 #else |
323 for (int i = 0; i < count; i++) { | 323 for (int i = 0; i < count; i++) { |
324 *xptr++ = start++; | 324 *xptr++ = start++; |
325 } | 325 } |
326 #endif | 326 #endif |
327 } | 327 } |
328 | 328 |
329 static int nofilter_trans_preamble(const SkBitmapProcState& s, uint32_t** xy, | 329 static int nofilter_trans_preamble(const SkBitmapProcState& s, uint32_t** xy, |
330 int x, int y) { | 330 int x, int y) { |
331 SkPoint pt; | 331 const SkBitmapProcStateAutoMapper mapper(s, x, y); |
332 s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf, | 332 **xy = s.fIntTileProcY(SkFractionalIntToInt(mapper.y()), s.fPixmap.height())
; |
333 SkIntToScalar(y) + SK_ScalarHalf, &pt); | |
334 **xy = s.fIntTileProcY(SkScalarToFixed(pt.fY) >> 16, | |
335 s.fPixmap.height()); | |
336 *xy += 1; // bump the ptr | 333 *xy += 1; // bump the ptr |
337 // return our starting X position | 334 // return our starting X position |
338 return SkScalarToFixed(pt.fX) >> 16; | 335 return SkFractionalIntToInt(mapper.x()); |
339 } | 336 } |
340 | 337 |
341 static void clampx_nofilter_trans(const SkBitmapProcState& s, | 338 static void clampx_nofilter_trans(const SkBitmapProcState& s, |
342 uint32_t xy[], int count, int x, int y) { | 339 uint32_t xy[], int count, int x, int y) { |
343 SkASSERT((s.fInvType & ~SkMatrix::kTranslate_Mask) == 0); | 340 SkASSERT((s.fInvType & ~SkMatrix::kTranslate_Mask) == 0); |
344 | 341 |
345 int xpos = nofilter_trans_preamble(s, &xy, x, y); | 342 int xpos = nofilter_trans_preamble(s, &xy, x, y); |
346 const int width = s.fPixmap.width(); | 343 const int width = s.fPixmap.width(); |
347 if (1 == width) { | 344 if (1 == width) { |
348 // all of the following X values must be 0 | 345 // all of the following X values must be 0 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode =
= fTileModeY) { | 521 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode =
= fTileModeY) { |
525 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; | 522 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; |
526 } | 523 } |
527 | 524 |
528 fTileProcX = choose_tile_proc(fTileModeX); | 525 fTileProcX = choose_tile_proc(fTileModeX); |
529 fTileProcY = choose_tile_proc(fTileModeY); | 526 fTileProcY = choose_tile_proc(fTileModeY); |
530 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); | 527 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); |
531 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); | 528 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); |
532 return GeneralXY_Procs[index]; | 529 return GeneralXY_Procs[index]; |
533 } | 530 } |
OLD | NEW |