summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 18:20:51 -0800
commit2e6864282e65c55ff6809f5aaae011b31c3a361a (patch)
tree98daecaf078529986a4efc2c43a3f43c0dcc01dd /xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
parent969ea09df096b987662b9658e3ffa023ca4ebf70 (diff)
downloadpdfium-2e6864282e65c55ff6809f5aaae011b31c3a361a.tar.xz
Get rid of CBC_AutoPtr and use std::unique_ptr instead.
Also fix IWYU in various fxbarcode headers. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1734823002 .
Diffstat (limited to 'xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
index 7b9fe7b4f3..87f0fd072e 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp
@@ -20,9 +20,12 @@
* limitations under the License.
*/
+#include "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h"
+
+#include <memory>
+
#include "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h"
#include "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.h"
-#include "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h"
#include "xfa/src/fxbarcode/utils.h"
CBC_QRGridSampler CBC_QRGridSampler::m_gridSampler;
@@ -107,13 +110,12 @@ CBC_CommonBitMatrix* CBC_QRGridSampler::SampleGrid(CBC_CommonBitMatrix* image,
FX_FLOAT p4FromX,
FX_FLOAT p4FromY,
int32_t& e) {
- CBC_AutoPtr<CBC_CommonPerspectiveTransform> transform(
+ std::unique_ptr<CBC_CommonPerspectiveTransform> transform(
CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(
p1ToX, p1ToY, p2ToX, p2ToY, p3ToX, p3ToY, p4ToX, p4ToY, p1FromX,
p1FromY, p2FromX, p2FromY, p3FromX, p3FromY, p4FromX, p4FromY));
- CBC_CommonBitMatrix* tempBitM = new CBC_CommonBitMatrix();
- tempBitM->Init(dimensionX, dimensionY);
- CBC_AutoPtr<CBC_CommonBitMatrix> bits(tempBitM);
+ std::unique_ptr<CBC_CommonBitMatrix> bits(new CBC_CommonBitMatrix());
+ bits->Init(dimensionX, dimensionY);
CFX_FloatArray points;
points.SetSize(dimensionX << 1);
for (int32_t y = 0; y < dimensionY; y++) {