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); | |
22 | |
23 SkNulCanvas() {} | 21 SkNulCanvas() {} |
24 explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {} | 22 explicit SkNulCanvas(SkBaseDevice* device) : SkCanvas(device) {} |
25 | 23 |
26 explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} | 24 explicit SkNulCanvas(const SkBitmap& bitmap) : SkCanvas(bitmap) {} |
27 virtual ~SkNulCanvas() {} | 25 virtual ~SkNulCanvas() {} |
28 | 26 |
29 SkDrawFilter* setDrawFilter(SkDrawFilter* filter) override {return NULL;} | 27 SkDrawFilter* setDrawFilter(SkDrawFilter* filter) override {return NULL;} |
30 | 28 |
31 bool isClipEmpty() const override { return false; } | 29 bool isClipEmpty() const override { return false; } |
32 bool getClipBounds(SkRect* bounds) const override { | 30 bool getClipBounds(SkRect* bounds) const override { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | 89 void onDrawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, |
92 const SkRect& dst, const SkPaint* paint = NULL) overri
de {} | 90 const SkRect& dst, const SkPaint* paint = NULL) overri
de {} |
93 void onDrawSprite(const SkBitmap& bitmap, int left, int top, | 91 void onDrawSprite(const SkBitmap& bitmap, int left, int top, |
94 const SkPaint* paint = NULL) override {} | 92 const SkPaint* paint = NULL) override {} |
95 void onDrawVertices(VertexMode vmode, int vertexCount, | 93 void onDrawVertices(VertexMode vmode, int vertexCount, |
96 const SkPoint vertices[], const SkPoint texs[], | 94 const SkPoint vertices[], const SkPoint texs[], |
97 const SkColor colors[], SkXfermode* xmode, | 95 const SkColor colors[], SkXfermode* xmode, |
98 const uint16_t indices[], int indexCount, | 96 const uint16_t indices[], int indexCount, |
99 const SkPaint& paint) override {} | 97 const SkPaint& paint) override {} |
100 | 98 |
101 | 99 |
102 private: | 100 private: |
103 typedef SkCanvas INHERITED; | 101 typedef SkCanvas INHERITED; |
104 }; | 102 }; |
105 | 103 |
106 #endif // SkNulCanvas_DEFINED | 104 #endif // SkNulCanvas_DEFINED |
OLD | NEW |