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

Side by Side Diff: xfa/fxbarcode/qrcode/BC_QRDetector.cpp

Issue 2063463002: Trust the compiler to do array indexing and superclass promotion. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: merge blocks Created 4 years, 6 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 | « xfa/fgas/layout/fgas_textbreak.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 // 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 2007 ZXing authors 8 * Copyright 2007 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 CBC_QRAlignmentPattern* temp = FindAlignmentInRegion( 84 CBC_QRAlignmentPattern* temp = FindAlignmentInRegion(
85 moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT)i, e); 85 moduleSize, estAlignmentX, estAlignmentY, (FX_FLOAT)i, e);
86 if (temp) { 86 if (temp) {
87 alignmentPattern = temp; 87 alignmentPattern = temp;
88 break; 88 break;
89 } 89 }
90 } 90 }
91 } 91 }
92 CBC_CommonBitMatrix* bits = 92 CBC_CommonBitMatrix* bits =
93 SampleGrid(m_image, topLeft.get(), topRight.get(), bottomLeft.get(), 93 SampleGrid(m_image, topLeft.get(), topRight.get(), bottomLeft.get(),
94 (CBC_ResultPoint*)(alignmentPattern), dimension, e); 94 alignmentPattern, dimension, e);
95 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); 95 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
96 96
97 CFX_ArrayTemplate<CBC_ResultPoint*>* points = 97 CFX_ArrayTemplate<CBC_ResultPoint*>* points =
98 new CFX_ArrayTemplate<CBC_ResultPoint*>(); 98 new CFX_ArrayTemplate<CBC_ResultPoint*>();
99 points->Add(bottomLeft.release()); 99 points->Add(bottomLeft.release());
100 points->Add(topLeft.release()); 100 points->Add(topLeft.release());
101 points->Add(topRight.release()); 101 points->Add(topRight.release());
102 if (alignmentPattern) 102 if (alignmentPattern)
103 points->Add(alignmentPattern); 103 points->Add(alignmentPattern);
104 return new CBC_QRDetectorResult(bits, points); 104 return new CBC_QRDetectorResult(bits, points);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 int32_t alignmentAreaBottomY = 269 int32_t alignmentAreaBottomY =
270 std::min(m_image->GetHeight() - 1, estAlignmentY + allowance); 270 std::min(m_image->GetHeight() - 1, estAlignmentY + allowance);
271 CBC_QRAlignmentPatternFinder alignmentFinder( 271 CBC_QRAlignmentPatternFinder alignmentFinder(
272 m_image, alignmentAreaLeftX, alignmentAreaTopY, 272 m_image, alignmentAreaLeftX, alignmentAreaTopY,
273 alignmentAreaRightX - alignmentAreaLeftX, 273 alignmentAreaRightX - alignmentAreaLeftX,
274 alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize); 274 alignmentAreaBottomY - alignmentAreaTopY, overallEstModuleSize);
275 CBC_QRAlignmentPattern* qap = alignmentFinder.Find(e); 275 CBC_QRAlignmentPattern* qap = alignmentFinder.Find(e);
276 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); 276 BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
277 return qap; 277 return qap;
278 } 278 }
OLDNEW
« no previous file with comments | « xfa/fgas/layout/fgas_textbreak.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698