Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 enum GrCompressedFormat { | 627 enum GrCompressedFormat { |
| 628 kETC1_GrCompressedFormat, | 628 kETC1_GrCompressedFormat, |
| 629 kETC2_GrCompressedFormat, | 629 kETC2_GrCompressedFormat, |
| 630 kDXT1_GrCompressedFormat, | 630 kDXT1_GrCompressedFormat, |
| 631 | 631 |
| 632 kLast_GrCompressedFormat = kDXT1_GrCompressedFormat | 632 kLast_GrCompressedFormat = kDXT1_GrCompressedFormat |
| 633 }; | 633 }; |
| 634 static const int kGrCompressedFormatCount = kLast_GrCompressedFormat + 1; | 634 static const int kGrCompressedFormatCount = kLast_GrCompressedFormat + 1; |
| 635 | 635 |
| 636 /** | 636 /** |
| 637 * This structure contains relevant information for the various kinds of | |
| 638 * compressed texture formats. The information is used when determining | |
| 639 * data size of compressed textures for a given width and height, along | |
| 640 * with how to properly index into compressed textures for a given pixel | |
| 641 * location. | |
| 642 */ | |
| 643 struct GrCompressedFormatDesc { | |
| 644 int fBlockSizeX; | |
| 645 int fBlockSizeY; | |
| 646 int fBytesPerBlock; | |
| 647 }; | |
| 648 | |
| 649 static inline GrCompressedFormatDesc | |
| 650 GrGetCompressedFormatDesc(GrCompressedFormat fmt) { | |
| 651 GrCompressedFormatDesc desc; | |
| 652 switch (fmt) { | |
| 653 case kETC1_GrCompressedFormat: | |
| 654 case kETC2_GrCompressedFormat: | |
| 655 case kDXT1_GrCompressedFormat: | |
| 656 desc.fBlockSizeX = 4; | |
| 657 desc.fBlockSizeY = 4; | |
| 658 desc.fBytesPerBlock = 4; | |
|
robertphillips
2014/05/27 22:01:50
break; ?
krajcevski
2014/05/27 22:19:29
Done.
| |
| 659 | |
| 660 default: | |
| 661 SkASSERT(!"Unknown compressed format!"); | |
| 662 break; | |
| 663 } | |
| 664 return desc; | |
| 665 } | |
| 666 | |
| 667 /** | |
| 637 * This value translates to reseting all the context state for any backend. | 668 * This value translates to reseting all the context state for any backend. |
| 638 */ | 669 */ |
| 639 static const uint32_t kAll_GrBackendState = 0xffffffff; | 670 static const uint32_t kAll_GrBackendState = 0xffffffff; |
| 640 | 671 |
| 641 /////////////////////////////////////////////////////////////////////////////// | 672 /////////////////////////////////////////////////////////////////////////////// |
| 642 | 673 |
| 643 #endif | 674 #endif |
| OLD | NEW |