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

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

Issue 1014953002: Restore GDI text size rounding. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 /* 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 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 SkMatrix sA; 626 SkMatrix sA;
627 SkMatrix GsA; 627 SkMatrix GsA;
628 SkMatrix A; 628 SkMatrix A;
629 fRec.computeMatrices(scaleConstraints, &scale, &sA, &GsA, &fG_inv, &A); 629 fRec.computeMatrices(scaleConstraints, &scale, &sA, &GsA, &fG_inv, &A);
630 630
631 fGsA.eM11 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleX)); 631 fGsA.eM11 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleX));
632 fGsA.eM12 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewY)); // This should be ~0. 632 fGsA.eM12 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewY)); // This should be ~0.
633 fGsA.eM21 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewX)); 633 fGsA.eM21 = SkScalarToFIXED(-GsA.get(SkMatrix::kMSkewX));
634 fGsA.eM22 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleY)); 634 fGsA.eM22 = SkScalarToFIXED(GsA.get(SkMatrix::kMScaleY));
635 635
636 SkScalar gdiTextSize = scale.fY; 636 SkScalar gdiTextSize = SkScalarRoundToScalar(scale.fY);
reed1 2015/03/18 13:57:08 // Comment here, to document WHY we need the round
bungeman-skia 2015/03/18 14:22:13 Done.
637 if (gdiTextSize == 0) { 637 if (gdiTextSize == 0) {
638 gdiTextSize = SK_Scalar1; 638 gdiTextSize = SK_Scalar1;
639 } 639 }
640 640
641 LOGFONT lf = typeface->fLogFont; 641 LOGFONT lf = typeface->fLogFont;
642 lf.lfHeight = -SkScalarTruncToInt(gdiTextSize); 642 lf.lfHeight = -SkScalarTruncToInt(gdiTextSize);
643 lf.lfQuality = compute_quality(fRec); 643 lf.lfQuality = compute_quality(fRec);
644 fFont = CreateFontIndirect(&lf); 644 fFont = CreateFontIndirect(&lf);
645 if (!fFont) { 645 if (!fFont) {
646 return; 646 return;
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 2512
2513 private: 2513 private:
2514 SkTDArray<ENUMLOGFONTEX> fLogFontArray; 2514 SkTDArray<ENUMLOGFONTEX> fLogFontArray;
2515 }; 2515 };
2516 2516
2517 /////////////////////////////////////////////////////////////////////////////// 2517 ///////////////////////////////////////////////////////////////////////////////
2518 2518
2519 SkFontMgr* SkFontMgr_New_GDI() { 2519 SkFontMgr* SkFontMgr_New_GDI() {
2520 return SkNEW(SkFontMgrGDI); 2520 return SkNEW(SkFontMgrGDI);
2521 } 2521 }
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