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

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

Issue 731373003: change roundOut() to take a dst, so we can use that signature to return IRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/effects/SkGpuBlurUtils.cpp ('k') | 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 877
878 // Vector FON will transform nicely, but bitmap FON do not. 878 // Vector FON will transform nicely, but bitmap FON do not.
879 if (fType == SkScalerContext_GDI::kLine_Type) { 879 if (fType == SkScalerContext_GDI::kLine_Type) {
880 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop, 880 SkRect bounds = SkRect::MakeXYWH(glyph->fLeft, glyph->fTop,
881 glyph->fWidth, glyph->fHeight); 881 glyph->fWidth, glyph->fHeight);
882 SkMatrix m; 882 SkMatrix m;
883 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21) , 0, 883 m.setAll(SkFIXEDToScalar(fMat22.eM11), -SkFIXEDToScalar(fMat22.eM21) , 0,
884 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22) , 0, 884 -SkFIXEDToScalar(fMat22.eM12), SkFIXEDToScalar(fMat22.eM22) , 0,
885 0, 0, SkScalarToPersp(SK_Scalar1)); 885 0, 0, SkScalarToPersp(SK_Scalar1));
886 m.mapRect(&bounds); 886 m.mapRect(&bounds);
887 bounds.roundOut(); 887 bounds.roundOut(&bounds);
888 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft); 888 glyph->fLeft = SkScalarTruncToInt(bounds.fLeft);
889 glyph->fTop = SkScalarTruncToInt(bounds.fTop); 889 glyph->fTop = SkScalarTruncToInt(bounds.fTop);
890 glyph->fWidth = SkScalarTruncToInt(bounds.width()); 890 glyph->fWidth = SkScalarTruncToInt(bounds.width());
891 glyph->fHeight = SkScalarTruncToInt(bounds.height()); 891 glyph->fHeight = SkScalarTruncToInt(bounds.height());
892 } 892 }
893 893
894 // Apply matrix to advance. 894 // Apply matrix to advance.
895 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva nceX); 895 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva nceX);
896 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan ceX); 896 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan ceX);
897 897
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 2541
2542 private: 2542 private:
2543 SkTDArray<ENUMLOGFONTEX> fLogFontArray; 2543 SkTDArray<ENUMLOGFONTEX> fLogFontArray;
2544 }; 2544 };
2545 2545
2546 /////////////////////////////////////////////////////////////////////////////// 2546 ///////////////////////////////////////////////////////////////////////////////
2547 2547
2548 SkFontMgr* SkFontMgr_New_GDI() { 2548 SkFontMgr* SkFontMgr_New_GDI() {
2549 return SkNEW(SkFontMgrGDI); 2549 return SkNEW(SkFontMgrGDI);
2550 } 2550 }
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698