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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp

Issue 26613006: code cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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
Index: experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp (revision 11671)
+++ experimental/PdfViewer/pdfparser/native/SkPdfNativeObject.cpp (working copy)
@@ -7,24 +7,24 @@
#include "SkPdfNativeObject.h"
+#include "SkBitmap.h"
+#include "SkFlate.h"
+#include "SkPdfFont.h"
+#include "SkPdfNativeTokenizer.h"
+#include "SkPdfReporter.h"
+#include "SkStream.h"
+
// TODO(edisonn): mac builder does not find the header ... but from headers is ok
//#include "SkPdfStreamCommonDictionary_autogen.h"
#include "SkPdfHeaders_autogen.h"
-#include "SkFlate.h"
-#include "SkStream.h"
-#include "SkPdfNativeTokenizer.h"
-#include "SkBitmap.h"
-#include "SkPdfFont.h"
-
-#include "SkPdfReporter.h"
-
SkPdfNativeObject SkPdfNativeObject::kNull = SkPdfNativeObject::makeNull();
bool SkPdfNativeObject::applyFlateDecodeFilter() {
if (!SkFlate::HaveFlate()) {
- SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kNoFlateLibrary_SkPdfIssue, "forgot to link with flate library?", NULL, NULL);
+ SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kNoFlateLibrary_SkPdfIssue,
+ "forgot to link with flate library?", NULL, NULL);
return false;
}
@@ -35,7 +35,8 @@
SkDynamicMemoryWStream uncompressedData;
if (SkFlate::Inflate(&skstream, &uncompressedData)) {
- fStr.fBytes = (uncompressedData.bytesWritten() << 2) + kOwnedStreamBit + kUnfilteredStreamBit;
+ fStr.fBytes = (uncompressedData.bytesWritten() << 2) + kOwnedStreamBit +
+ kUnfilteredStreamBit;
fStr.fBuffer = (const unsigned char*)new unsigned char[uncompressedData.bytesWritten()];
uncompressedData.copyTo((void*)fStr.fBuffer);
@@ -51,9 +52,9 @@
}
bool SkPdfNativeObject::applyDCTDecodeFilter() {
- // this would fail, and it won't allow any more filters.
- // technically, it would be possible, but not a real world scenario
- // TODO(edisonn): or get the image here and store it for fast retrieval?
+ // applyDCTDecodeFilter will fail, and it won't allow any more filters.
+ // technically, it would be possible, but not a real world scenario.
+ // in this way we create the image from the DCT stream directly.
return false;
}
@@ -63,7 +64,8 @@
} else if (strcmp(name, "DCTDecode") == 0) {
return applyDCTDecodeFilter();
}
- SkPdfReport(kCodeWarning_SkPdfIssueSeverity, kNYI_SkPdfIssue, "filter not supported", this, NULL);
+ SkPdfReport(kCodeWarning_SkPdfIssueSeverity, kNYI_SkPdfIssue, "filter not supported", this,
+ NULL);
return false;
}
@@ -71,7 +73,8 @@
SkPdfMarkObjectUsed();
if (!hasStream()) {
- SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kBadStream_SkPdfIssue, "No Stream", this, NULL);
+ SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kBadStream_SkPdfIssue, "No Stream", this,
+ NULL);
return false;
}
@@ -96,7 +99,8 @@
break;
}
} else {
- SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kIncositentSyntax_SkPdfIssue, "filter name should be a Name", this, NULL);
+ SkPdfReport(kIgnoreError_SkPdfIssueSeverity, kIncositentSyntax_SkPdfIssue,
+ "filter name should be a Name", this, NULL);
}
}
}
@@ -106,7 +110,8 @@
void SkPdfNativeObject::releaseData() {
#ifdef PDF_TRACK_OBJECT_USAGE
- SkPdfReportIf(!fUsed, kInfo_SkPdfIssueSeverity, kNoIssue_SkPdfIssue, "Unused object in rendering", this, NULL);
+ SkPdfReportIf(!fUsed, kInfo_SkPdfIssueSeverity, kNoIssue_SkPdfIssue,
+ "Unused object in rendering", this, NULL);
#endif // PDF_TRACK_OBJECT_USAGE
SkPdfMarkObjectUnused();

Powered by Google App Engine
This is Rietveld 408576698