| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium 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 #include "printing/image.h" | 5 #include "printing/image.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 10 #include "base/md5.h" | 12 #include "base/md5.h" |
| 11 #include "base/numerics/safe_conversions.h" | 13 #include "base/numerics/safe_conversions.h" |
| 12 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 13 #include "printing/metafile.h" | 15 #include "printing/metafile.h" |
| 14 #include "printing/pdf_metafile_skia.h" | 16 #include "printing/pdf_metafile_skia.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 17 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/gfx/codec/png_codec.h" | 18 #include "ui/gfx/codec/png_codec.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 bool Image::LoadMetafile(const std::string& data) { | 153 bool Image::LoadMetafile(const std::string& data) { |
| 152 DCHECK(!data.empty()); | 154 DCHECK(!data.empty()); |
| 153 PdfMetafileSkia metafile; | 155 PdfMetafileSkia metafile; |
| 154 if (!metafile.InitFromData(data.data(), | 156 if (!metafile.InitFromData(data.data(), |
| 155 base::checked_cast<uint32_t>(data.size()))) | 157 base::checked_cast<uint32_t>(data.size()))) |
| 156 return false; | 158 return false; |
| 157 return LoadMetafile(metafile); | 159 return LoadMetafile(metafile); |
| 158 } | 160 } |
| 159 | 161 |
| 160 } // namespace printing | 162 } // namespace printing |
| OLD | NEW |