• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/WebCore-7600.1.25/platform/graphics/

Lines Matching refs:source

6  * Redistribution and use in source and binary forms, with or without
9 * 1. Redistributions of source code must retain the above copyright
175 // Some code are merged back from Mozilla code in http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLTexelConversions.h
185 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
188 destination[0] = source[0];
189 destination[1] = source[1];
190 destination[2] = source[2];
192 source += 3;
197 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
200 destination[0] = source[2];
201 destination[1] = source[1];
202 destination[2] = source[0];
204 source += 3;
209 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
212 destination[0] = source[1];
213 destination[1] = source[2];
214 destination[2] = source[3];
215 destination[3] = source[0];
216 source += 4;
221 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
224 destination[0] = source[3];
225 destination[1] = source[2];
226 destination[2] = source[1];
227 destination[3] = source[0];
228 source += 4;
233 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
235 const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source);
251 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGBA5551, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
254 SIMD::unpackOneRowOfRGBA5551ToRGBA8(source, destination, pixelsPerRow);
257 uint16_t packedValue = source[0];
265 source += 1;
270 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGBA4444, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
273 SIMD::unpackOneRowOfRGBA4444ToRGBA8(source, destination, pixelsPerRow);
276 uint16_t packedValue = source[0];
285 source += 1;
290 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGB565, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
293 SIMD::unpackOneRowOfRGB565ToRGBA8(source, destination, pixelsPerRow);
296 uint16_t packedValue = source[0];
304 source += 1;
309 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
312 destination[0] = source[0];
313 destination[1] = source[0];
314 destination[2] = source[0];
316 source += 1;
321 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
324 destination[0] = source[0];
325 destination[1] = source[0];
326 destination[2] = source[0];
327 destination[3] = source[1];
328 source += 2;
333 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatAR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
336 destination[0] = source[1];
337 destination[1] = source[1];
338 destination[2] = source[1];
339 destination[3] = source[0];
340 source += 2;
345 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
351 destination[3] = source[0];
352 source += 1;
357 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGBA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
361 destination[0] = source[0] * scaleFactor;
362 destination[1] = source[1] * scaleFactor;
363 destination[2] = source[2] * scaleFactor;
364 destination[3] = source[3] * scaleFactor;
365 source += 4;
370 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
374 destination[0] = source[2] * scaleFactor;
375 destination[1] = source[1] * scaleFactor;
376 destination[2] = source[0] * scaleFactor;
377 destination[3] = source[3] * scaleFactor;
378 source += 4;
383 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
387 destination[0] = source[3] * scaleFactor;
388 destination[1] = source[2] * scaleFactor;
389 destination[2] = source[1] * scaleFactor;
390 destination[3] = source[0] * scaleFactor;
391 source += 4;
396 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
400 destination[0] = source[1] * scaleFactor;
401 destination[1] = source[2] * scaleFactor;
402 destination[2] = source[3] * scaleFactor;
403 destination[3] = source[0] * scaleFactor;
404 source += 4;
409 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
413 destination[0] = source[0] * scaleFactor;
414 destination[1] = source[1] * scaleFactor;
415 destination[2] = source[2] * scaleFactor;
417 source += 3;
422 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
426 destination[0] = source[2] * scaleFactor;
427 destination[1] = source[1] * scaleFactor;
428 destination[2] = source[0] * scaleFactor;
430 source += 3;
435 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRGB32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
438 destination[0] = source[0];
439 destination[1] = source[1];
440 destination[2] = source[2];
442 source += 3;
447 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatR32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
450 destination[0] = source[0];
451 destination[1] = source[0];
452 destination[2] = source[0];
454 source += 1;
459 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatRA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
462 destination[0] = source[0];
463 destination[1] = source[0];
464 destination[2] = source[0];
465 destination[3] = source[1];
466 source += 2;
471 template<> ALWAYS_INLINE void unpack<GraphicsContext3D::DataFormatA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
477 destination[3] = source[0];
478 source += 1;
493 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
496 destination[0] = source[3];
497 source += 4;
502 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
505 destination[0] = source[0];
506 source += 4;
511 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
514 float scaleFactor = source[3] / 255.0f;
515 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
517 source += 4;
523 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
526 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
527 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
529 source += 4;
534 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
537 destination[0] = source[0];
538 destination[1] = source[3];
539 source += 4;
544 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
547 float scaleFactor = source[3] / 255.0f;
548 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
550 destination[1] = source[3];
551 source += 4;
557 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
560 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
561 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
563 destination[1] = source[3];
564 source += 4;
569 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
572 destination[0] = source[0];
573 destination[1] = source[1];
574 destination[2] = source[2];
575 source += 4;
580 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
583 float scaleFactor = source[3] / 255.0f;
584 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
585 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
586 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
590 source += 4;
596 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
599 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
600 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
601 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
602 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
606 source += 4;
612 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
614 memcpy(destination, source, pixelsPerRow * 4);
617 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
620 float scaleFactor = source[3] / 255.0f;
621 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
622 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
623 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
627 destination[3] = source[3];
628 source += 4;
634 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
637 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
638 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
639 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
640 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
644 destination[3] = source[3];
645 source += 4;
650 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
653 SIMD::packOneRowOfRGBA8ToUnsignedShort4444(source, destination, pixelsPerRow);
656 *destination = (((source[0] & 0xF0) << 8)
657 | ((source[1] & 0xF0) << 4)
658 | (source[2] & 0xF0)
659 | (source[3] >> 4));
660 source += 4;
665 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
668 float scaleFactor = source[3] / 255.0f;
669 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
670 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
671 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
675 | (source[3] >> 4));
676 source += 4;
682 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
685 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
686 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
687 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
688 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
692 | (source[3] >> 4));
693 source += 4;
698 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
701 SIMD::packOneRowOfRGBA8ToUnsignedShort5551(source, destination, pixelsPerRow);
704 *destination = (((source[0] & 0xF8) << 8)
705 | ((source[1] & 0xF8) << 3)
706 | ((source[2] & 0xF8) >> 2)
707 | (source[3] >> 7));
708 source += 4;
713 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
716 float scaleFactor = source[3] / 255.0f;
717 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
718 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
719 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
723 | (source[3] >> 7));
724 source += 4;
730 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
733 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
734 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
735 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
736 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
740 | (source[3] >> 7));
741 source += 4;
746 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
749 SIMD::packOneRowOfRGBA8ToUnsignedShort565(source, destination, pixelsPerRow);
752 *destination = (((source[0] & 0xF8) << 8)
753 | ((source[1] & 0xFC) << 3)
754 | ((source[2] & 0xF8) >> 3));
755 source += 4;
760 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
763 float scaleFactor = source[3] / 255.0f;
764 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
765 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
766 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
770 source += 4;
776 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
779 float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
780 uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
781 uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
782 uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
786 source += 4;
791 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
794 destination[0] = source[0];
795 destination[1] = source[1];
796 destination[2] = source[2];
797 source += 4;
802 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
805 float scaleFactor = source[3];
806 destination[0] = source[0] * scaleFactor;
807 destination[1] = source[1] * scaleFactor;
808 destination[2] = source[2] * scaleFactor;
809 source += 4;
814 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
817 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
818 destination[0] = source[0] * scaleFactor;
819 destination[1] = source[1] * scaleFactor;
820 destination[2] = source[2] * scaleFactor;
821 source += 4;
827 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
829 memcpy(destination, source, pixelsPerRow * 4 * sizeof(float));
832 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
835 float scaleFactor = source[3];
836 destination[0] = source[0] * scaleFactor;
837 destination[1] = source[1] * scaleFactor;
838 destination[2] = source[2] * scaleFactor;
839 destination[3] = source[3];
840 source += 4;
845 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
848 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
849 destination[0] = source[0] * scaleFactor;
850 destination[1] = source[1] * scaleFactor;
851 destination[2] = source[2] * scaleFactor;
852 destination[3] = source[3];
853 source += 4;
858 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
861 destination[0] = source[3];
862 source += 4;
867 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
870 destination[0] = source[0];
871 source += 4;
876 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
879 float scaleFactor = source[3];
880 destination[0] = source[0] * scaleFactor;
881 source += 4;
886 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
889 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
890 destination[0] = source[0] * scaleFactor;
891 source += 4;
896 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
899 destination[0] = source[0];
900 destination[1] = source[3];
901 source += 4;
906 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
909 float scaleFactor = source[3];
910 destination[0] = source[0] * scaleFactor;
911 destination[1] = source[3];
912 source += 4;
917 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
920 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
921 destination[0] = source[0] * scaleFactor;
922 destination[1] = source[3];
923 source += 4;
928 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
931 destination[0] = convertFloatToHalfFloat(source[0]);
932 destination[1] = convertFloatToHalfFloat(source[1]);
933 destination[2] = convertFloatToHalfFloat(source[2]);
934 destination[3] = convertFloatToHalfFloat(source[3]);
935 source += 4;
940 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
943 float scaleFactor = source[3];
944 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
945 destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
946 destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
947 destination[3] = convertFloatToHalfFloat(source[3]);
948 source += 4;
953 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
956 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
957 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
958 destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
959 destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
960 destination[3] = convertFloatToHalfFloat(source[3]);
961 source += 4;
966 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
969 destination[0] = convertFloatToHalfFloat(source[0]);
970 destination[1] = convertFloatToHalfFloat(source[1]);
971 destination[2] = convertFloatToHalfFloat(source[2]);
972 source += 4;
977 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
980 float scaleFactor = source[3];
981 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
982 destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
983 destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
984 source += 4;
989 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
992 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
993 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
994 destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
995 destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
996 source += 4;
1001 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1004 destination[0] = convertFloatToHalfFloat(source[0]);
1005 destination[1] = convertFloatToHalfFloat(source[3]);
1006 source += 4;
1011 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1014 float scaleFactor = source[3];
1015 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
1016 destination[1] = convertFloatToHalfFloat(source[3]);
1017 source += 4;
1022 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1025 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
1026 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
1027 destination[1] = convertFloatToHalfFloat(source[3]);
1028 source += 4;
1033 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1036 destination[0] = convertFloatToHalfFloat(source[0]);
1037 source += 4;
1042 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1045 float scaleFactor = source[3];
1046 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
1047 source += 4;
1052 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1055 float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
1056 destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
1057 source += 4;
1062 template<> ALWAYS_INLINE void pack<GraphicsContext3D::DataFormatA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
1065 destination[0] = convertFloatToHalfFloat(source[3]);
1066 source += 4;