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

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

Issue 20810002: pdfviewer: (draft, not to be checked in, just for backup online) gs implementation (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/SkPdfBasics.h ('k') | experimental/PdfViewer/SkPdfRenderer.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 #include "SkPdfBasics.h" 1 #include "SkPdfBasics.h"
2 #include "SkPdfNativeTokenizer.h" 2 #include "SkPdfNativeTokenizer.h"
3 3
4 #include "SkDashPathEffect.h"
5
4 PdfContext::PdfContext(SkNativeParsedPDF* doc) 6 PdfContext::PdfContext(SkNativeParsedPDF* doc)
5 : fPdfDoc(doc) 7 : fPdfDoc(doc)
6 , fTmpPageAllocator(new SkPdfAllocator()) { 8 , fTmpPageAllocator(new SkPdfAllocator()) {
7 } 9 }
8 10
9 PdfContext::~PdfContext() { 11 PdfContext::~PdfContext() {
10 delete fTmpPageAllocator; 12 delete fTmpPageAllocator;
11 } 13 }
14
15 void SkPdfGraphicsState::applyGraphicsState(SkPaint* paint, bool stroking) {
16 if (stroking) {
17 fStroking.applyGraphicsState(paint);
18 } else {
19 fNonStroking.applyGraphicsState(paint);
20 }
21
22 // TODO(edisonn): get this from pdfContext->options,
23 // or pdfContext->addPaintOptions(&paint);
24 paint->setAntiAlias(true);
25
26 // TODO(edisonn): miter, ...
27 if (stroking) {
28 paint->setStrokeWidth(SkDoubleToScalar(fLineWidth));
29 // TODO(edisonn): perf, two sets of allocs, create SkDashPathEffect cons tr that takes ownership
30 // of the intervals
31 if (fDashArrayLength > 0 && fDashPhase > 0) {
32 paint->setPathEffect(new SkDashPathEffect(fDashArray, fDashArrayLeng th, fDashPhase))->unref();
33 }
34 }
35 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfBasics.h ('k') | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698