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

Side by Side Diff: printing/pdf_metafile_skia.cc

Issue 900683004: Removed unused code in skia/ext/vector_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tue Feb 3 23:09:45 PST 2015 Created 5 years, 10 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') | skia/BUILD.gn » ('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/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
11 #include "base/posix/eintr_wrapper.h" 11 #include "base/posix/eintr_wrapper.h"
12 #include "skia/ext/refptr.h" 12 #include "skia/ext/refptr.h"
13 #include "skia/ext/vector_canvas.h"
14 #include "third_party/skia/include/core/SkData.h" 13 #include "third_party/skia/include/core/SkData.h"
15 #include "third_party/skia/include/core/SkDocument.h" 14 #include "third_party/skia/include/core/SkDocument.h"
16 #include "third_party/skia/include/core/SkPictureRecorder.h" 15 #include "third_party/skia/include/core/SkPictureRecorder.h"
17 #include "third_party/skia/include/core/SkRect.h" 16 #include "third_party/skia/include/core/SkRect.h"
18 #include "third_party/skia/include/core/SkRefCnt.h" 17 #include "third_party/skia/include/core/SkRefCnt.h"
19 #include "third_party/skia/include/core/SkScalar.h" 18 #include "third_party/skia/include/core/SkScalar.h"
20 #include "third_party/skia/include/core/SkSize.h" 19 #include "third_party/skia/include/core/SkSize.h"
21 #include "third_party/skia/include/core/SkStream.h" 20 #include "third_party/skia/include/core/SkStream.h"
22 #include "ui/gfx/geometry/point.h" 21 #include "ui/gfx/geometry/point.h"
23 #include "ui/gfx/geometry/rect.h" 22 #include "ui/gfx/geometry/rect.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 96
98 SkCanvas* recordingCanvas = data_->recorder_.beginRecording( 97 SkCanvas* recordingCanvas = data_->recorder_.beginRecording(
99 sk_page_size.width(), sk_page_size.height(), NULL, 0); 98 sk_page_size.width(), sk_page_size.height(), NULL, 0);
100 // recordingCanvas is owned by the data_->recorder_. No ref() necessary. 99 // recordingCanvas is owned by the data_->recorder_. No ref() necessary.
101 if (!recordingCanvas) 100 if (!recordingCanvas)
102 return false; 101 return false;
103 recordingCanvas->scale(scale_factor, scale_factor); 102 recordingCanvas->scale(scale_factor, scale_factor);
104 return true; 103 return true;
105 } 104 }
106 105
107 skia::VectorCanvas* PdfMetafileSkia::GetVectorCanvasForNewPage( 106 skia::PlatformCanvas* PdfMetafileSkia::GetVectorCanvasForNewPage(
108 const gfx::Size& page_size, 107 const gfx::Size& page_size,
109 const gfx::Rect& content_area, 108 const gfx::Rect& content_area,
110 const float& scale_factor) { 109 const float& scale_factor) {
111 if (!StartPage(page_size, content_area, scale_factor)) 110 if (!StartPage(page_size, content_area, scale_factor))
112 return nullptr; 111 return nullptr;
113 return data_->recorder_.getRecordingCanvas(); 112 return data_->recorder_.getRecordingCanvas();
114 } 113 }
115 114
116 bool PdfMetafileSkia::FinishPage() { 115 bool PdfMetafileSkia::FinishPage() {
117 if (!data_->recorder_.getRecordingCanvas()) 116 if (!data_->recorder_.getRecordingCanvas())
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 272
274 metafile->data_->pages_.push_back(page); 273 metafile->data_->pages_.push_back(page);
275 274
276 if (!metafile->FinishDocument()) // Generate PDF. 275 if (!metafile->FinishDocument()) // Generate PDF.
277 metafile.reset(); 276 metafile.reset();
278 277
279 return metafile.Pass(); 278 return metafile.Pass();
280 } 279 }
281 280
282 } // namespace printing 281 } // namespace printing
OLDNEW
« no previous file with comments | « printing/pdf_metafile_skia.h ('k') | skia/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698