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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/pdfparser/native/SkPdfObject.cpp
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkPdfObject.cpp (revision 10402)
+++ experimental/PdfViewer/pdfparser/native/SkPdfObject.cpp (working copy)
@@ -6,6 +6,9 @@
#include "SkStream.h"
#include "SkPdfNativeTokenizer.h"
+#include "SkBitmap.h"
+#include "SkPdfFont.h"
+
SkPdfObject SkPdfObject::kNull = SkPdfObject::makeNull();
bool SkPdfObject::applyFlateDecodeFilter() {
@@ -86,3 +89,21 @@
return true;
}
+
+void SkPdfObject::releaseData() {
+ if (fData) {
+ switch (fDataType) {
+ case kFont_Data:
+ delete (SkPdfFont*)fData;
+ break;
+ case kBitmap_Data:
+ delete (SkBitmap*)fData;
+ break;
+ default:
+ SkASSERT(false);
+ break;
+ }
+ }
+ fData = NULL;
+ fDataType = kEmpty_Data;
+}
« 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