diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-20 22:33:39 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-20 22:33:39 +0000 |
commit | d906702f7812807d79eeaba65acff62235990b64 (patch) | |
tree | 2080735fbc6678a41dc2516c67ddcd6c1912d670 /experimental | |
parent | b1de123336246ad970e8a593267c37cc3be8105c (diff) |
Move SkPdfContext into its own files.
Otherwise, the class is unchanged.
Review URL: https://codereview.chromium.org/77763007
git-svn-id: http://skia.googlecode.com/svn/trunk@12330 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental')
-rw-r--r-- | experimental/PdfViewer/SkPdfFont.h | 2 | ||||
-rw-r--r-- | experimental/PdfViewer/SkPdfGraphicsState.cpp | 10 | ||||
-rw-r--r-- | experimental/PdfViewer/SkPdfGraphicsState.h | 22 | ||||
-rw-r--r-- | experimental/PdfViewer/inc/SkPdfContext.h | 30 | ||||
-rw-r--r-- | experimental/PdfViewer/src/SkPdfContext.cpp | 18 |
5 files changed, 50 insertions, 32 deletions
diff --git a/experimental/PdfViewer/SkPdfFont.h b/experimental/PdfViewer/SkPdfFont.h index 71f98db2ca..4a66edfaaa 100644 --- a/experimental/PdfViewer/SkPdfFont.h +++ b/experimental/PdfViewer/SkPdfFont.h @@ -12,7 +12,7 @@ #ifndef SkPdfFont_DEFINED #define SkPdfFont_DEFINED -#include "SkPdfGraphicsState.h" +#include "SkPdfContext.h" #include "SkPdfHeaders_autogen.h" #include "SkPdfMapper_autogen.h" #include "SkPdfUtils.h" diff --git a/experimental/PdfViewer/SkPdfGraphicsState.cpp b/experimental/PdfViewer/SkPdfGraphicsState.cpp index 2a01b14b90..b52f22ccc7 100644 --- a/experimental/PdfViewer/SkPdfGraphicsState.cpp +++ b/experimental/PdfViewer/SkPdfGraphicsState.cpp @@ -8,16 +8,6 @@ #include "SkPdfGraphicsState.h" #include "SkDashPathEffect.h" -#include "SkPdfNativeTokenizer.h" - -SkPdfContext::SkPdfContext(SkPdfNativeDoc* doc) - : fPdfDoc(doc) - , fTmpPageAllocator(new SkPdfAllocator()) { -} - -SkPdfContext::~SkPdfContext() { - delete fTmpPageAllocator; -} void SkPdfGraphicsState::applyGraphicsState(SkPaint* paint, bool stroking) { if (stroking) { diff --git a/experimental/PdfViewer/SkPdfGraphicsState.h b/experimental/PdfViewer/SkPdfGraphicsState.h index 00bfeef109..029633d6e1 100644 --- a/experimental/PdfViewer/SkPdfGraphicsState.h +++ b/experimental/PdfViewer/SkPdfGraphicsState.h @@ -12,12 +12,8 @@ #include "SkPaint.h" #include "SkPdfConfig.h" #include "SkPdfUtils.h" -#include "SkTDStackNester.h" -class SkPdfAllocator; class SkPdfFont; -class SkPdfDoc; -class SkPdfNativeDoc; class SkPdfNativeObject; class SkPdfResourceDictionary; class SkPdfSoftMaskDictionary; @@ -80,7 +76,7 @@ public: } }; -/** \class SkTDStackNester +/** * Operates on stroking or non-stroking properties. */ struct SkPdfGraphicsState { @@ -355,20 +351,4 @@ smoothness number (PDF 1.3) The precision with which col void applyGraphicsState(SkPaint* paint, bool stroking); }; -/** \class SkPdfContext - * The context of the drawing. The document we draw from, the current stack of objects, ... - */ -class SkPdfContext { -public: - SkTDStackNester<SkPdfNativeObject*> fObjectStack; - SkTDStackNester<SkPdfGraphicsState> fStateStack; - SkPdfGraphicsState fGraphicsState; - SkPdfNativeDoc* fPdfDoc; - SkPdfAllocator* fTmpPageAllocator; - SkMatrix fOriginalMatrix; - - SkPdfContext(SkPdfNativeDoc* doc); - ~SkPdfContext(); -}; - #endif // SkPdfGraphicsState_DEFINED diff --git a/experimental/PdfViewer/inc/SkPdfContext.h b/experimental/PdfViewer/inc/SkPdfContext.h new file mode 100644 index 0000000000..48c5472b02 --- /dev/null +++ b/experimental/PdfViewer/inc/SkPdfContext.h @@ -0,0 +1,30 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkMatrix.h" +#include "SkTDStackNester.h" +#include "SkPdfGraphicsState.h" + +class SkPdfAllocator; +class SkPdfNativeDoc; +class SkPdfNativeObject; + +/** \class SkPdfContext + * The context of the drawing. The document we draw from, the current stack of objects, ... + */ +class SkPdfContext { +public: + SkTDStackNester<SkPdfNativeObject*> fObjectStack; + SkTDStackNester<SkPdfGraphicsState> fStateStack; + SkPdfGraphicsState fGraphicsState; + SkPdfNativeDoc* fPdfDoc; + SkPdfAllocator* fTmpPageAllocator; + SkMatrix fOriginalMatrix; + + SkPdfContext(SkPdfNativeDoc* doc); + ~SkPdfContext(); +}; diff --git a/experimental/PdfViewer/src/SkPdfContext.cpp b/experimental/PdfViewer/src/SkPdfContext.cpp new file mode 100644 index 0000000000..2ce01e75fa --- /dev/null +++ b/experimental/PdfViewer/src/SkPdfContext.cpp @@ -0,0 +1,18 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkPdfContext.h" +#include "SkPdfNativeTokenizer.h" + +SkPdfContext::SkPdfContext(SkPdfNativeDoc* doc) + : fPdfDoc(doc) + , fTmpPageAllocator(new SkPdfAllocator()) { +} + +SkPdfContext::~SkPdfContext() { + delete fTmpPageAllocator; +} |