| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkImagePriv.h" | 8 #include "SkImagePriv.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return SkBitmap::kNo_Config; | 47 return SkBitmap::kNo_Config; |
| 48 case SkImage::kOpaque_AlphaType: | 48 case SkImage::kOpaque_AlphaType: |
| 49 *isOpaque = true; | 49 *isOpaque = true; |
| 50 return SkBitmap::kARGB_8888_Config; | 50 return SkBitmap::kARGB_8888_Config; |
| 51 case SkImage::kPremul_AlphaType: | 51 case SkImage::kPremul_AlphaType: |
| 52 *isOpaque = false; | 52 *isOpaque = false; |
| 53 return SkBitmap::kARGB_8888_Config; | 53 return SkBitmap::kARGB_8888_Config; |
| 54 } | 54 } |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 SkASSERT(!"how did we get here"); | 57 SkDEBUGFAIL("how did we get here"); |
| 58 return SkBitmap::kNo_Config; | 58 return SkBitmap::kNo_Config; |
| 59 } | 59 } |
| 60 | 60 |
| 61 int SkImageBytesPerPixel(SkImage::ColorType ct) { | 61 int SkImageBytesPerPixel(SkImage::ColorType ct) { |
| 62 static const uint8_t gColorTypeBytesPerPixel[] = { | 62 static const uint8_t gColorTypeBytesPerPixel[] = { |
| 63 1, // kAlpha_8_ColorType | 63 1, // kAlpha_8_ColorType |
| 64 2, // kRGB_565_ColorType | 64 2, // kRGB_565_ColorType |
| 65 4, // kRGBA_8888_ColorType | 65 4, // kRGBA_8888_ColorType |
| 66 4, // kBGRA_8888_ColorType | 66 4, // kBGRA_8888_ColorType |
| 67 4, // kPMColor_ColorType | 67 4, // kPMColor_ColorType |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 canvas->save(); | 164 canvas->save(); |
| 165 } | 165 } |
| 166 canvas->concat(matrix); | 166 canvas->concat(matrix); |
| 167 if (!paint || !needs_layer(*paint)) { | 167 if (!paint || !needs_layer(*paint)) { |
| 168 canvas->clipRect(tmpSrc); | 168 canvas->clipRect(tmpSrc); |
| 169 } | 169 } |
| 170 | 170 |
| 171 canvas->drawPicture(*picture); | 171 canvas->drawPicture(*picture); |
| 172 canvas->restoreToCount(saveCount); | 172 canvas->restoreToCount(saveCount); |
| 173 } | 173 } |
| OLD | NEW |