| 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 "SkScalerContext.h" | 10 #include "SkScalerContext.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #define DUMP_RECx | 66 #define DUMP_RECx |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag) { | 69 static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag) { |
| 70 SkFlattenable* obj = NULL; | 70 SkFlattenable* obj = NULL; |
| 71 uint32_t len; | 71 uint32_t len; |
| 72 const void* data = desc->findEntry(tag, &len); | 72 const void* data = desc->findEntry(tag, &len); |
| 73 | 73 |
| 74 if (data) { | 74 if (data) { |
| 75 SkOrderedReadBuffer buffer(data, len); | 75 SkOrderedReadBuffer buffer(data, len); |
| 76 obj = buffer.readFlattenable(); | 76 obj = buffer.readFlattenable(kUnknown_SkEffectType); |
| 77 SkASSERT(buffer.offset() == buffer.size()); | 77 SkASSERT(buffer.offset() == buffer.size()); |
| 78 } | 78 } |
| 79 return obj; | 79 return obj; |
| 80 } | 80 } |
| 81 | 81 |
| 82 SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc) | 82 SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc) |
| 83 : fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, NULL))
) | 83 : fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, NULL))
) |
| 84 | 84 |
| 85 , fBaseGlyphCount(0) | 85 , fBaseGlyphCount(0) |
| 86 , fTypeface(SkRef(typeface)) | 86 , fTypeface(SkRef(typeface)) |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, | 932 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
| 933 bool allowFailure) const { | 933 bool allowFailure) const { |
| 934 SkScalerContext* c = this->onCreateScalerContext(desc); | 934 SkScalerContext* c = this->onCreateScalerContext(desc); |
| 935 | 935 |
| 936 if (!c && !allowFailure) { | 936 if (!c && !allowFailure) { |
| 937 c = SkNEW_ARGS(SkScalerContext_Empty, | 937 c = SkNEW_ARGS(SkScalerContext_Empty, |
| 938 (const_cast<SkTypeface*>(this), desc)); | 938 (const_cast<SkTypeface*>(this), desc)); |
| 939 } | 939 } |
| 940 return c; | 940 return c; |
| 941 } | 941 } |
| OLD | NEW |