| OLD | NEW |
| 1 /* libs/graphics/ports/SkFontHost_fontconfig.cpp | 1 /* libs/graphics/ports/SkFontHost_fontconfig.cpp |
| 2 ** | 2 ** |
| 3 ** Copyright 2008, Google Inc. | 3 ** Copyright 2008, Google Inc. |
| 4 ** | 4 ** |
| 5 ** Licensed under the Apache License, Version 2.0 (the "License"); | 5 ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 ** you may not use this file except in compliance with the License. | 6 ** you may not use this file except in compliance with the License. |
| 7 ** You may obtain a copy of the License at | 7 ** You may obtain a copy of the License at |
| 8 ** | 8 ** |
| 9 ** http://www.apache.org/licenses/LICENSE-2.0 | 9 ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 ** | 10 ** |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 static SkTypeface::Style UniqueIdToStyle(unsigned uniqueid) | 76 static SkTypeface::Style UniqueIdToStyle(unsigned uniqueid) |
| 77 { | 77 { |
| 78 return static_cast<SkTypeface::Style>(uniqueid & 0xff); | 78 return static_cast<SkTypeface::Style>(uniqueid & 0xff); |
| 79 } | 79 } |
| 80 | 80 |
| 81 static unsigned FileIdAndStyleToUniqueId(unsigned fileid, | 81 static unsigned FileIdAndStyleToUniqueId(unsigned fileid, |
| 82 SkTypeface::Style style) | 82 SkTypeface::Style style) |
| 83 { | 83 { |
| 84 SkASSERT(style & 0xff == style); | 84 SkASSERT((style & 0xff) == style); |
| 85 return (fileid << 8) | static_cast<int>(style); | 85 return (fileid << 8) | static_cast<int>(style); |
| 86 } | 86 } |
| 87 | 87 |
| 88 static const unsigned kRemoteFontMask = 0x00800000u; | 88 static const unsigned kRemoteFontMask = 0x00800000u; |
| 89 | 89 |
| 90 static bool IsRemoteFont(unsigned fileid) | 90 static bool IsRemoteFont(unsigned fileid) |
| 91 { | 91 { |
| 92 return fileid & kRemoteFontMask; | 92 return fileid & kRemoteFontMask; |
| 93 } | 93 } |
| 94 | 94 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 return SkNEW_ARGS(SkFileDescriptorStream, (fd)); | 308 return SkNEW_ARGS(SkFileDescriptorStream, (fd)); |
| 309 } | 309 } |
| 310 | 310 |
| 311 size_t SkFontHost::ShouldPurgeFontCache(size_t sizeAllocatedSoFar) | 311 size_t SkFontHost::ShouldPurgeFontCache(size_t sizeAllocatedSoFar) |
| 312 { | 312 { |
| 313 if (sizeAllocatedSoFar > kFontCacheMemoryBudget) | 313 if (sizeAllocatedSoFar > kFontCacheMemoryBudget) |
| 314 return sizeAllocatedSoFar - kFontCacheMemoryBudget; | 314 return sizeAllocatedSoFar - kFontCacheMemoryBudget; |
| 315 else | 315 else |
| 316 return 0; // nothing to do | 316 return 0; // nothing to do |
| 317 } | 317 } |
| OLD | NEW |