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

Side by Side Diff: src/ports/SkTypeface_win_dw.cpp

Issue 2226653003: SkTypeface_win_dw.cpp remove unused fn (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 if (0 < glyph) { 307 if (0 < glyph) {
308 maxGlyph = SkTMax(static_cast<int>(glyph), maxGlyph); 308 maxGlyph = SkTMax(static_cast<int>(glyph), maxGlyph);
309 glyphToUni[glyph] = c; 309 glyphToUni[glyph] = c;
310 } 310 }
311 } 311 }
312 312
313 SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1).swap(*glyphToUnicode); 313 SkTDArray<SkUnichar>(glyphToUni, maxGlyph + 1).swap(*glyphToUnicode);
314 } 314 }
315 315
316 static bool getWidthAdvance(IDWriteFontFace* fontFace, int gId, int16_t* advance ) {
317 SkASSERT(advance);
318
319 UINT16 glyphId = gId;
320 DWRITE_GLYPH_METRICS gm;
321 HRESULT hr = fontFace->GetDesignGlyphMetrics(&glyphId, 1, &gm);
322
323 if (FAILED(hr)) {
324 *advance = 0;
325 return false;
326 }
327
328 *advance = gm.advanceWidth;
329 return true;
330 }
331
332 SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics( 316 SkAdvancedTypefaceMetrics* DWriteFontTypeface::onGetAdvancedTypefaceMetrics(
333 PerGlyphInfo perGlyphInfo, 317 PerGlyphInfo perGlyphInfo,
334 const uint32_t* glyphIDs, 318 const uint32_t* glyphIDs,
335 uint32_t glyphIDsCount) const { 319 uint32_t glyphIDsCount) const {
336 320
337 SkAdvancedTypefaceMetrics* info = nullptr; 321 SkAdvancedTypefaceMetrics* info = nullptr;
338 322
339 HRESULT hr = S_OK; 323 HRESULT hr = S_OK;
340 324
341 const unsigned glyphCount = fDWriteFontFace->GetGlyphCount(); 325 const unsigned glyphCount = fDWriteFontFace->GetGlyphCount();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 info->fDescent = SkToS16(dwfm.descent); 399 info->fDescent = SkToS16(dwfm.descent);
416 info->fCapHeight = SkToS16(dwfm.capHeight); 400 info->fCapHeight = SkToS16(dwfm.capHeight);
417 401
418 info->fBBox = SkIRect::MakeLTRB((int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMin), 402 info->fBBox = SkIRect::MakeLTRB((int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMin),
419 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMax), 403 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMax),
420 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMax), 404 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->xMax),
421 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMin)); 405 (int32_t)SkEndian_SwapBE16((uint16_t)headTab le->yMin));
422 return info; 406 return info;
423 } 407 }
424 #endif//defined(SK_BUILD_FOR_WIN32) 408 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698