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

Side by Side Diff: xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp

Issue 1519693002: Merge to XFA: Remove CFX_AffineMatrix/CPDF_Matrix (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: XFA-specific changes Created 5 years 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
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 // Original code is licensed as follows: 6 // Original code is licensed as follows:
7 /* 7 /*
8 * Copyright 2011 ZXing authors 8 * Copyright 2011 ZXing authors
9 * 9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * Licensed under the Apache License, Version 2.0 (the "License");
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 rect.right -= 1; 192 rect.right -= 1;
193 } 193 }
194 matrix->TransformRect(rect); 194 matrix->TransformRect(rect);
195 FX_RECT re = rect.GetOutterRect(); 195 FX_RECT re = rect.GetOutterRect();
196 device->FillRect(&re, m_backgroundColor); 196 device->FillRect(&re, m_backgroundColor);
197 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, (FX_FLOAT)locX, 197 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, (FX_FLOAT)locX,
198 (FX_FLOAT)(locY + iFontSize)); 198 (FX_FLOAT)(locY + iFontSize));
199 if (matrix != NULL) { 199 if (matrix != NULL) {
200 affine_matrix.Concat(*matrix); 200 affine_matrix.Concat(*matrix);
201 } 201 }
202 device->DrawNormalText( 202 device->DrawNormalText(str.GetLength(), pCharPos, m_pFont,
203 str.GetLength(), pCharPos, m_pFont, CFX_GEModule::Get()->GetFontCache(), 203 CFX_GEModule::Get()->GetFontCache(),
204 (FX_FLOAT)iFontSize, (CFX_AffineMatrix*)&affine_matrix, m_fontColor, 204 (FX_FLOAT)iFontSize, (CFX_Matrix*)&affine_matrix,
205 FXTEXT_CLEARTYPE); 205 m_fontColor, FXTEXT_CLEARTYPE);
206 } 206 }
207 void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap* pOutBitmap, 207 void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap* pOutBitmap,
208 const CFX_ByteString str, 208 const CFX_ByteString str,
209 FX_FLOAT geWidth, 209 FX_FLOAT geWidth,
210 FXTEXT_CHARPOS* pCharPos, 210 FXTEXT_CHARPOS* pCharPos,
211 FX_FLOAT locX, 211 FX_FLOAT locX,
212 FX_FLOAT locY, 212 FX_FLOAT locY,
213 int32_t barWidth) { 213 int32_t barWidth) {
214 int32_t iFontSize = (int32_t)fabs(m_fFontSize); 214 int32_t iFontSize = (int32_t)fabs(m_fFontSize);
215 int32_t iTextHeight = iFontSize + 1; 215 int32_t iTextHeight = iFontSize + 1;
216 CFX_FxgeDevice ge; 216 CFX_FxgeDevice ge;
217 ge.Create((int)geWidth, iTextHeight, m_colorSpace); 217 ge.Create((int)geWidth, iTextHeight, m_colorSpace);
218 FX_RECT geRect(0, 0, (int)geWidth, iTextHeight); 218 FX_RECT geRect(0, 0, (int)geWidth, iTextHeight);
219 ge.FillRect(&geRect, m_backgroundColor); 219 ge.FillRect(&geRect, m_backgroundColor);
220 CFX_AffineMatrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); 220 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize);
221 ge.DrawNormalText( 221 ge.DrawNormalText(str.GetLength(), pCharPos, m_pFont,
222 str.GetLength(), pCharPos, m_pFont, CFX_GEModule::Get()->GetFontCache(), 222 CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize,
223 (FX_FLOAT)iFontSize, (CFX_AffineMatrix*)&affine_matrix, m_fontColor, 223 (CFX_Matrix*)&affine_matrix, m_fontColor, FXTEXT_CLEARTYPE);
224 FXTEXT_CLEARTYPE);
225 CFX_FxgeDevice geBitmap; 224 CFX_FxgeDevice geBitmap;
226 geBitmap.Attach(pOutBitmap); 225 geBitmap.Attach(pOutBitmap);
227 geBitmap.SetDIBits(ge.GetBitmap(), (int)locX, (int)locY); 226 geBitmap.SetDIBits(ge.GetBitmap(), (int)locX, (int)locY);
228 } 227 }
229 void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, 228 void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents,
230 CFX_DIBitmap* pOutBitmap, 229 CFX_DIBitmap* pOutBitmap,
231 CFX_RenderDevice* device, 230 CFX_RenderDevice* device,
232 const CFX_Matrix* matrix, 231 const CFX_Matrix* matrix,
233 int32_t barWidth, 232 int32_t barWidth,
234 int32_t multiple, 233 int32_t multiple,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 if (outputX + m_multiple > outputWidth && outputWidth - outputX > 0) { 433 if (outputX + m_multiple > outputWidth && outputWidth - outputX > 0) {
435 m_output->SetRegion(outputX, 0, outputWidth - outputX, outputHeight, e); 434 m_output->SetRegion(outputX, 0, outputWidth - outputX, outputHeight, e);
436 break; 435 break;
437 } 436 }
438 m_output->SetRegion(outputX, 0, m_multiple, outputHeight, e); 437 m_output->SetRegion(outputX, 0, m_multiple, outputHeight, e);
439 BC_EXCEPTION_CHECK_ReturnVoid(e); 438 BC_EXCEPTION_CHECK_ReturnVoid(e);
440 } 439 }
441 outputX += m_multiple; 440 outputX += m_multiple;
442 } 441 }
443 } 442 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698