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

Side by Side Diff: printing/pdf_metafile_skia.cc

Issue 2690583002: Make cc/paint have concrete types (Closed)
Patch Set: PaintRecord as typedef, fixup playback calls Created 3 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/pdf_metafile_skia.h" 5 #include "printing/pdf_metafile_skia.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 switch (data_->type_) { 193 switch (data_->type_) {
194 case PDF_SKIA_DOCUMENT_TYPE: 194 case PDF_SKIA_DOCUMENT_TYPE:
195 doc = MakePdfDocument(&stream); 195 doc = MakePdfDocument(&stream);
196 break; 196 break;
197 case MSKP_SKIA_DOCUMENT_TYPE: 197 case MSKP_SKIA_DOCUMENT_TYPE:
198 doc = SkMakeMultiPictureDocument(&stream); 198 doc = SkMakeMultiPictureDocument(&stream);
199 break; 199 break;
200 } 200 }
201 201
202 for (const Page& page : data_->pages_) { 202 for (const Page& page : data_->pages_) {
203 cc::PaintCanvas* canvas( 203 cc::PaintCanvas canvas(
204 doc->beginPage(page.size_.width(), page.size_.height())); 204 doc->beginPage(page.size_.width(), page.size_.height()));
205 canvas->drawPicture(page.content_); 205 canvas.drawPicture(page.content_);
206 doc->endPage(); 206 doc->endPage();
207 } 207 }
208 doc->close(); 208 doc->close();
209 209
210 data_->pdf_data_.reset(stream.detachAsStream()); 210 data_->pdf_data_.reset(stream.detachAsStream());
211 return true; 211 return true;
212 } 212 }
213 213
214 uint32_t PdfMetafileSkia::GetDataSize() const { 214 uint32_t PdfMetafileSkia::GetDataSize() const {
215 if (!data_->pdf_data_) 215 if (!data_->pdf_data_)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 metafile->data_->pages_.push_back(data_->pages_.back()); 324 metafile->data_->pages_.push_back(data_->pages_.back());
325 325
326 if (!metafile->FinishDocument()) // Generate PDF. 326 if (!metafile->FinishDocument()) // Generate PDF.
327 metafile.reset(); 327 metafile.reset();
328 328
329 return metafile; 329 return metafile;
330 } 330 }
331 331
332 } // namespace printing 332 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698