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

Side by Side Diff: src/doc/SkDocument_XPS.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, 7 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/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFStream.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 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkXPSDevice.h" 9 #include "SkXPSDevice.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 10 matching lines...) Expand all
21 fPixelsPerMeter.set(pixelsPerMeterScale, pixelsPerMeterScale); 21 fPixelsPerMeter.set(pixelsPerMeterScale, pixelsPerMeterScale);
22 fDevice.beginPortfolio(stream); 22 fDevice.beginPortfolio(stream);
23 } 23 }
24 24
25 virtual ~SkDocument_XPS() { 25 virtual ~SkDocument_XPS() {
26 // subclasses must call close() in their destructors 26 // subclasses must call close() in their destructors
27 this->close(); 27 this->close();
28 } 28 }
29 29
30 protected: 30 protected:
31 virtual SkCanvas* onBeginPage(SkScalar width, 31 SkCanvas* onBeginPage(SkScalar width,
32 SkScalar height, 32 SkScalar height,
33 const SkRect& trimBox) override { 33 const SkRect& trimBox) override {
34 fDevice.beginSheet(fUnitsPerMeter, fPixelsPerMeter, 34 fDevice.beginSheet(fUnitsPerMeter, fPixelsPerMeter,
35 SkSize::Make(width, height)); 35 SkSize::Make(width, height));
36 fCanvas.reset(SkNEW_ARGS(SkCanvas, (&fDevice))); 36 fCanvas.reset(SkNEW_ARGS(SkCanvas, (&fDevice)));
37 fCanvas->clipRect(trimBox); 37 fCanvas->clipRect(trimBox);
38 fCanvas->translate(trimBox.x(), trimBox.y()); 38 fCanvas->translate(trimBox.x(), trimBox.y());
39 return fCanvas.get(); 39 return fCanvas.get();
40 } 40 }
41 41
42 void onEndPage() override { 42 void onEndPage() override {
43 SkASSERT(fCanvas.get()); 43 SkASSERT(fCanvas.get());
(...skipping 26 matching lines...) Expand all
70 SkDELETE(stream); 70 SkDELETE(stream);
71 } 71 }
72 72
73 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) { 73 SkDocument* SkDocument::CreateXPS(const char path[], SkScalar dpi) {
74 SkAutoTDelete<SkFILEWStream> stream(SkNEW_ARGS(SkFILEWStream, (path))); 74 SkAutoTDelete<SkFILEWStream> stream(SkNEW_ARGS(SkFILEWStream, (path)));
75 if (!stream->isValid()) { 75 if (!stream->isValid()) {
76 return NULL; 76 return NULL;
77 } 77 }
78 return SkNEW_ARGS(SkDocument_XPS, (stream.detach(), delete_wstream, dpi)); 78 return SkNEW_ARGS(SkDocument_XPS, (stream.detach(), delete_wstream, dpi));
79 } 79 }
OLDNEW
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698