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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 fill_backwards(xptr, width - 1, count); | 478 fill_backwards(xptr, width - 1, count); |
479 } | 479 } |
480 } | 480 } |
481 } | 481 } |
482 | 482 |
483 /////////////////////////////////////////////////////////////////////////////// | 483 /////////////////////////////////////////////////////////////////////////////// |
484 | 484 |
485 SkBitmapProcState::MatrixProc SkBitmapProcState::chooseMatrixProc(bool trivial_m
atrix) { | 485 SkBitmapProcState::MatrixProc SkBitmapProcState::chooseMatrixProc(bool trivial_m
atrix) { |
486 // test_int_tileprocs(); | 486 // test_int_tileprocs(); |
487 // check for our special case when there is no scale/affine/perspective | 487 // check for our special case when there is no scale/affine/perspective |
488 if (trivial_matrix && kNone_SkFilterQuality == fFilterLevel) { | 488 if (trivial_matrix && kNone_SkFilterQuality == fFilterQuality) { |
489 fIntTileProcY = choose_int_tile_proc(fTileModeY); | 489 fIntTileProcY = choose_int_tile_proc(fTileModeY); |
490 switch (fTileModeX) { | 490 switch (fTileModeX) { |
491 case SkShader::kClamp_TileMode: | 491 case SkShader::kClamp_TileMode: |
492 return clampx_nofilter_trans; | 492 return clampx_nofilter_trans; |
493 case SkShader::kRepeat_TileMode: | 493 case SkShader::kRepeat_TileMode: |
494 return repeatx_nofilter_trans; | 494 return repeatx_nofilter_trans; |
495 case SkShader::kMirror_TileMode: | 495 case SkShader::kMirror_TileMode: |
496 return mirrorx_nofilter_trans; | 496 return mirrorx_nofilter_trans; |
497 } | 497 } |
498 } | 498 } |
499 | 499 |
500 int index = 0; | 500 int index = 0; |
501 if (fFilterLevel != kNone_SkFilterQuality) { | 501 if (fFilterQuality != kNone_SkFilterQuality) { |
502 index = 1; | 502 index = 1; |
503 } | 503 } |
504 if (fInvType & SkMatrix::kPerspective_Mask) { | 504 if (fInvType & SkMatrix::kPerspective_Mask) { |
505 index += 4; | 505 index += 4; |
506 } else if (fInvType & SkMatrix::kAffine_Mask) { | 506 } else if (fInvType & SkMatrix::kAffine_Mask) { |
507 index += 2; | 507 index += 2; |
508 } | 508 } |
509 | 509 |
510 if (SkShader::kClamp_TileMode == fTileModeX && SkShader::kClamp_TileMode ==
fTileModeY) { | 510 if (SkShader::kClamp_TileMode == fTileModeX && SkShader::kClamp_TileMode ==
fTileModeY) { |
511 // clamp gets special version of filterOne | 511 // clamp gets special version of filterOne |
512 fFilterOneX = SK_Fixed1; | 512 fFilterOneX = SK_Fixed1; |
513 fFilterOneY = SK_Fixed1; | 513 fFilterOneY = SK_Fixed1; |
514 return SK_ARM_NEON_WRAP(ClampX_ClampY_Procs)[index]; | 514 return SK_ARM_NEON_WRAP(ClampX_ClampY_Procs)[index]; |
515 } | 515 } |
516 | 516 |
517 // all remaining procs use this form for filterOne | 517 // all remaining procs use this form for filterOne |
518 fFilterOneX = SK_Fixed1 / fPixmap.width(); | 518 fFilterOneX = SK_Fixed1 / fPixmap.width(); |
519 fFilterOneY = SK_Fixed1 / fPixmap.height(); | 519 fFilterOneY = SK_Fixed1 / fPixmap.height(); |
520 | 520 |
521 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode =
= fTileModeY) { | 521 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode =
= fTileModeY) { |
522 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; | 522 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; |
523 } | 523 } |
524 | 524 |
525 fTileProcX = choose_tile_proc(fTileModeX); | 525 fTileProcX = choose_tile_proc(fTileModeX); |
526 fTileProcY = choose_tile_proc(fTileModeY); | 526 fTileProcY = choose_tile_proc(fTileModeY); |
527 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); | 527 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); |
528 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); | 528 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); |
529 return GeneralXY_Procs[index]; | 529 return GeneralXY_Procs[index]; |
530 } | 530 } |
OLD | NEW |