OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 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 "SkDrawBitmap.h" | 10 #include "SkDrawBitmap.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 #ifdef SK_DUMP_ENABLED | 67 #ifdef SK_DUMP_ENABLED |
68 void SkDrawBitmap::dump(SkAnimateMaker* maker) { | 68 void SkDrawBitmap::dump(SkAnimateMaker* maker) { |
69 dumpBase(maker); | 69 dumpBase(maker); |
70 dumpAttrs(maker); | 70 dumpAttrs(maker); |
71 if (fColorSet) | 71 if (fColorSet) |
72 SkDebugf("erase=\"argb(%d,%d,%d,%d)\" ", SkColorGetA(fColor)/255, SkColo
rGetR(fColor), | 72 SkDebugf("erase=\"argb(%d,%d,%d,%d)\" ", SkColorGetA(fColor)/255, SkColo
rGetR(fColor), |
73 SkColorGetG(fColor), SkColorGetB(fColor)); | 73 SkColorGetG(fColor), SkColorGetB(fColor)); |
74 if (rowBytes > 0) | 74 if (rowBytes > 0) |
75 SkDebugf("rowBytes=\"%d\" ", rowBytes); | 75 SkDebugf("rowBytes=\"%d\" ", rowBytes); |
76 const char* formatName; | 76 const char* formatName SK_INIT_TO_AVOID_WARNING; |
77 switch (format) { | 77 switch (format) { |
78 case 0: formatName = "none"; break; | 78 case 0: formatName = "none"; break; |
79 case 1: formatName = "A8"; break; | 79 case 1: formatName = "A8"; break; |
80 case 2: formatName = "Index8"; break; | 80 case 2: formatName = "Index8"; break; |
81 case 3: formatName = "RGB16"; break; | 81 case 3: formatName = "RGB16"; break; |
82 case 4: formatName = "RGB32"; break; | 82 case 4: formatName = "RGB32"; break; |
83 } | 83 } |
84 SkDebugf("format=\"%s\" />\n", formatName); | 84 SkDebugf("format=\"%s\" />\n", formatName); |
85 } | 85 } |
86 #endif | 86 #endif |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 fBitmap.reset(); | 192 fBitmap.reset(); |
193 | 193 |
194 //SkStream* stream = SkStream::GetURIStream(fUriBase, src.c_str()); | 194 //SkStream* stream = SkStream::GetURIStream(fUriBase, src.c_str()); |
195 sk_sp<SkData> data = SkData::MakeFromFileName(src.c_str()); | 195 sk_sp<SkData> data = SkData::MakeFromFileName(src.c_str()); |
196 if (data) { | 196 if (data) { |
197 sk_sp<SkImage> image = SkImage::MakeFromEncoded(data); | 197 sk_sp<SkImage> image = SkImage::MakeFromEncoded(data); |
198 image->asLegacyBitmap(&fBitmap, SkImage::kRO_LegacyBitmapMode); | 198 image->asLegacyBitmap(&fBitmap, SkImage::kRO_LegacyBitmapMode); |
199 } | 199 } |
200 } | 200 } |
201 } | 201 } |
OLD | NEW |