edisonn@google.com | ac03d91 | 2013-07-22 15:36:39 +0000 | [diff] [blame] | 1 | #ifndef EXPERIMENTAL_PDFVIEWER_SKNULCANVAS_H_ |
| 2 | #define EXPERIMENTAL_PDFVIEWER_SKNULCANVAS_H_ |
| 3 | |
| 4 | #include "SkCanvas.h" |
| 5 | |
| 6 | class SK_API SkNulCanvas : public SkCanvas { |
| 7 | public: |
| 8 | SK_DECLARE_INST_COUNT(SkNulCanvas); |
| 9 | |
| 10 | SkNulCanvas() {} |
robertphillips@google.com | 9b051a3 | 2013-08-20 20:06:40 +0000 | [diff] [blame^] | 11 | explicit SkNulCanvas(SkDevice* device) : SkCanvas(device) {} |
edisonn@google.com | ac03d91 | 2013-07-22 15:36:39 +0000 | [diff] [blame] | 12 | |
| 13 | explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} |
| 14 | virtual ~SkNulCanvas() {} |
| 15 | |
| 16 | virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) {return 0;} |
| 17 | virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, |
| 18 | SaveFlags flags = kARGB_ClipLayer_SaveFlag) {return 0;} |
| 19 | int saveLayerAlpha(const SkRect* bounds, U8CPU alpha, |
| 20 | SaveFlags flags = kARGB_ClipLayer_SaveFlag) {return 0;} |
| 21 | virtual void restore() {} |
| 22 | int getSaveCount() const {return 0;} |
| 23 | virtual bool isDrawingToLayer() const {return false;} |
| 24 | virtual bool translate(SkScalar dx, SkScalar dy) {return true;} |
| 25 | virtual bool scale(SkScalar sx, SkScalar sy) {return true;} |
| 26 | virtual bool rotate(SkScalar degrees) {return true;} |
| 27 | virtual bool skew(SkScalar sx, SkScalar sy) {return true;} |
| 28 | virtual bool concat(const SkMatrix& matrix) {return true;} |
| 29 | virtual void setMatrix(const SkMatrix& matrix) {} |
| 30 | virtual bool clipRect(const SkRect& rect, |
| 31 | SkRegion::Op op = SkRegion::kIntersect_Op, |
| 32 | bool doAntiAlias = false) {return true;} |
| 33 | virtual bool clipRRect(const SkRRect& rrect, |
| 34 | SkRegion::Op op = SkRegion::kIntersect_Op, |
| 35 | bool doAntiAlias = false) {return true;} |
| 36 | virtual bool clipPath(const SkPath& path, |
| 37 | SkRegion::Op op = SkRegion::kIntersect_Op, |
| 38 | bool doAntiAlias = false) {return true;} |
| 39 | virtual bool clipRegion(const SkRegion& deviceRgn, |
| 40 | SkRegion::Op op = SkRegion::kIntersect_Op) {return true;} |
| 41 | virtual void clear(SkColor) {} |
| 42 | virtual void drawPaint(const SkPaint& paint) {} |
| 43 | virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
| 44 | const SkPaint& paint) {} |
| 45 | virtual void drawRect(const SkRect& rect, const SkPaint& paint) {} |
| 46 | virtual void drawOval(const SkRect& oval, const SkPaint&) {} |
| 47 | virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) {} |
| 48 | virtual void drawPath(const SkPath& path, const SkPaint& paint) {} |
| 49 | virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
| 50 | const SkPaint* paint = NULL) {} |
| 51 | virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
| 52 | const SkRect& dst, |
edisonn@google.com | 2c81777 | 2013-08-16 16:30:02 +0000 | [diff] [blame] | 53 | const SkPaint* paint, |
| 54 | DrawBitmapRectFlags flags) {} |
edisonn@google.com | ac03d91 | 2013-07-22 15:36:39 +0000 | [diff] [blame] | 55 | virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m, |
| 56 | const SkPaint* paint = NULL) {} |
| 57 | virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 58 | const SkRect& dst, const SkPaint* paint = NULL) {} |
| 59 | virtual void drawSprite(const SkBitmap& bitmap, int left, int top, |
| 60 | const SkPaint* paint = NULL) {} |
| 61 | virtual void drawText(const void* text, size_t byteLength, SkScalar x, |
| 62 | SkScalar y, const SkPaint& paint) {} |
| 63 | virtual void drawPosText(const void* text, size_t byteLength, |
| 64 | const SkPoint pos[], const SkPaint& paint) {} |
| 65 | virtual void drawPosTextH(const void* text, size_t byteLength, |
| 66 | const SkScalar xpos[], SkScalar constY, |
| 67 | const SkPaint& paint) {} |
| 68 | virtual void drawTextOnPath(const void* text, size_t byteLength, |
| 69 | const SkPath& path, const SkMatrix* matrix, |
| 70 | const SkPaint& paint) {} |
| 71 | virtual void drawPicture(SkPicture& picture) {} |
| 72 | virtual void drawVertices(VertexMode vmode, int vertexCount, |
| 73 | const SkPoint vertices[], const SkPoint texs[], |
| 74 | const SkColor colors[], SkXfermode* xmode, |
| 75 | const uint16_t indices[], int indexCount, |
| 76 | const SkPaint& paint) {} |
| 77 | virtual void drawData(const void* data, size_t length) {} |
| 78 | virtual void beginCommentGroup(const char* description) {} |
| 79 | virtual void addComment(const char* kywd, const char* value) {} |
| 80 | virtual void endCommentGroup() {} |
| 81 | virtual SkBounder* setBounder(SkBounder* bounder) {return NULL;} |
| 82 | virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) {return NULL;} |
| 83 | |
| 84 | protected: |
| 85 | virtual SkCanvas* canvasForDrawIter() {return NULL;} |
robertphillips@google.com | 9b051a3 | 2013-08-20 20:06:40 +0000 | [diff] [blame^] | 86 | virtual SkDevice* setDevice(SkDevice* device) {return NULL;} |
edisonn@google.com | ac03d91 | 2013-07-22 15:36:39 +0000 | [diff] [blame] | 87 | |
| 88 | private: |
| 89 | typedef SkCanvas INHERITED; |
| 90 | }; |
| 91 | |
| 92 | #endif // EXPERIMENTAL_PDFVIEWER_SKNULCANVAS_H_ |