| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef SkBBoxRecord_DEFINED | 9 #ifndef SkBBoxRecord_DEFINED |
| 10 #define SkBBoxRecord_DEFINED | 10 #define SkBBoxRecord_DEFINED |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual ~SkBBoxRecord() { } | 24 virtual ~SkBBoxRecord() { } |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * This is called each time we get a bounding box, it will be axis-aligned, | 27 * This is called each time we get a bounding box, it will be axis-aligned, |
| 28 * in device coordinates, and expanded to include stroking, shadows, etc. | 28 * in device coordinates, and expanded to include stroking, shadows, etc. |
| 29 */ | 29 */ |
| 30 virtual void handleBBox(const SkRect& bbox) = 0; | 30 virtual void handleBBox(const SkRect& bbox) = 0; |
| 31 | 31 |
| 32 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; | 32 virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; |
| 33 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI
DE; | 33 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRI
DE; |
| 34 virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE; |
| 35 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE; |
| 34 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], | 36 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], |
| 35 const SkPaint& paint) SK_OVERRIDE; | 37 const SkPaint& paint) SK_OVERRIDE; |
| 36 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | 38 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; |
| 37 virtual void clear(SkColor) SK_OVERRIDE; | 39 virtual void clear(SkColor) SK_OVERRIDE; |
| 38 virtual void drawText(const void* text, size_t byteLength, SkScalar x, SkSca
lar y, | 40 virtual void drawText(const void* text, size_t byteLength, SkScalar x, SkSca
lar y, |
| 39 const SkPaint& paint) SK_OVERRIDE; | 41 const SkPaint& paint) SK_OVERRIDE; |
| 40 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, | 42 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, |
| 41 const SkPaint* paint = NULL) SK_OVERRIDE; | 43 const SkPaint* paint = NULL) SK_OVERRIDE; |
| 42 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, | 44 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, |
| 43 const SkRect& dst, const SkPaint* paint, | 45 const SkRect& dst, const SkPaint* paint, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 56 virtual void drawTextOnPath(const void* text, size_t byteLength, | 58 virtual void drawTextOnPath(const void* text, size_t byteLength, |
| 57 const SkPath& path, const SkMatrix* matrix, | 59 const SkPath& path, const SkMatrix* matrix, |
| 58 const SkPaint& paint) SK_OVERRIDE; | 60 const SkPaint& paint) SK_OVERRIDE; |
| 59 virtual void drawVertices(VertexMode mode, int vertexCount, | 61 virtual void drawVertices(VertexMode mode, int vertexCount, |
| 60 const SkPoint vertices[], const SkPoint texs[], | 62 const SkPoint vertices[], const SkPoint texs[], |
| 61 const SkColor colors[], SkXfermode* xfer, | 63 const SkColor colors[], SkXfermode* xfer, |
| 62 const uint16_t indices[], int indexCount, | 64 const uint16_t indices[], int indexCount, |
| 63 const SkPaint& paint) SK_OVERRIDE; | 65 const SkPaint& paint) SK_OVERRIDE; |
| 64 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; | 66 virtual void drawPicture(SkPicture& picture) SK_OVERRIDE; |
| 65 | 67 |
| 66 protected: | |
| 67 virtual void onDrawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRID
E; | |
| 68 virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRID
E; | |
| 69 | |
| 70 private: | 68 private: |
| 71 /** | 69 /** |
| 72 * Takes a bounding box in current canvas view space, accounts for stroking
and effects, and | 70 * Takes a bounding box in current canvas view space, accounts for stroking
and effects, and |
| 73 * computes an axis-aligned bounding box in device coordinates, then passes
it to handleBBox() | 71 * computes an axis-aligned bounding box in device coordinates, then passes
it to handleBBox() |
| 74 * returns false if the draw is completely clipped out, and may safely be ig
nored. | 72 * returns false if the draw is completely clipped out, and may safely be ig
nored. |
| 75 **/ | 73 **/ |
| 76 bool transformBounds(const SkRect& bounds, const SkPaint* paint); | 74 bool transformBounds(const SkRect& bounds, const SkPaint* paint); |
| 77 | 75 |
| 78 typedef SkPictureRecord INHERITED; | 76 typedef SkPictureRecord INHERITED; |
| 79 }; | 77 }; |
| 80 | 78 |
| 81 #endif | 79 #endif |
| OLD | NEW |