| OLD | NEW |
| 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 "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 2602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 case kPremul_SkAlphaType: | 2613 case kPremul_SkAlphaType: |
| 2614 case kOpaque_SkAlphaType: | 2614 case kOpaque_SkAlphaType: |
| 2615 break; | 2615 break; |
| 2616 default: | 2616 default: |
| 2617 return false; | 2617 return false; |
| 2618 } | 2618 } |
| 2619 | 2619 |
| 2620 switch (info.colorType()) { | 2620 switch (info.colorType()) { |
| 2621 case kAlpha_8_SkColorType: | 2621 case kAlpha_8_SkColorType: |
| 2622 case kRGB_565_SkColorType: | 2622 case kRGB_565_SkColorType: |
| 2623 case kPMColor_SkColorType: | 2623 case kN32_SkColorType: |
| 2624 break; | 2624 break; |
| 2625 default: | 2625 default: |
| 2626 return false; | 2626 return false; |
| 2627 } | 2627 } |
| 2628 | 2628 |
| 2629 return true; | 2629 return true; |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 SkCanvas* SkCanvas::NewRaster(const SkImageInfo& info) { | 2632 SkCanvas* SkCanvas::NewRaster(const SkImageInfo& info) { |
| 2633 if (!supported_for_raster_canvas(info)) { | 2633 if (!supported_for_raster_canvas(info)) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2655 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2655 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
| 2656 return NULL; | 2656 return NULL; |
| 2657 } | 2657 } |
| 2658 | 2658 |
| 2659 // should this functionality be moved into allocPixels()? | 2659 // should this functionality be moved into allocPixels()? |
| 2660 if (!bitmap.info().isOpaque()) { | 2660 if (!bitmap.info().isOpaque()) { |
| 2661 bitmap.eraseColor(0); | 2661 bitmap.eraseColor(0); |
| 2662 } | 2662 } |
| 2663 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2663 return SkNEW_ARGS(SkCanvas, (bitmap)); |
| 2664 } | 2664 } |
| OLD | NEW |