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

Side by Side Diff: printing/image.cc

Issue 2064843002: PdfMetafileSkia: start supporting more document types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-14 (Tuesday) 10:42:59 EDT 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
OLDNEW
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> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 int w; 143 int w;
144 int h; 144 int h;
145 bool success = gfx::PNGCodec::Decode( 145 bool success = gfx::PNGCodec::Decode(
146 reinterpret_cast<const unsigned char*>(compressed.c_str()), 146 reinterpret_cast<const unsigned char*>(compressed.c_str()),
147 compressed.size(), gfx::PNGCodec::FORMAT_BGRA, &data_, &w, &h); 147 compressed.size(), gfx::PNGCodec::FORMAT_BGRA, &data_, &w, &h);
148 size_.SetSize(w, h); 148 size_.SetSize(w, h);
149 row_length_ = size_.width() * sizeof(uint32_t); 149 row_length_ = size_.width() * sizeof(uint32_t);
150 return success; 150 return success;
151 } 151 }
152 152
153 bool Image::LoadMetafile(const std::string& data) { 153 bool Image::LoadMetafile(const std::string& data) {
Lei Zhang 2016/06/14 18:02:19 Looks like this is gone now with r399738 landed.
154 DCHECK(!data.empty()); 154 DCHECK(!data.empty());
155 PdfMetafileSkia metafile; 155 PdfMetafileSkia metafile(PDF_SKIA_DOCUMENT_TYPE);
156 if (!metafile.InitFromData(data.data(), 156 if (!metafile.InitFromData(data.data(),
157 base::checked_cast<uint32_t>(data.size()))) 157 base::checked_cast<uint32_t>(data.size())))
158 return false; 158 return false;
159 return LoadMetafile(metafile); 159 return LoadMetafile(metafile);
160 } 160 }
161 161
162 } // namespace printing 162 } // namespace printing
OLDNEW
« no previous file with comments | « components/printing/renderer/print_web_view_helper_linux.cc ('k') | printing/pdf_metafile_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698