OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
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 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkErrorInternals.h" | 10 #include "SkErrorInternals.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 } | 260 } |
261 // This bitmap was encoded when written, but we are unable to decode
, possibly due to | 261 // This bitmap was encoded when written, but we are unable to decode
, possibly due to |
262 // not having a decoder. | 262 // not having a decoder. |
263 SkErrorInternals::SetError(kParseError_SkError, | 263 SkErrorInternals::SetError(kParseError_SkError, |
264 "Could not decode bitmap. Resulting bitma
p will be red."); | 264 "Could not decode bitmap. Resulting bitma
p will be red."); |
265 } else { | 265 } else { |
266 // A size of zero means the SkBitmap was simply flattened. | 266 // A size of zero means the SkBitmap was simply flattened. |
267 if (this->isVersionLT(kNoMoreBitmapFlatten_Version)) { | 267 if (this->isVersionLT(kNoMoreBitmapFlatten_Version)) { |
268 SkBitmap tmp; | 268 SkBitmap tmp; |
269 tmp.unflatten(*this); | 269 tmp.legacyUnflatten(*this); |
270 // just throw this guy away | 270 // just throw this guy away |
271 } else { | 271 } else { |
272 if (SkBitmap::ReadRawPixels(this, bitmap)) { | 272 if (SkBitmap::ReadRawPixels(this, bitmap)) { |
273 return true; | 273 return true; |
274 } | 274 } |
275 } | 275 } |
276 } | 276 } |
277 } | 277 } |
278 // Could not read the SkBitmap. Use a placeholder bitmap. | 278 // Could not read the SkBitmap. Use a placeholder bitmap. |
279 bitmap->setConfig(SkImageInfo::MakeUnknown(width, height)); | 279 bitmap->setConfig(SkImageInfo::MakeUnknown(width, height)); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return; | 357 return; |
358 } | 358 } |
359 } else { | 359 } else { |
360 if (NULL == this->readFunctionPtr()) { | 360 if (NULL == this->readFunctionPtr()) { |
361 return; | 361 return; |
362 } | 362 } |
363 } | 363 } |
364 uint32_t sizeRecorded = fReader.readU32(); | 364 uint32_t sizeRecorded = fReader.readU32(); |
365 fReader.skip(sizeRecorded); | 365 fReader.skip(sizeRecorded); |
366 } | 366 } |
OLD | NEW |