OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "SkTextureCompressor.h" | 8 #include "SkTextureCompressor.h" |
9 #include "SkTextureCompressor_Blitter.h" | 9 #include "SkTextureCompressor_Blitter.h" |
10 | 10 |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 struct CompressorR11EAC { | 596 struct CompressorR11EAC { |
597 static inline void CompressA8Vertical(uint8_t* dst, const uint8_t* src) { | 597 static inline void CompressA8Vertical(uint8_t* dst, const uint8_t* src) { |
598 compress_block_vertical(dst, src); | 598 compress_block_vertical(dst, src); |
599 } | 599 } |
600 | 600 |
601 static inline void CompressA8Horizontal(uint8_t* dst, const uint8_t* src, | 601 static inline void CompressA8Horizontal(uint8_t* dst, const uint8_t* src, |
602 int srcRowBytes) { | 602 int srcRowBytes) { |
603 *(reinterpret_cast<uint64_t*>(dst)) = compress_r11eac_block_fast(src, sr
cRowBytes); | 603 *(reinterpret_cast<uint64_t*>(dst)) = compress_r11eac_block_fast(src, sr
cRowBytes); |
604 } | 604 } |
605 | 605 |
606 static inline void UpdateBlock(uint8_t* dst, const uint8_t* src) { | 606 #if PEDANTIC_BLIT_RECT |
| 607 static inline void UpdateBlock(uint8_t* dst, const uint8_t* src, int srcRowB
ytes, |
| 608 const uint8_t* mask) { |
| 609 // TODO: krajcevski |
| 610 // The implementation of this function should be similar to that of LATC
, since |
| 611 // the R11EAC indices directly correspond to pixel values. |
| 612 SkFAIL("Implement me!"); |
607 } | 613 } |
| 614 #endif |
608 }; | 615 }; |
609 | 616 |
610 //////////////////////////////////////////////////////////////////////////////// | 617 //////////////////////////////////////////////////////////////////////////////// |
611 | 618 |
612 namespace SkTextureCompressor { | 619 namespace SkTextureCompressor { |
613 | 620 |
614 bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src, int width, int height,
int rowBytes) { | 621 bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src, int width, int height,
int rowBytes) { |
615 | 622 |
616 #if (COMPRESS_R11_EAC_SLOW) || (COMPRESS_R11_EAC_FAST) | 623 #if (COMPRESS_R11_EAC_SLOW) || (COMPRESS_R11_EAC_FAST) |
617 | 624 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 for (int j = 0; j < height; j += 4) { | 660 for (int j = 0; j < height; j += 4) { |
654 for (int i = 0; i < width; i += 4) { | 661 for (int i = 0; i < width; i += 4) { |
655 decompress_r11_eac_block(dst + i, dstRowBytes, src); | 662 decompress_r11_eac_block(dst + i, dstRowBytes, src); |
656 src += 8; | 663 src += 8; |
657 } | 664 } |
658 dst += 4 * dstRowBytes; | 665 dst += 4 * dstRowBytes; |
659 } | 666 } |
660 } | 667 } |
661 | 668 |
662 } // namespace SkTextureCompressor | 669 } // namespace SkTextureCompressor |
OLD | NEW |