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

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

Issue 243463005: expose CGImage -> SkBitmap (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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
« no previous file with comments | « include/utils/mac/SkCGUtils.h ('k') | src/ports/SkImageDecoder_CG.cpp » ('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 /* 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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 bool SkBitmap::canCopyTo(SkColorType dstColorType) const { 991 bool SkBitmap::canCopyTo(SkColorType dstColorType) const {
992 if (this->colorType() == kUnknown_SkColorType) { 992 if (this->colorType() == kUnknown_SkColorType) {
993 return false; 993 return false;
994 } 994 }
995 995
996 bool sameConfigs = (this->colorType() == dstColorType); 996 bool sameConfigs = (this->colorType() == dstColorType);
997 switch (dstColorType) { 997 switch (dstColorType) {
998 case kAlpha_8_SkColorType: 998 case kAlpha_8_SkColorType:
999 case kRGB_565_SkColorType: 999 case kRGB_565_SkColorType:
1000 case kN32_SkColorType: 1000 case kRGBA_8888_SkColorType:
1001 case kBGRA_8888_SkColorType:
1001 break; 1002 break;
1002 case kIndex_8_SkColorType: 1003 case kIndex_8_SkColorType:
1003 if (!sameConfigs) { 1004 if (!sameConfigs) {
1004 return false; 1005 return false;
1005 } 1006 }
1006 break; 1007 break;
1007 case kARGB_4444_SkColorType: 1008 case kARGB_4444_SkColorType:
1008 return sameConfigs || kN32_SkColorType == this->colorType(); 1009 return sameConfigs || kN32_SkColorType == this->colorType();
1009 default: 1010 default:
1010 return false; 1011 return false;
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 /////////////////////////////////////////////////////////////////////////////// 1719 ///////////////////////////////////////////////////////////////////////////////
1719 1720
1720 #ifdef SK_DEBUG 1721 #ifdef SK_DEBUG
1721 void SkImageInfo::validate() const { 1722 void SkImageInfo::validate() const {
1722 SkASSERT(fWidth >= 0); 1723 SkASSERT(fWidth >= 0);
1723 SkASSERT(fHeight >= 0); 1724 SkASSERT(fHeight >= 0);
1724 SkASSERT(SkColorTypeIsValid(fColorType)); 1725 SkASSERT(SkColorTypeIsValid(fColorType));
1725 SkASSERT(SkAlphaTypeIsValid(fAlphaType)); 1726 SkASSERT(SkAlphaTypeIsValid(fAlphaType));
1726 } 1727 }
1727 #endif 1728 #endif
OLDNEW
« no previous file with comments | « include/utils/mac/SkCGUtils.h ('k') | src/ports/SkImageDecoder_CG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698