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

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

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/SkPdfRenderer.cpp ('k') | gyp/pdfviewer.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_ 1 #ifndef EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_
2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_ 2 #define EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_
3 3
4 #include <stdint.h> 4 #include <stdint.h>
5 #include <string.h> 5 #include <string.h>
6 #include <string> 6 #include <string>
7 #include "SkTDArray.h" 7 #include "SkTDArray.h"
8 #include "SkTDict.h" 8 #include "SkTDict.h"
9 #include "SkRect.h" 9 #include "SkRect.h"
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 inline double numberValue() const { 600 inline double numberValue() const {
601 SkASSERT(isNumber()); 601 SkASSERT(isNumber());
602 602
603 if (!isNumber()) { 603 if (!isNumber()) {
604 // TODO(edisonn): log err 604 // TODO(edisonn): log err
605 return 0; 605 return 0;
606 } 606 }
607 return fObjectType == kReal_PdfObjectType ? fRealValue : fIntegerValue; 607 return fObjectType == kReal_PdfObjectType ? fRealValue : fIntegerValue;
608 } 608 }
609 609
610 inline SkScalar scalarValue() const {
611 SkASSERT(isNumber());
612
613 if (!isNumber()) {
614 // TODO(edisonn): log err
615 return SkIntToScalar(0);
616 }
617 return fObjectType == kReal_PdfObjectType ? SkDoubleToScalar(fRealValue) :
618 SkIntToScalar(fIntegerValue) ;
619 }
620
610 int referenceId() const { 621 int referenceId() const {
611 SkASSERT(fObjectType == kReference_PdfObjectType); 622 SkASSERT(fObjectType == kReference_PdfObjectType);
612 return fRef.fId; 623 return fRef.fId;
613 } 624 }
614 625
615 int referenceGeneration() const { 626 int referenceGeneration() const {
616 SkASSERT(fObjectType == kReference_PdfObjectType); 627 SkASSERT(fObjectType == kReference_PdfObjectType);
617 return fRef.fGen; 628 return fRef.fGen;
618 } 629 }
619 630
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 SkPdfName() : SkPdfObject() { 910 SkPdfName() : SkPdfObject() {
900 SkPdfObject::makeName((const unsigned char*)"", this); 911 SkPdfObject::makeName((const unsigned char*)"", this);
901 } 912 }
902 public: 913 public:
903 SkPdfName(char* name) : SkPdfObject() { 914 SkPdfName(char* name) : SkPdfObject() {
904 this->makeName((const unsigned char*)name, this); 915 this->makeName((const unsigned char*)name, this);
905 } 916 }
906 }; 917 };
907 918
908 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_ 919 #endif // EXPERIMENTAL_PDFVIEWER_PDFPARSER_NATIVE_SKPDFOBJECT_H_
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | gyp/pdfviewer.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698