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 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2606 case kPremul_SkAlphaType: | 2606 case kPremul_SkAlphaType: |
2607 case kOpaque_SkAlphaType: | 2607 case kOpaque_SkAlphaType: |
2608 break; | 2608 break; |
2609 default: | 2609 default: |
2610 return false; | 2610 return false; |
2611 } | 2611 } |
2612 | 2612 |
2613 switch (info.colorType()) { | 2613 switch (info.colorType()) { |
2614 case kAlpha_8_SkColorType: | 2614 case kAlpha_8_SkColorType: |
2615 case kRGB_565_SkColorType: | 2615 case kRGB_565_SkColorType: |
2616 case kN32_SkColorType: | 2616 case kPMColor_SkColorType: |
2617 break; | 2617 break; |
2618 default: | 2618 default: |
2619 return false; | 2619 return false; |
2620 } | 2620 } |
2621 | 2621 |
2622 return true; | 2622 return true; |
2623 } | 2623 } |
2624 | 2624 |
2625 SkCanvas* SkCanvas::NewRaster(const SkImageInfo& info) { | 2625 SkCanvas* SkCanvas::NewRaster(const SkImageInfo& info) { |
2626 if (!supported_for_raster_canvas(info)) { | 2626 if (!supported_for_raster_canvas(info)) { |
(...skipping 21 matching lines...) Expand all Loading... |
2648 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2648 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2649 return NULL; | 2649 return NULL; |
2650 } | 2650 } |
2651 | 2651 |
2652 // should this functionality be moved into allocPixels()? | 2652 // should this functionality be moved into allocPixels()? |
2653 if (!bitmap.info().isOpaque()) { | 2653 if (!bitmap.info().isOpaque()) { |
2654 bitmap.eraseColor(0); | 2654 bitmap.eraseColor(0); |
2655 } | 2655 } |
2656 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2656 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2657 } | 2657 } |
OLD | NEW |