OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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_SSSE3.h" | 8 #include "SkBitmapProcState_opts_SSSE3.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 // 16 bits because the results are 16 bits. This basically allows us to process | 387 // 16 bits because the results are 16 bits. This basically allows us to process |
388 // twice as many pixel components per iteration. | 388 // twice as many pixel components per iteration. |
389 // | 389 // |
390 // As a result, this method behaves faster than the traditional SSE2. The actual | 390 // As a result, this method behaves faster than the traditional SSE2. The actual |
391 // boost varies greatly on the underlying architecture. | 391 // boost varies greatly on the underlying architecture. |
392 template<bool has_alpha> | 392 template<bool has_alpha> |
393 void S32_generic_D32_filter_DX_SSSE3(const SkBitmapProcState& s, | 393 void S32_generic_D32_filter_DX_SSSE3(const SkBitmapProcState& s, |
394 const uint32_t* xy, | 394 const uint32_t* xy, |
395 int count, uint32_t* colors) { | 395 int count, uint32_t* colors) { |
396 SkASSERT(count > 0 && colors != nullptr); | 396 SkASSERT(count > 0 && colors != nullptr); |
397 SkASSERT(s.fFilterLevel != kNone_SkFilterQuality); | 397 SkASSERT(s.fFilterQuality != kNone_SkFilterQuality); |
398 SkASSERT(kN32_SkColorType == s.fPixmap.colorType()); | 398 SkASSERT(kN32_SkColorType == s.fPixmap.colorType()); |
399 if (has_alpha) { | 399 if (has_alpha) { |
400 SkASSERT(s.fAlphaScale < 256); | 400 SkASSERT(s.fAlphaScale < 256); |
401 } else { | 401 } else { |
402 SkASSERT(s.fAlphaScale == 256); | 402 SkASSERT(s.fAlphaScale == 256); |
403 } | 403 } |
404 | 404 |
405 const uint8_t* src_addr = | 405 const uint8_t* src_addr = |
406 static_cast<const uint8_t*>(s.fPixmap.addr()); | 406 static_cast<const uint8_t*>(s.fPixmap.addr()); |
407 const size_t rb = s.fPixmap.rowBytes(); | 407 const size_t rb = s.fPixmap.rowBytes(); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 579 |
580 /* | 580 /* |
581 * Similar to S32_generic_D32_filter_DX_SSSE3, we do not need to handle the | 581 * Similar to S32_generic_D32_filter_DX_SSSE3, we do not need to handle the |
582 * special case suby == 0 as suby is changing in every loop. | 582 * special case suby == 0 as suby is changing in every loop. |
583 */ | 583 */ |
584 template<bool has_alpha> | 584 template<bool has_alpha> |
585 void S32_generic_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 585 void S32_generic_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
586 const uint32_t* xy, | 586 const uint32_t* xy, |
587 int count, uint32_t* colors) { | 587 int count, uint32_t* colors) { |
588 SkASSERT(count > 0 && colors != nullptr); | 588 SkASSERT(count > 0 && colors != nullptr); |
589 SkASSERT(s.fFilterLevel != kNone_SkFilterQuality); | 589 SkASSERT(s.fFilterQuality != kNone_SkFilterQuality); |
590 SkASSERT(kN32_SkColorType == s.fPixmap.colorType()); | 590 SkASSERT(kN32_SkColorType == s.fPixmap.colorType()); |
591 if (has_alpha) { | 591 if (has_alpha) { |
592 SkASSERT(s.fAlphaScale < 256); | 592 SkASSERT(s.fAlphaScale < 256); |
593 } else { | 593 } else { |
594 SkASSERT(s.fAlphaScale == 256); | 594 SkASSERT(s.fAlphaScale == 256); |
595 } | 595 } |
596 | 596 |
597 const uint8_t* src_addr = | 597 const uint8_t* src_addr = |
598 static_cast<const uint8_t*>(s.fPixmap.addr()); | 598 static_cast<const uint8_t*>(s.fPixmap.addr()); |
599 const size_t rb = s.fPixmap.rowBytes(); | 599 const size_t rb = s.fPixmap.rowBytes(); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 sk_throw(); | 752 sk_throw(); |
753 } | 753 } |
754 | 754 |
755 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, | 755 void S32_alpha_D32_filter_DXDY_SSSE3(const SkBitmapProcState& s, |
756 const uint32_t* xy, | 756 const uint32_t* xy, |
757 int count, uint32_t* colors) { | 757 int count, uint32_t* colors) { |
758 sk_throw(); | 758 sk_throw(); |
759 } | 759 } |
760 | 760 |
761 #endif | 761 #endif |
OLD | NEW |