| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Brent Fulgham | 2 * Copyright (C) 2011 Brent Fulgham |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 FontPlatformData::~FontPlatformData() {} | 162 FontPlatformData::~FontPlatformData() {} |
| 163 | 163 |
| 164 #if OS(MACOSX) | 164 #if OS(MACOSX) |
| 165 CTFontRef FontPlatformData::CtFont() const { | 165 CTFontRef FontPlatformData::CtFont() const { |
| 166 return SkTypeface_GetCTFontRef(typeface_.get()); | 166 return SkTypeface_GetCTFontRef(typeface_.get()); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 CGFontRef FontPlatformData::CgFont() const { | 169 CGFontRef FontPlatformData::CgFont() const { |
| 170 if (!CtFont()) |
| 171 return nullptr; |
| 170 return CTFontCopyGraphicsFont(CtFont(), 0); | 172 return CTFontCopyGraphicsFont(CtFont(), 0); |
| 171 } | 173 } |
| 172 #endif | 174 #endif |
| 173 | 175 |
| 174 const FontPlatformData& FontPlatformData::operator=( | 176 const FontPlatformData& FontPlatformData::operator=( |
| 175 const FontPlatformData& other) { | 177 const FontPlatformData& other) { |
| 176 // Check for self-assignment. | 178 // Check for self-assignment. |
| 177 if (this == &other) | 179 if (this == &other) |
| 178 return *this; | 180 return *this; |
| 179 | 181 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 const size_t table_size = typeface_->getTableSize(tag); | 336 const size_t table_size = typeface_->getTableSize(tag); |
| 335 if (table_size) { | 337 if (table_size) { |
| 336 Vector<char> table_buffer(table_size); | 338 Vector<char> table_buffer(table_size); |
| 337 typeface_->getTableData(tag, 0, table_size, &table_buffer[0]); | 339 typeface_->getTableData(tag, 0, table_size, &table_buffer[0]); |
| 338 buffer = SharedBuffer::AdoptVector(table_buffer); | 340 buffer = SharedBuffer::AdoptVector(table_buffer); |
| 339 } | 341 } |
| 340 return buffer.Release(); | 342 return buffer.Release(); |
| 341 } | 343 } |
| 342 | 344 |
| 343 } // namespace blink | 345 } // namespace blink |
| OLD | NEW |