| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkNulCanvas_DEFINED | 8 #ifndef SkNulCanvas_DEFINED |
| 9 #define SkNulCanvas_DEFINED | 9 #define SkNulCanvas_DEFINED |
| 10 | 10 |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 | 12 |
| 13 /** \class SkNulCanvas | 13 /** \class SkNulCanvas |
| 14 * | 14 * |
| 15 * Nul Canvas is a canvas that does nothing. It is used to measure the perf of
just parsing | 15 * Nul Canvas is a canvas that does nothing. It is used to measure the perf of
just parsing |
| 16 * a pdf, without actually rendering anything. | 16 * a pdf, without actually rendering anything. |
| 17 * | 17 * |
| 18 */ | 18 */ |
| 19 class SK_API SkNulCanvas : public SkCanvas { | 19 class SK_API SkNulCanvas : public SkCanvas { |
| 20 public: | 20 public: |
| 21 SK_DECLARE_INST_COUNT(SkNulCanvas); | 21 SK_DECLARE_INST_COUNT(SkNulCanvas); |
| 22 | 22 |
| 23 SkNulCanvas() {} | 23 SkNulCanvas() {} |
| 24 explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {} | 24 explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {} |
| 25 | 25 |
| 26 explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} | 26 explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} |
| 27 virtual ~SkNulCanvas() {} | 27 virtual ~SkNulCanvas() {} |
| 28 | 28 |
| 29 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE {} | |
| 30 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], | |
| 31 const SkPaint& paint) SK_OVERRIDE {} | |
| 32 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE
{} | |
| 33 virtual void drawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE {} | |
| 34 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI
DE {} | |
| 35 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE
{} | |
| 36 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, | |
| 37 const SkPaint* paint = NULL) SK_OVERRIDE {} | |
| 38 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, | |
| 39 const SkRect& dst, | |
| 40 const SkPaint* paint, | |
| 41 DrawBitmapRectFlags flags) SK_OVERRIDE {} | |
| 42 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | |
| 43 const SkRect& dst, const SkPaint* paint = NULL)
SK_OVERRIDE {} | |
| 44 virtual void drawSprite(const SkBitmap& bitmap, int left, int top, | |
| 45 const SkPaint* paint = NULL) SK_OVERRIDE {} | |
| 46 virtual void drawVertices(VertexMode vmode, int vertexCount, | |
| 47 const SkPoint vertices[], const SkPoint texs[], | |
| 48 const SkColor colors[], SkXfermode* xmode, | |
| 49 const uint16_t indices[], int indexCount, | |
| 50 const SkPaint& paint) SK_OVERRIDE {} | |
| 51 virtual void beginCommentGroup(const char* description) SK_OVERRIDE {} | 29 virtual void beginCommentGroup(const char* description) SK_OVERRIDE {} |
| 52 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE {} | 30 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE {} |
| 53 virtual void endCommentGroup() SK_OVERRIDE {} | 31 virtual void endCommentGroup() SK_OVERRIDE {} |
| 54 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE {retur
n NULL;} | 32 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE {retur
n NULL;} |
| 55 | 33 |
| 56 virtual bool isClipEmpty() const SK_OVERRIDE { return false; } | 34 virtual bool isClipEmpty() const SK_OVERRIDE { return false; } |
| 57 virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE { | 35 virtual bool getClipBounds(SkRect* bounds) const SK_OVERRIDE { |
| 58 if (NULL != bounds) { | 36 if (NULL != bounds) { |
| 59 bounds->setXYWH(0, 0, | 37 bounds->setXYWH(0, 0, |
| 60 SkIntToScalar(this->imageInfo().width()), | 38 SkIntToScalar(this->imageInfo().width()), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 89 virtual void onDrawTextOnPath(const void* text, size_t byteLength, | 67 virtual void onDrawTextOnPath(const void* text, size_t byteLength, |
| 90 const SkPath& path, const SkMatrix* matrix, | 68 const SkPath& path, const SkMatrix* matrix, |
| 91 const SkPaint& paint) SK_OVERRIDE {} | 69 const SkPaint& paint) SK_OVERRIDE {} |
| 92 | 70 |
| 93 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE {} | 71 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE {} |
| 94 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE {} | 72 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE {} |
| 95 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE {} | 73 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE {} |
| 96 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE {} | 74 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE {} |
| 97 | 75 |
| 98 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE {} | 76 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE {} |
| 77 |
| 78 void onDrawPaint(const SkPaint& paint) SK_OVERRIDE {} |
| 79 void onDrawPoints(PointMode mode, size_t count, const SkPoint pts[], |
| 80 const SkPaint& paint) SK_OVERRIDE {} |
| 81 void onDrawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE {} |
| 82 void onDrawOval(const SkRect& oval, const SkPaint&) SK_OVERRIDE {} |
| 83 void onDrawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE {} |
| 84 void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE {} |
| 85 void onDrawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
| 86 const SkPaint* paint = NULL) SK_OVERRIDE {} |
| 87 void onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
| 88 const SkRect& dst, |
| 89 const SkPaint* paint, |
| 90 DrawBitmapRectFlags flags) SK_OVERRIDE {} |
| 91 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*
) SK_OVERRIDE {} |
| 92 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, |
| 93 const SkPaint*) SK_OVERRIDE{} |
| 94 void onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
| 95 const SkRect& dst, const SkPaint* paint = NULL) SK_OVE
RRIDE {} |
| 96 void onDrawSprite(const SkBitmap& bitmap, int left, int top, |
| 97 const SkPaint* paint = NULL) SK_OVERRIDE {} |
| 98 void onDrawVertices(VertexMode vmode, int vertexCount, |
| 99 const SkPoint vertices[], const SkPoint texs[], |
| 100 const SkColor colors[], SkXfermode* xmode, |
| 101 const uint16_t indices[], int indexCount, |
| 102 const SkPaint& paint) SK_OVERRIDE {} |
| 103 |
| 99 | 104 |
| 100 private: | 105 private: |
| 101 typedef SkCanvas INHERITED; | 106 typedef SkCanvas INHERITED; |
| 102 }; | 107 }; |
| 103 | 108 |
| 104 #endif // SkNulCanvas_DEFINED | 109 #endif // SkNulCanvas_DEFINED |
| OLD | NEW |