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

Side by Side Diff: core/fxge/apple/fx_apple_platform.cpp

Issue 2411833002: Fix negative font rendering on Mac by reversing matrix c component. (Closed)
Patch Set: Created 4 years, 2 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 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcrt/fx_system.h" 7 #include "core/fxcrt/fx_system.h"
8 8
9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 9 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 for (int i = 0; i < nChars; i++) { 65 for (int i = 0; i < nChars; i++) {
66 glyph_indices[i] = pCharPos[i].m_ExtGID; 66 glyph_indices[i] = pCharPos[i].m_ExtGID;
67 if (bNegSize) 67 if (bNegSize)
68 glyph_positions[i].x = -pCharPos[i].m_OriginX; 68 glyph_positions[i].x = -pCharPos[i].m_OriginX;
69 else 69 else
70 glyph_positions[i].x = pCharPos[i].m_OriginX; 70 glyph_positions[i].x = pCharPos[i].m_OriginX;
71 glyph_positions[i].y = pCharPos[i].m_OriginY; 71 glyph_positions[i].y = pCharPos[i].m_OriginY;
72 } 72 }
73 if (bNegSize) { 73 if (bNegSize) {
74 new_matrix.a = -new_matrix.a; 74 new_matrix.a = -new_matrix.a;
75 new_matrix.c = -new_matrix.c;
75 } else { 76 } else {
76 new_matrix.b = -new_matrix.b; 77 new_matrix.b = -new_matrix.b;
77 new_matrix.d = -new_matrix.d; 78 new_matrix.d = -new_matrix.d;
78 } 79 }
79 quartz2d.setGraphicsTextMatrix(pContext, &new_matrix); 80 quartz2d.setGraphicsTextMatrix(pContext, &new_matrix);
80 return quartz2d.drawGraphicsString(pContext, pFont->GetPlatformFont(), 81 return quartz2d.drawGraphicsString(pContext, pFont->GetPlatformFont(),
81 font_size, glyph_indices, glyph_positions, 82 font_size, glyph_indices, glyph_positions,
82 nChars, argb, nullptr); 83 nChars, argb, nullptr);
83 } 84 }
84 85
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (m_pPlatformFont) { 180 if (m_pPlatformFont) {
180 CQuartz2D& quartz2d = 181 CQuartz2D& quartz2d =
181 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData()) 182 static_cast<CApplePlatform*>(CFX_GEModule::Get()->GetPlatformData())
182 ->m_quartz2d; 183 ->m_quartz2d;
183 quartz2d.DestroyFont(m_pPlatformFont); 184 quartz2d.DestroyFont(m_pPlatformFont);
184 m_pPlatformFont = nullptr; 185 m_pPlatformFont = nullptr;
185 } 186 }
186 } 187 }
187 188
188 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ 189 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
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