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" |
11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
12 #include "SkStream.h" | 12 #include "SkStream.h" |
13 #include "SkTypeface.h" | 13 #include "SkTypeface.h" |
14 | 14 |
15 static uint32_t default_flags() { | 15 static uint32_t default_flags() { |
16 uint32_t flags = 0; | 16 uint32_t flags = 0; |
17 #ifdef SK_SCALAR_IS_FLOAT | |
18 flags |= SkReadBuffer::kScalarIsFloat_Flag; | 17 flags |= SkReadBuffer::kScalarIsFloat_Flag; |
19 #endif | |
20 if (8 == sizeof(void*)) { | 18 if (8 == sizeof(void*)) { |
21 flags |= SkReadBuffer::kPtrIs64Bit_Flag; | 19 flags |= SkReadBuffer::kPtrIs64Bit_Flag; |
22 } | 20 } |
23 return flags; | 21 return flags; |
24 } | 22 } |
25 | 23 |
26 SkReadBuffer::SkReadBuffer() { | 24 SkReadBuffer::SkReadBuffer() { |
27 fFlags = default_flags(); | 25 fFlags = default_flags(); |
28 fVersion = 0; | 26 fVersion = 0; |
29 fMemoryPtr = NULL; | 27 fMemoryPtr = NULL; |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return; | 355 return; |
358 } | 356 } |
359 } else { | 357 } else { |
360 if (NULL == this->readFunctionPtr()) { | 358 if (NULL == this->readFunctionPtr()) { |
361 return; | 359 return; |
362 } | 360 } |
363 } | 361 } |
364 uint32_t sizeRecorded = fReader.readU32(); | 362 uint32_t sizeRecorded = fReader.readU32(); |
365 fReader.skip(sizeRecorded); | 363 fReader.skip(sizeRecorded); |
366 } | 364 } |
OLD | NEW |