| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 stream->skip(size); | 252 stream->skip(size); |
| 253 | 253 |
| 254 return SkFontHost::CreateTypeface(NULL, desc.getFamilyName(), | 254 return SkFontHost::CreateTypeface(NULL, desc.getFamilyName(), |
| 255 desc.getStyle()); | 255 desc.getStyle()); |
| 256 } | 256 } |
| 257 | 257 |
| 258 /////////////////////////////////////////////////////////////////////////////// | 258 /////////////////////////////////////////////////////////////////////////////// |
| 259 | 259 |
| 260 class SkFileDescriptorStream : public SkStream { | 260 class SkFileDescriptorStream : public SkStream { |
| 261 public: | 261 public: |
| 262 SkFileDescriptorStream(int fd) { | 262 explicit SkFileDescriptorStream(int fd) { |
| 263 memory_ = NULL; | 263 memory_ = NULL; |
| 264 offset_ = 0; | 264 offset_ = 0; |
| 265 | 265 |
| 266 // this ensures that if we fail in the constructor, we will safely | 266 // this ensures that if we fail in the constructor, we will safely |
| 267 // ignore all subsequent calls to read() because we will always trim | 267 // ignore all subsequent calls to read() because we will always trim |
| 268 // the requested size down to 0 | 268 // the requested size down to 0 |
| 269 length_ = 0; | 269 length_ = 0; |
| 270 | 270 |
| 271 struct stat st; | 271 struct stat st; |
| 272 if (fstat(fd, &st)) | 272 if (fstat(fd, &st)) |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 if (!path) | 360 if (!path) |
| 361 return 1; | 361 return 1; |
| 362 } | 362 } |
| 363 | 363 |
| 364 if (path) | 364 if (path) |
| 365 SkASSERT(!"SkFontHost::GetFileName does not support the font path " | 365 SkASSERT(!"SkFontHost::GetFileName does not support the font path " |
| 366 "retrieval."); | 366 "retrieval."); |
| 367 | 367 |
| 368 return 0; | 368 return 0; |
| 369 } | 369 } |
| OLD | NEW |