| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 return; | 731 return; |
| 732 } | 732 } |
| 733 SkAutoDataUnref encoded(SkData::NewFromFileName(path.c_str())); | 733 SkAutoDataUnref encoded(SkData::NewFromFileName(path.c_str())); |
| 734 SkBitmap bitmap; | 734 SkBitmap bitmap; |
| 735 if (!SkInstallDiscardablePixelRef( | 735 if (!SkInstallDiscardablePixelRef( |
| 736 SkDecodingImageGenerator::Create( | 736 SkDecodingImageGenerator::Create( |
| 737 encoded, SkDecodingImageGenerator::Options()), &bitmap)) { | 737 encoded, SkDecodingImageGenerator::Options()), &bitmap)) { |
| 738 ERRORF(r, "SkInstallDiscardablePixelRef [randPixels.gif] failed."); | 738 ERRORF(r, "SkInstallDiscardablePixelRef [randPixels.gif] failed."); |
| 739 return; | 739 return; |
| 740 } | 740 } |
| 741 if (kIndex_8_SkColorType != bitmap.colorType()) { |
| 742 return; |
| 743 } |
| 741 { | 744 { |
| 742 SkAutoLockPixels alp(bitmap); | 745 SkAutoLockPixels alp(bitmap); |
| 743 REPORTER_ASSERT(r, bitmap.getColorTable() && "first pass"); | 746 REPORTER_ASSERT(r, bitmap.getColorTable() && "first pass"); |
| 744 } | 747 } |
| 745 { | 748 { |
| 746 SkAutoLockPixels alp(bitmap); | 749 SkAutoLockPixels alp(bitmap); |
| 747 REPORTER_ASSERT(r, bitmap.getColorTable() && "second pass"); | 750 REPORTER_ASSERT(r, bitmap.getColorTable() && "second pass"); |
| 748 } | 751 } |
| 749 } | 752 } |
| OLD | NEW |