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

Side by Side Diff: experimental/PdfViewer/pdfparser/native/SkPdfObject.cpp

Issue 21738005: pdfviewer: add indexed rbg image support, enhanche caching(setData) for SkPdfObject (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/pdfparser/native/SkPdfObject.h ('k') | no next file » | 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 #include "SkPdfObject.h" 2 #include "SkPdfObject.h"
3 #include "SkPdfStreamCommonDictionary_autogen.h" 3 #include "SkPdfStreamCommonDictionary_autogen.h"
4 4
5 #include "SkFlate.h" 5 #include "SkFlate.h"
6 #include "SkStream.h" 6 #include "SkStream.h"
7 #include "SkPdfNativeTokenizer.h" 7 #include "SkPdfNativeTokenizer.h"
8 8
9 #include "SkBitmap.h"
10 #include "SkPdfFont.h"
11
9 SkPdfObject SkPdfObject::kNull = SkPdfObject::makeNull(); 12 SkPdfObject SkPdfObject::kNull = SkPdfObject::makeNull();
10 13
11 bool SkPdfObject::applyFlateDecodeFilter() { 14 bool SkPdfObject::applyFlateDecodeFilter() {
12 if (!SkFlate::HaveFlate()) { 15 if (!SkFlate::HaveFlate()) {
13 // TODO(edisonn): warn, make callers handle it 16 // TODO(edisonn): warn, make callers handle it
14 return false; 17 return false;
15 } 18 }
16 19
17 const unsigned char* old = fStr.fBuffer; 20 const unsigned char* old = fStr.fBuffer;
18 bool deleteOld = isStreamOwned(); 21 bool deleteOld = isStreamOwned();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 break; 82 break;
80 } 83 }
81 } else { 84 } else {
82 // TODO(edisonn): report warning 85 // TODO(edisonn): report warning
83 } 86 }
84 } 87 }
85 } 88 }
86 89
87 return true; 90 return true;
88 } 91 }
92
93 void SkPdfObject::releaseData() {
94 if (fData) {
95 switch (fDataType) {
96 case kFont_Data:
97 delete (SkPdfFont*)fData;
98 break;
99 case kBitmap_Data:
100 delete (SkBitmap*)fData;
101 break;
102 default:
103 SkASSERT(false);
104 break;
105 }
106 }
107 fData = NULL;
108 fDataType = kEmpty_Data;
109 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698