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

Side by Side Diff: src/doc/SkDocument_PDF.cpp

Issue 1110013002: Update more directories under src/ to follow C++11 style rule for {virtual,override}. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « src/animator/SkDrawPaint.h ('k') | src/doc/SkDocument_XPS.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDocument.h" 8 #include "SkDocument.h"
9 #include "SkPDFCanon.h" 9 #include "SkPDFCanon.h"
10 #include "SkPDFDevice.h" 10 #include "SkPDFDevice.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 SkScalar rasterDpi) 298 SkScalar rasterDpi)
299 : SkDocument(stream, doneProc) 299 : SkDocument(stream, doneProc)
300 , fRasterDpi(rasterDpi) {} 300 , fRasterDpi(rasterDpi) {}
301 301
302 virtual ~SkDocument_PDF() { 302 virtual ~SkDocument_PDF() {
303 // subclasses must call close() in their destructors 303 // subclasses must call close() in their destructors
304 this->close(); 304 this->close();
305 } 305 }
306 306
307 protected: 307 protected:
308 virtual SkCanvas* onBeginPage(SkScalar width, SkScalar height, 308 SkCanvas* onBeginPage(SkScalar width, SkScalar height,
309 const SkRect& trimBox) override { 309 const SkRect& trimBox) override {
310 SkASSERT(!fCanvas.get()); 310 SkASSERT(!fCanvas.get());
311 311
312 SkISize pageSize = SkISize::Make( 312 SkISize pageSize = SkISize::Make(
313 SkScalarRoundToInt(width), SkScalarRoundToInt(height)); 313 SkScalarRoundToInt(width), SkScalarRoundToInt(height));
314 SkAutoTUnref<SkPDFDevice> device( 314 SkAutoTUnref<SkPDFDevice> device(
315 SkPDFDevice::Create(pageSize, fRasterDpi, &fCanon)); 315 SkPDFDevice::Create(pageSize, fRasterDpi, &fCanon));
316 fCanvas.reset(SkNEW_ARGS(SkCanvas, (device.get()))); 316 fCanvas.reset(SkNEW_ARGS(SkCanvas, (device.get())));
317 fPageDevices.push(device.detach()); 317 fPageDevices.push(device.detach());
318 fCanvas->clipRect(trimBox); 318 fCanvas->clipRect(trimBox);
319 fCanvas->translate(trimBox.x(), trimBox.y()); 319 fCanvas->translate(trimBox.x(), trimBox.y());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { 356 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
357 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path)); 357 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path));
358 if (!stream->isValid()) { 358 if (!stream->isValid()) {
359 SkDELETE(stream); 359 SkDELETE(stream);
360 return NULL; 360 return NULL;
361 } 361 }
362 auto delete_wstream = [](SkWStream* stream, bool) { SkDELETE(stream); }; 362 auto delete_wstream = [](SkWStream* stream, bool) { SkDELETE(stream); };
363 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi)); 363 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi));
364 } 364 }
OLDNEW
« no previous file with comments | « src/animator/SkDrawPaint.h ('k') | src/doc/SkDocument_XPS.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698