| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 6 #define SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 7 |
| 8 #include "third_party/skia/include/core/SkCanvas.h" |
| 9 |
| 10 namespace skia { |
| 11 |
| 12 // Does not render anything, but gathers statistics about a region |
| 13 // (specified as a clip rectangle) of an SkPicture as the picture is |
| 14 // played back through it. |
| 15 class SK_API AnalysisCanvas : public SkCanvas { |
| 16 public: |
| 17 AnalysisCanvas(SkRect clip); |
| 18 virtual ~AnalysisCanvas(); |
| 19 |
| 20 virtual int save(SkCanvas::SaveFlags = kMatrixClip_SaveFlag); |
| 21 virtual int saveLayer(const SkRect*, const SkPaint*, |
| 22 SkCanvas::SaveFlags = kARGB_ClipLayer_SaveFlag); |
| 23 virtual void restore(); |
| 24 virtual bool clipRect(const SkRect&, SkRegion::Op, bool); |
| 25 virtual bool clipRRect(const SkRRect&, SkRegion::Op, bool); |
| 26 virtual bool clipPath(const SkPath&, SkRegion::Op, bool); |
| 27 virtual bool clipRegion(const SkRegion&, SkRegion::Op); |
| 28 virtual void clear(SkColor); |
| 29 virtual void drawPaint(const SkPaint&); |
| 30 virtual void drawPoints(PointMode, size_t, const SkPoint [], const SkPaint&); |
| 31 virtual void drawRect(const SkRect&, const SkPaint&); |
| 32 virtual void drawOval(const SkRect&, const SkPaint&); |
| 33 virtual void drawRRect(const SkRRect&, const SkPaint&); |
| 34 virtual void drawPath(const SkPath&, const SkPaint&); |
| 35 virtual void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint&); |
| 36 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect*, |
| 37 const SkRect&, const SkPaint* = NULL); |
| 38 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, |
| 39 const SkPaint* = NULL); |
| 40 virtual void drawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&, |
| 41 const SkPaint* = NULL); |
| 42 virtual void drawSprite(const SkBitmap&, int left, int top, |
| 43 const SkPaint* = NULL); |
| 44 virtual void drawText(const void*, size_t, SkScalar, SkScalar, |
| 45 const SkPaint&); |
| 46 virtual void drawPosText(const void*, size_t, const SkPoint [], |
| 47 const SkPaint&); |
| 48 virtual void drawPosTextH(const void*, size_t, const SkScalar [], SkScalar, |
| 49 const SkPaint&); |
| 50 virtual void drawTextOnPath(const void*, size_t, const SkPath&, |
| 51 const SkMatrix*, const SkPaint&); |
| 52 virtual void drawVertices(VertexMode, int, const SkPoint [], |
| 53 const SkPoint [], const SkColor [], SkXfermode*, |
| 54 const uint16_t [], int, const SkPaint&); |
| 55 virtual void drawData(const void*, size_t); |
| 56 |
| 57 // Returns the estimated cost of drawing, in arbitrary units. |
| 58 int getEstimatedCost() const; |
| 59 |
| 60 // Resets the clip and the cost estimate. |
| 61 void reset(SkRect clip); |
| 62 |
| 63 protected: |
| 64 |
| 65 int estimatedCost_; |
| 66 SkRect clip_; |
| 67 |
| 68 }; |
| 69 |
| 70 } // namespace skia |
| 71 |
| 72 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ |
| 73 |
| OLD | NEW |