Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: src/core/SkScalerContext.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adapting code to sk_once changes Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkOrderedWriteBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 83cf8f80064aaf2c9c043ba72a52939a4864c05e..88e3f06ee8390ee2e17c65a4d9c3f4dd0d6a6f85 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -67,14 +67,14 @@ void SkGlyph::zeroMetrics() {
#endif
static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag,
- SkEffectType et) {
+ SkFlattenable::Type ft) {
SkFlattenable* obj = NULL;
uint32_t len;
const void* data = desc->findEntry(tag, &len);
-
+
if (data) {
SkOrderedReadBuffer buffer(data, len);
- obj = buffer.readFlattenable(et);
+ obj = buffer.readFlattenable(ft);
SkASSERT(buffer.offset() == buffer.size());
}
return obj;
@@ -85,10 +85,12 @@ SkScalerContext::SkScalerContext(SkTypeface* typeface, const SkDescriptor* desc)
, fBaseGlyphCount(0)
, fTypeface(SkRef(typeface))
- , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag, kPathEffect_SkEffectType)))
- , fMaskFilter(static_cast<SkMaskFilter*>(load_flattenable(desc, kMaskFilter_SkDescriptorTag, kMaskFilter_SkEffectType)))
- , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag, kRasterizer_SkEffectType)))
-
+ , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag,
+ SkFlattenable::kSkPathEffect_Type)))
+ , fMaskFilter(static_cast<SkMaskFilter*>(load_flattenable(desc, kMaskFilter_SkDescriptorTag,
+ SkFlattenable::kSkMaskFilter_Type)))
+ , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag,
+ SkFlattenable::kSkRasterizer_Type)))
// Initialize based on our settings. Subclasses can also force this.
, fGenerateImageFromPath(fRec.fFrameWidth > 0 || fPathEffect != NULL || fRasterizer != NULL)
« no previous file with comments | « src/core/SkOrderedWriteBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698