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

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

Issue 298863002: Fix undefined behavior in DirectWrite GDI compatible metrics. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/utils/win/SkHRESULT.cpp » ('j') | 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 2011 Google Inc. 2 * Copyright 2011 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 #undef GetGlyphIndices 9 #undef GetGlyphIndices
10 10
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 fXform.dy = 0; 794 fXform.dy = 0;
795 795
796 // GsA is the non-rotational part of A without the text height scale. 796 // GsA is the non-rotational part of A without the text height scale.
797 SkMatrix GsA(GA); 797 SkMatrix GsA(GA);
798 GsA.preScale(scale, scale); //remove text height scale, G is rotational so r eorders with scale. 798 GsA.preScale(scale, scale); //remove text height scale, G is rotational so r eorders with scale.
799 799
800 fGsA.m11 = SkScalarToFloat(GsA.get(SkMatrix::kMScaleX)); 800 fGsA.m11 = SkScalarToFloat(GsA.get(SkMatrix::kMScaleX));
801 fGsA.m12 = SkScalarToFloat(GsA.get(SkMatrix::kMSkewY)); // This should be ~0 . 801 fGsA.m12 = SkScalarToFloat(GsA.get(SkMatrix::kMSkewY)); // This should be ~0 .
802 fGsA.m21 = SkScalarToFloat(GsA.get(SkMatrix::kMSkewX)); 802 fGsA.m21 = SkScalarToFloat(GsA.get(SkMatrix::kMSkewX));
803 fGsA.m22 = SkScalarToFloat(GsA.get(SkMatrix::kMScaleY)); 803 fGsA.m22 = SkScalarToFloat(GsA.get(SkMatrix::kMScaleY));
804 fGsA.dx = 0;
805 fGsA.dy = 0;
804 806
805 // fG_inv is G inverse, which is fairly simple since G is 2x2 rotational. 807 // fG_inv is G inverse, which is fairly simple since G is 2x2 rotational.
806 fG_inv.setAll(G.get(SkMatrix::kMScaleX), -G.get(SkMatrix::kMSkewX), G.get(Sk Matrix::kMTransX), 808 fG_inv.setAll(G.get(SkMatrix::kMScaleX), -G.get(SkMatrix::kMSkewX), G.get(Sk Matrix::kMTransX),
807 -G.get(SkMatrix::kMSkewY), G.get(SkMatrix::kMScaleY), G.get(Sk Matrix::kMTransY), 809 -G.get(SkMatrix::kMSkewY), G.get(SkMatrix::kMScaleY), G.get(Sk Matrix::kMTransY),
808 G.get(SkMatrix::kMPersp0), G.get(SkMatrix::kMPersp1), G.get(Sk Matrix::kMPersp2)); 810 G.get(SkMatrix::kMPersp0), G.get(SkMatrix::kMPersp1), G.get(Sk Matrix::kMPersp2));
809 } 811 }
810 812
811 SkScalerContext_DW::~SkScalerContext_DW() { 813 SkScalerContext_DW::~SkScalerContext_DW() {
812 } 814 }
813 815
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 } 2004 }
2003 2005
2004 #include "SkFontMgr_indirect.h" 2006 #include "SkFontMgr_indirect.h"
2005 SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { 2007 SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
2006 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); 2008 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
2007 if (impl.get() == NULL) { 2009 if (impl.get() == NULL) {
2008 return NULL; 2010 return NULL;
2009 } 2011 }
2010 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); 2012 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy));
2011 } 2013 }
OLDNEW
« no previous file with comments | « no previous file | src/utils/win/SkHRESULT.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698