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

Side by Side Diff: printing/pdf_metafile_cg_mac.cc

Issue 697373004: Moved StartPageForVectorCanvas from Metafile to PdfMetafileSkia. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tue Nov 4 10:41:42 PST 2014 Created 6 years, 1 month 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 | « printing/pdf_metafile_cg_mac.h ('k') | printing/pdf_metafile_skia.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_cg_mac.h" 5 #include "printing/pdf_metafile_cg_mac.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return false; 136 return false;
137 } 137 }
138 138
139 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size)); 139 pdf_data_.reset(CFDataCreateMutable(kCFAllocatorDefault, src_buffer_size));
140 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer), 140 CFDataAppendBytes(pdf_data_, static_cast<const UInt8*>(src_buffer),
141 src_buffer_size); 141 src_buffer_size);
142 142
143 return true; 143 return true;
144 } 144 }
145 145
146 SkBaseDevice* PdfMetafileCg::StartPageForVectorCanvas(
147 const gfx::Size& page_size, const gfx::Rect& content_area,
148 const float& scale_factor) {
149 NOTIMPLEMENTED();
150 return NULL;
151 }
152
153 bool PdfMetafileCg::StartPage(const gfx::Size& page_size, 146 bool PdfMetafileCg::StartPage(const gfx::Size& page_size,
154 const gfx::Rect& content_area, 147 const gfx::Rect& content_area,
155 const float& scale_factor) { 148 const float& scale_factor) {
156 DCHECK(context_.get()); 149 DCHECK(context_.get());
157 DCHECK(!page_is_open_); 150 DCHECK(!page_is_open_);
158 151
159 double height = page_size.height(); 152 double height = page_size.height();
160 double width = page_size.width(); 153 double width = page_size.width();
161 154
162 CGRect bounds = CGRectMake(0, 0, width, height); 155 CGRect bounds = CGRectMake(0, 0, width, height);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 332
340 if (!pdf_doc_.get()) { 333 if (!pdf_doc_.get()) {
341 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider( 334 ScopedCFTypeRef<CGDataProviderRef> pdf_data_provider(
342 CGDataProviderCreateWithCFData(pdf_data_)); 335 CGDataProviderCreateWithCFData(pdf_data_));
343 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider)); 336 pdf_doc_.reset(CGPDFDocumentCreateWithProvider(pdf_data_provider));
344 } 337 }
345 return pdf_doc_.get(); 338 return pdf_doc_.get();
346 } 339 }
347 340
348 } // namespace printing 341 } // namespace printing
OLDNEW
« no previous file with comments | « printing/pdf_metafile_cg_mac.h ('k') | printing/pdf_metafile_skia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698