Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Side by Side Diff: src/utils/SkTextureCompressor_R11EAC.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/utils/SkTextureCompressor_LATC.cpp ('k') | src/utils/SkThreadUtils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkTextureCompressor_Utils.h" 10 #include "SkTextureCompressor_Utils.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 631
632 #else 632 #else
633 #error "Must choose R11 EAC algorithm" 633 #error "Must choose R11 EAC algorithm"
634 #endif 634 #endif
635 } 635 }
636 636
637 SkBlitter* CreateR11EACBlitter(int width, int height, void* outputBuffer, 637 SkBlitter* CreateR11EACBlitter(int width, int height, void* outputBuffer,
638 SkTBlitterAllocator* allocator) { 638 SkTBlitterAllocator* allocator) {
639 639
640 if ((width % 4) != 0 || (height % 4) != 0) { 640 if ((width % 4) != 0 || (height % 4) != 0) {
641 return NULL; 641 return nullptr;
642 } 642 }
643 643
644 // Memset the output buffer to an encoding that decodes to zero. We must do this 644 // Memset the output buffer to an encoding that decodes to zero. We must do this
645 // in order to avoid having uninitialized values in the buffer if the blitte r 645 // in order to avoid having uninitialized values in the buffer if the blitte r
646 // decides not to write certain scanlines (and skip entire rows of blocks). 646 // decides not to write certain scanlines (and skip entire rows of blocks).
647 // In the case of R11, we use the encoding from recognizing all zero pixels from above. 647 // In the case of R11, we use the encoding from recognizing all zero pixels from above.
648 const int nBlocks = (width * height / 16); // 4x4 pixel blocks. 648 const int nBlocks = (width * height / 16); // 4x4 pixel blocks.
649 uint64_t *dst = reinterpret_cast<uint64_t *>(outputBuffer); 649 uint64_t *dst = reinterpret_cast<uint64_t *>(outputBuffer);
650 for (int i = 0; i < nBlocks; ++i) { 650 for (int i = 0; i < nBlocks; ++i) {
651 *dst = 0x0020000000002000ULL; 651 *dst = 0x0020000000002000ULL;
652 ++dst; 652 ++dst;
653 } 653 }
654 654
655 return allocator->createT< 655 return allocator->createT<
656 SkTCompressedAlphaBlitter<4, 8, CompressorR11EAC>, int, int, void*> 656 SkTCompressedAlphaBlitter<4, 8, CompressorR11EAC>, int, int, void*>
657 (width, height, outputBuffer); 657 (width, height, outputBuffer);
658 } 658 }
659 659
660 void DecompressR11EAC(uint8_t* dst, int dstRowBytes, const uint8_t* src, int wid th, int height) { 660 void DecompressR11EAC(uint8_t* dst, int dstRowBytes, const uint8_t* src, int wid th, int height) {
661 for (int j = 0; j < height; j += 4) { 661 for (int j = 0; j < height; j += 4) {
662 for (int i = 0; i < width; i += 4) { 662 for (int i = 0; i < width; i += 4) {
663 decompress_r11_eac_block(dst + i, dstRowBytes, src); 663 decompress_r11_eac_block(dst + i, dstRowBytes, src);
664 src += 8; 664 src += 8;
665 } 665 }
666 dst += 4 * dstRowBytes; 666 dst += 4 * dstRowBytes;
667 } 667 }
668 } 668 }
669 669
670 } // namespace SkTextureCompressor 670 } // namespace SkTextureCompressor
OLDNEW
« no previous file with comments | « src/utils/SkTextureCompressor_LATC.cpp ('k') | src/utils/SkThreadUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698