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

Side by Side Diff: printing/pdf_metafile_skia.cc

Issue 2400873002: keep only one typedef for the native drawing context (Closed)
Patch Set: native_drawing_context.h Created 4 years, 2 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
« no previous file with comments | « printing/pdf_metafile_skia.h ('k') | printing/printed_document.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_skia.h" 5 #include "printing/pdf_metafile_skia.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "printing/print_settings.h" 9 #include "printing/print_settings.h"
10 #include "third_party/skia/include/core/SkDocument.h" 10 #include "third_party/skia/include/core/SkDocument.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return gfx::Rect(gfx::ToRoundedInt(size.width()), 221 return gfx::Rect(gfx::ToRoundedInt(size.width()),
222 gfx::ToRoundedInt(size.height())); 222 gfx::ToRoundedInt(size.height()));
223 } 223 }
224 return gfx::Rect(); 224 return gfx::Rect();
225 } 225 }
226 226
227 unsigned int PdfMetafileSkia::GetPageCount() const { 227 unsigned int PdfMetafileSkia::GetPageCount() const {
228 return base::checked_cast<unsigned int>(data_->pages_.size()); 228 return base::checked_cast<unsigned int>(data_->pages_.size());
229 } 229 }
230 230
231 gfx::NativeDrawingContext PdfMetafileSkia::context() const { 231 skia::NativeDrawingContext PdfMetafileSkia::context() const {
232 NOTREACHED(); 232 NOTREACHED();
233 return nullptr; 233 return nullptr;
234 } 234 }
235 235
236 236
237 #if defined(OS_WIN) 237 #if defined(OS_WIN)
238 bool PdfMetafileSkia::Playback(gfx::NativeDrawingContext hdc, 238 bool PdfMetafileSkia::Playback(skia::NativeDrawingContext hdc,
239 const RECT* rect) const { 239 const RECT* rect) const {
240 NOTREACHED(); 240 NOTREACHED();
241 return false; 241 return false;
242 } 242 }
243 243
244 bool PdfMetafileSkia::SafePlayback(gfx::NativeDrawingContext hdc) const { 244 bool PdfMetafileSkia::SafePlayback(skia::NativeDrawingContext hdc) const {
245 NOTREACHED(); 245 NOTREACHED();
246 return false; 246 return false;
247 } 247 }
248 248
249 #elif defined(OS_MACOSX) 249 #elif defined(OS_MACOSX)
250 /* TODO(caryclark): The set up of PluginInstance::PrintPDFOutput may result in 250 /* TODO(caryclark): The set up of PluginInstance::PrintPDFOutput may result in
251 rasterized output. Even if that flow uses PdfMetafileCg::RenderPage, 251 rasterized output. Even if that flow uses PdfMetafileCg::RenderPage,
252 the drawing of the PDF into the canvas may result in a rasterized output. 252 the drawing of the PDF into the canvas may result in a rasterized output.
253 PDFMetafileSkia::RenderPage should be not implemented as shown and instead 253 PDFMetafileSkia::RenderPage should be not implemented as shown and instead
254 should do something like the following CL in PluginInstance::PrintPDFOutput: 254 should do something like the following CL in PluginInstance::PrintPDFOutput:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 metafile->data_->pages_.push_back(data_->pages_.back()); 315 metafile->data_->pages_.push_back(data_->pages_.back());
316 316
317 if (!metafile->FinishDocument()) // Generate PDF. 317 if (!metafile->FinishDocument()) // Generate PDF.
318 metafile.reset(); 318 metafile.reset();
319 319
320 return metafile; 320 return metafile;
321 } 321 }
322 322
323 } // namespace printing 323 } // namespace printing
OLDNEW
« no previous file with comments | « printing/pdf_metafile_skia.h ('k') | printing/printed_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698