| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // (i.e. larger) than what our caller allocated by looking at origGlyph. | 475 // (i.e. larger) than what our caller allocated by looking at origGlyph. |
| 476 SkAutoMalloc tmpGlyphImageStorage; | 476 SkAutoMalloc tmpGlyphImageStorage; |
| 477 | 477 |
| 478 // If we are going to draw-from-path, then we cannot generate color, since | 478 // If we are going to draw-from-path, then we cannot generate color, since |
| 479 // the path only makes a mask. This case should have been caught up in | 479 // the path only makes a mask. This case should have been caught up in |
| 480 // generateMetrics(). | 480 // generateMetrics(). |
| 481 SkASSERT(!fGenerateImageFromPath || | 481 SkASSERT(!fGenerateImageFromPath || |
| 482 SkMask::kARGB32_Format != origGlyph.fMaskFormat); | 482 SkMask::kARGB32_Format != origGlyph.fMaskFormat); |
| 483 | 483 |
| 484 if (fMaskFilter) { // restore the prefilter bounds | 484 if (fMaskFilter) { // restore the prefilter bounds |
| 485 tmpGlyph.initGlyphIdFrom(origGlyph); | 485 tmpGlyph.init(origGlyph.fID); |
| 486 | 486 |
| 487 // need the original bounds, sans our maskfilter | 487 // need the original bounds, sans our maskfilter |
| 488 SkMaskFilter* mf = fMaskFilter; | 488 SkMaskFilter* mf = fMaskFilter; |
| 489 fMaskFilter = NULL; // temp disable | 489 fMaskFilter = NULL; // temp disable |
| 490 this->getMetrics(&tmpGlyph); | 490 this->getMetrics(&tmpGlyph); |
| 491 fMaskFilter = mf; // restore | 491 fMaskFilter = mf; // restore |
| 492 | 492 |
| 493 // we need the prefilter bounds to be <= filter bounds | 493 // we need the prefilter bounds to be <= filter bounds |
| 494 SkASSERT(tmpGlyph.fWidth <= origGlyph.fWidth); | 494 SkASSERT(tmpGlyph.fWidth <= origGlyph.fWidth); |
| 495 SkASSERT(tmpGlyph.fHeight <= origGlyph.fHeight); | 495 SkASSERT(tmpGlyph.fHeight <= origGlyph.fHeight); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, | 869 SkScalerContext* SkTypeface::createScalerContext(const SkDescriptor* desc, |
| 870 bool allowFailure) const { | 870 bool allowFailure) const { |
| 871 SkScalerContext* c = this->onCreateScalerContext(desc); | 871 SkScalerContext* c = this->onCreateScalerContext(desc); |
| 872 | 872 |
| 873 if (!c && !allowFailure) { | 873 if (!c && !allowFailure) { |
| 874 c = SkNEW_ARGS(SkScalerContext_Empty, | 874 c = SkNEW_ARGS(SkScalerContext_Empty, |
| 875 (const_cast<SkTypeface*>(this), desc)); | 875 (const_cast<SkTypeface*>(this), desc)); |
| 876 } | 876 } |
| 877 return c; | 877 return c; |
| 878 } | 878 } |
| OLD | NEW |