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

Side by Side Diff: experimental/PdfViewer/SkPdfGraphicsState.cpp

Issue 77763007: Move SkPdfContext into its own files. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/SkPdfGraphicsState.h ('k') | experimental/PdfViewer/inc/SkPdfContext.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 2013 Google Inc. 2 * Copyright 2013 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 "SkPdfGraphicsState.h" 8 #include "SkPdfGraphicsState.h"
9 9
10 #include "SkDashPathEffect.h" 10 #include "SkDashPathEffect.h"
11 #include "SkPdfNativeTokenizer.h"
12
13 SkPdfContext::SkPdfContext(SkPdfNativeDoc* doc)
14 : fPdfDoc(doc)
15 , fTmpPageAllocator(new SkPdfAllocator()) {
16 }
17
18 SkPdfContext::~SkPdfContext() {
19 delete fTmpPageAllocator;
20 }
21 11
22 void SkPdfGraphicsState::applyGraphicsState(SkPaint* paint, bool stroking) { 12 void SkPdfGraphicsState::applyGraphicsState(SkPaint* paint, bool stroking) {
23 if (stroking) { 13 if (stroking) {
24 fStroking.applyGraphicsState(paint); 14 fStroking.applyGraphicsState(paint);
25 } else { 15 } else {
26 fNonStroking.applyGraphicsState(paint); 16 fNonStroking.applyGraphicsState(paint);
27 } 17 }
28 18
29 // TODO(edisonn): Perf, we should load this option from pdfContext->options, 19 // TODO(edisonn): Perf, we should load this option from pdfContext->options,
30 // or pdfContext->addPaintOptions(&paint); 20 // or pdfContext->addPaintOptions(&paint);
(...skipping 11 matching lines...) Expand all
42 } 32 }
43 33
44 // TODO(edisonn): NYI multiple blend modes 34 // TODO(edisonn): NYI multiple blend modes
45 if (fBlendModesLength == 1 && fBlendModes[0] != SkXfermode::kSrc_Mode) { 35 if (fBlendModesLength == 1 && fBlendModes[0] != SkXfermode::kSrc_Mode) {
46 paint->setXfermodeMode(fBlendModes[0]); 36 paint->setXfermodeMode(fBlendModes[0]);
47 } 37 }
48 38
49 //paint->setStrokeMiter(SkDoubleToScalar(fMiterLimit)); 39 //paint->setStrokeMiter(SkDoubleToScalar(fMiterLimit));
50 // TODO(edisonn): impl cap and join 40 // TODO(edisonn): impl cap and join
51 } 41 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfGraphicsState.h ('k') | experimental/PdfViewer/inc/SkPdfContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698