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

Side by Side Diff: src/core/SkBitmap.cpp

Issue 17335008: remove dst/rendertarget support for kARGB_4444_Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 break; 786 break;
787 } 787 }
788 case kA8_Config: { 788 case kA8_Config: {
789 uint8_t* p = (uint8_t*)fPixels; 789 uint8_t* p = (uint8_t*)fPixels;
790 while (--height >= 0) { 790 while (--height >= 0) {
791 memset(p, a, width); 791 memset(p, a, width);
792 p += rowBytes; 792 p += rowBytes;
793 } 793 }
794 break; 794 break;
795 } 795 }
796 case kARGB_4444_Config:
797 case kRGB_565_Config: { 796 case kRGB_565_Config: {
798 uint16_t* p = (uint16_t*)fPixels; 797 uint16_t* p = (uint16_t*)fPixels;
799 uint16_t v; 798 uint16_t v = SkPackRGB16(r >> (8 - SK_R16_BITS),
800 799 g >> (8 - SK_G16_BITS),
801 if (kARGB_4444_Config == fConfig) { 800 b >> (8 - SK_B16_BITS));
802 v = SkPackARGB4444(a >> 4, r >> 4, g >> 4, b >> 4);
803 } else { // kRGB_565_Config
804 v = SkPackRGB16(r >> (8 - SK_R16_BITS), g >> (8 - SK_G16_BITS),
805 b >> (8 - SK_B16_BITS));
806 }
807 while (--height >= 0) { 801 while (--height >= 0) {
808 sk_memset16(p, v, width); 802 sk_memset16(p, v, width);
809 p = (uint16_t*)((char*)p + rowBytes); 803 p = (uint16_t*)((char*)p + rowBytes);
810 } 804 }
811 break; 805 break;
812 } 806 }
813 case kARGB_8888_Config: { 807 case kARGB_8888_Config: {
814 uint32_t* p = (uint32_t*)fPixels; 808 uint32_t* p = (uint32_t*)fPixels;
815 uint32_t v = SkPackARGB32(a, r, g, b); 809 uint32_t v = SkPackARGB32(a, r, g, b);
816 810
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 #include "SkPaint.h" 992 #include "SkPaint.h"
999 993
1000 bool SkBitmap::canCopyTo(Config dstConfig) const { 994 bool SkBitmap::canCopyTo(Config dstConfig) const {
1001 if (this->getConfig() == kNo_Config) { 995 if (this->getConfig() == kNo_Config) {
1002 return false; 996 return false;
1003 } 997 }
1004 998
1005 bool sameConfigs = (this->config() == dstConfig); 999 bool sameConfigs = (this->config() == dstConfig);
1006 switch (dstConfig) { 1000 switch (dstConfig) {
1007 case kA8_Config: 1001 case kA8_Config:
1008 case kARGB_4444_Config:
1009 case kRGB_565_Config: 1002 case kRGB_565_Config:
1010 case kARGB_8888_Config: 1003 case kARGB_8888_Config:
1011 break; 1004 break;
1012 case kA1_Config: 1005 case kA1_Config:
1013 case kIndex8_Config: 1006 case kIndex8_Config:
1007 case kARGB_4444_Config:
1014 if (!sameConfigs) { 1008 if (!sameConfigs) {
1015 return false; 1009 return false;
1016 } 1010 }
1017 break; 1011 break;
1018 default: 1012 default:
1019 return false; 1013 return false;
1020 } 1014 }
1021 1015
1022 // do not copy src if srcConfig == kA1_Config while dstConfig != kA1_Config 1016 // do not copy src if srcConfig == kA1_Config while dstConfig != kA1_Config
1023 if (this->getConfig() == kA1_Config && !sameConfigs) { 1017 if (this->getConfig() == kA1_Config && !sameConfigs) {
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 if (NULL != uri) { 1673 if (NULL != uri) {
1680 str->appendf(" uri:\"%s\"", uri); 1674 str->appendf(" uri:\"%s\"", uri);
1681 } else { 1675 } else {
1682 str->appendf(" pixelref:%p", pr); 1676 str->appendf(" pixelref:%p", pr);
1683 } 1677 }
1684 } 1678 }
1685 1679
1686 str->append(")"); 1680 str->append(")");
1687 } 1681 }
1688 #endif 1682 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleTiling.cpp ('k') | src/core/SkBlitRow_D16.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698