OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkCanvas_DEFINED | 8 #ifndef SkCanvas_DEFINED |
9 #define SkCanvas_DEFINED | 9 #define SkCanvas_DEFINED |
10 | 10 |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 | 661 |
662 /** | 662 /** |
663 * Draw the specified RRect using the specified paint The rrect will be fil
led or stroked | 663 * Draw the specified RRect using the specified paint The rrect will be fil
led or stroked |
664 * based on the Style in the paint. | 664 * based on the Style in the paint. |
665 * | 665 * |
666 * @param rrect The round-rect to draw | 666 * @param rrect The round-rect to draw |
667 * @param paint The paint used to draw the round-rect | 667 * @param paint The paint used to draw the round-rect |
668 */ | 668 */ |
669 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint); | 669 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint); |
670 | 670 |
| 671 /** |
| 672 * Draw the annulus formed by the outer and inner rrects. The results |
| 673 * are undefined if the outer does not contain the inner. |
| 674 */ |
| 675 void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint&); |
| 676 |
671 /** Draw the specified circle using the specified paint. If radius is <= 0, | 677 /** Draw the specified circle using the specified paint. If radius is <= 0, |
672 then nothing will be drawn. The circle will be filled | 678 then nothing will be drawn. The circle will be filled |
673 or framed based on the Style in the paint. | 679 or framed based on the Style in the paint. |
674 @param cx The x-coordinate of the center of the cirle to be drawn | 680 @param cx The x-coordinate of the center of the cirle to be drawn |
675 @param cy The y-coordinate of the center of the cirle to be drawn | 681 @param cy The y-coordinate of the center of the cirle to be drawn |
676 @param radius The radius of the cirle to be drawn | 682 @param radius The radius of the cirle to be drawn |
677 @param paint The paint used to draw the circle | 683 @param paint The paint used to draw the circle |
678 */ | 684 */ |
679 void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, | 685 void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, |
680 const SkPaint& paint); | 686 const SkPaint& paint); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 bool fDone; | 1060 bool fDone; |
1055 }; | 1061 }; |
1056 | 1062 |
1057 protected: | 1063 protected: |
1058 // default impl defers to getDevice()->newSurface(info) | 1064 // default impl defers to getDevice()->newSurface(info) |
1059 virtual SkSurface* onNewSurface(const SkImageInfo&); | 1065 virtual SkSurface* onNewSurface(const SkImageInfo&); |
1060 | 1066 |
1061 // default impl defers to its device | 1067 // default impl defers to its device |
1062 virtual const void* onPeekPixels(SkImageInfo*, size_t* rowBytes); | 1068 virtual const void* onPeekPixels(SkImageInfo*, size_t* rowBytes); |
1063 | 1069 |
| 1070 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&); |
| 1071 |
1064 // Returns the canvas to be used by DrawIter. Default implementation | 1072 // Returns the canvas to be used by DrawIter. Default implementation |
1065 // returns this. Subclasses that encapsulate an indirect canvas may | 1073 // returns this. Subclasses that encapsulate an indirect canvas may |
1066 // need to overload this method. The impl must keep track of this, as it | 1074 // need to overload this method. The impl must keep track of this, as it |
1067 // is not released or deleted by the caller. | 1075 // is not released or deleted by the caller. |
1068 virtual SkCanvas* canvasForDrawIter(); | 1076 virtual SkCanvas* canvasForDrawIter(); |
1069 | 1077 |
1070 // Clip rectangle bounds. Called internally by saveLayer. | 1078 // Clip rectangle bounds. Called internally by saveLayer. |
1071 // returns false if the entire rectangle is entirely clipped out | 1079 // returns false if the entire rectangle is entirely clipped out |
1072 // If non-NULL, The imageFilter parameter will be used to expand the clip | 1080 // If non-NULL, The imageFilter parameter will be used to expand the clip |
1073 // and offscreen bounds for any margin required by the filter DAG. | 1081 // and offscreen bounds for any margin required by the filter DAG. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 bool asROBitmap(SkBitmap*) const; | 1291 bool asROBitmap(SkBitmap*) const; |
1284 | 1292 |
1285 private: | 1293 private: |
1286 SkBitmap fBitmap; // used if peekPixels() fails | 1294 SkBitmap fBitmap; // used if peekPixels() fails |
1287 const void* fAddr; // NULL on failure | 1295 const void* fAddr; // NULL on failure |
1288 SkImageInfo fInfo; | 1296 SkImageInfo fInfo; |
1289 size_t fRowBytes; | 1297 size_t fRowBytes; |
1290 }; | 1298 }; |
1291 | 1299 |
1292 #endif | 1300 #endif |
OLD | NEW |