Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: include/core/SkCanvas.h

Issue 831253002: Revert of Revert of move remaining virtual draw methods to onDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkImage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 18 matching lines...) Expand all
29 class SkPicture; 29 class SkPicture;
30 class SkRRect; 30 class SkRRect;
31 class SkSurface; 31 class SkSurface;
32 class SkSurface_Base; 32 class SkSurface_Base;
33 class SkTextBlob; 33 class SkTextBlob;
34 class GrContext; 34 class GrContext;
35 class GrRenderTarget; 35 class GrRenderTarget;
36 36
37 class SkCanvasState; 37 class SkCanvasState;
38 38
39 #ifdef SK_SUPPORT_LEGACY_CANVAS_VIRTUAL
40 #define SK_LEGACY_CANVAS_VIRTUAL virtual
41 #else
42 #define SK_LEGACY_CANVAS_VIRTUAL
43 #endif
44
39 /** \class SkCanvas 45 /** \class SkCanvas
40 46
41 A Canvas encapsulates all of the state about drawing into a device (bitmap). 47 A Canvas encapsulates all of the state about drawing into a device (bitmap).
42 This includes a reference to the device itself, and a stack of matrix/clip 48 This includes a reference to the device itself, and a stack of matrix/clip
43 values. For any given draw call (e.g. drawRect), the geometry of the object 49 values. For any given draw call (e.g. drawRect), the geometry of the object
44 being drawn is transformed by the concatenation of all the matrices in the 50 being drawn is transformed by the concatenation of all the matrices in the
45 stack. The transformed geometry is clipped by the intersection of all of 51 stack. The transformed geometry is clipped by the intersection of all of
46 the clips in the stack. 52 the clips in the stack.
47 53
48 While the Canvas holds the state of the drawing device, the state (style) 54 While the Canvas holds the state of the drawing device, the state (style)
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 * to optimize performance on subsequent draws. Thus, if you call this and t hen 607 * to optimize performance on subsequent draws. Thus, if you call this and t hen
602 * never draw to the canvas subsequently you may pay a perfomance penalty. 608 * never draw to the canvas subsequently you may pay a perfomance penalty.
603 */ 609 */
604 void discard() { this->onDiscard(); } 610 void discard() { this->onDiscard(); }
605 611
606 /** 612 /**
607 * Fill the entire canvas' bitmap (restricted to the current clip) with the 613 * Fill the entire canvas' bitmap (restricted to the current clip) with the
608 * specified paint. 614 * specified paint.
609 * @param paint The paint used to fill the canvas 615 * @param paint The paint used to fill the canvas
610 */ 616 */
611 virtual void drawPaint(const SkPaint& paint); 617 SK_LEGACY_CANVAS_VIRTUAL void drawPaint(const SkPaint& paint);
612 618
613 enum PointMode { 619 enum PointMode {
614 /** drawPoints draws each point separately */ 620 /** drawPoints draws each point separately */
615 kPoints_PointMode, 621 kPoints_PointMode,
616 /** drawPoints draws each pair of points as a line segment */ 622 /** drawPoints draws each pair of points as a line segment */
617 kLines_PointMode, 623 kLines_PointMode,
618 /** drawPoints draws the array of points as a polygon */ 624 /** drawPoints draws the array of points as a polygon */
619 kPolygon_PointMode 625 kPolygon_PointMode
620 }; 626 };
621 627
(...skipping 11 matching lines...) Expand all
633 Note that, while similar, kLine and kPolygon modes draw slightly 639 Note that, while similar, kLine and kPolygon modes draw slightly
634 differently than the equivalent path built with a series of moveto, 640 differently than the equivalent path built with a series of moveto,
635 lineto calls, in that the path will draw all of its contours at once, 641 lineto calls, in that the path will draw all of its contours at once,
636 with no interactions if contours intersect each other (think XOR 642 with no interactions if contours intersect each other (think XOR
637 xfermode). drawPoints always draws each element one at a time. 643 xfermode). drawPoints always draws each element one at a time.
638 @param mode PointMode specifying how to draw the array of points. 644 @param mode PointMode specifying how to draw the array of points.
639 @param count The number of points in the array 645 @param count The number of points in the array
640 @param pts Array of points to draw 646 @param pts Array of points to draw
641 @param paint The paint used to draw the points 647 @param paint The paint used to draw the points
642 */ 648 */
643 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[], 649 SK_LEGACY_CANVAS_VIRTUAL void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
644 const SkPaint& paint); 650 const SkPaint& paint);
645 651
646 /** Helper method for drawing a single point. See drawPoints() for a more 652 /** Helper method for drawing a single point. See drawPoints() for a more
647 details. 653 details.
648 */ 654 */
649 void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint); 655 void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint);
650 656
651 /** Draws a single pixel in the specified color. 657 /** Draws a single pixel in the specified color.
652 @param x The X coordinate of which pixel to draw 658 @param x The X coordinate of which pixel to draw
653 @param y The Y coordiante of which pixel to draw 659 @param y The Y coordiante of which pixel to draw
654 @param color The color to draw 660 @param color The color to draw
(...skipping 10 matching lines...) Expand all
665 @param paint The paint used to draw the line 671 @param paint The paint used to draw the line
666 */ 672 */
667 void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, 673 void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1,
668 const SkPaint& paint); 674 const SkPaint& paint);
669 675
670 /** Draw the specified rectangle using the specified paint. The rectangle 676 /** Draw the specified rectangle using the specified paint. The rectangle
671 will be filled or stroked based on the Style in the paint. 677 will be filled or stroked based on the Style in the paint.
672 @param rect The rect to be drawn 678 @param rect The rect to be drawn
673 @param paint The paint used to draw the rect 679 @param paint The paint used to draw the rect
674 */ 680 */
675 virtual void drawRect(const SkRect& rect, const SkPaint& paint); 681 SK_LEGACY_CANVAS_VIRTUAL void drawRect(const SkRect& rect, const SkPaint& pa int);
676 682
677 /** Draw the specified rectangle using the specified paint. The rectangle 683 /** Draw the specified rectangle using the specified paint. The rectangle
678 will be filled or framed based on the Style in the paint. 684 will be filled or framed based on the Style in the paint.
679 @param rect The rect to be drawn 685 @param rect The rect to be drawn
680 @param paint The paint used to draw the rect 686 @param paint The paint used to draw the rect
681 */ 687 */
682 void drawIRect(const SkIRect& rect, const SkPaint& paint) { 688 void drawIRect(const SkIRect& rect, const SkPaint& paint) {
683 SkRect r; 689 SkRect r;
684 r.set(rect); // promotes the ints to scalars 690 r.set(rect); // promotes the ints to scalars
685 this->drawRect(r, paint); 691 this->drawRect(r, paint);
686 } 692 }
687 693
688 /** Draw the specified rectangle using the specified paint. The rectangle 694 /** Draw the specified rectangle using the specified paint. The rectangle
689 will be filled or framed based on the Style in the paint. 695 will be filled or framed based on the Style in the paint.
690 @param left The left side of the rectangle to be drawn 696 @param left The left side of the rectangle to be drawn
691 @param top The top side of the rectangle to be drawn 697 @param top The top side of the rectangle to be drawn
692 @param right The right side of the rectangle to be drawn 698 @param right The right side of the rectangle to be drawn
693 @param bottom The bottom side of the rectangle to be drawn 699 @param bottom The bottom side of the rectangle to be drawn
694 @param paint The paint used to draw the rect 700 @param paint The paint used to draw the rect
695 */ 701 */
696 void drawRectCoords(SkScalar left, SkScalar top, SkScalar right, 702 void drawRectCoords(SkScalar left, SkScalar top, SkScalar right,
697 SkScalar bottom, const SkPaint& paint); 703 SkScalar bottom, const SkPaint& paint);
698 704
699 /** Draw the specified oval using the specified paint. The oval will be 705 /** Draw the specified oval using the specified paint. The oval will be
700 filled or framed based on the Style in the paint. 706 filled or framed based on the Style in the paint.
701 @param oval The rectangle bounds of the oval to be drawn 707 @param oval The rectangle bounds of the oval to be drawn
702 @param paint The paint used to draw the oval 708 @param paint The paint used to draw the oval
703 */ 709 */
704 virtual void drawOval(const SkRect& oval, const SkPaint&); 710 SK_LEGACY_CANVAS_VIRTUAL void drawOval(const SkRect& oval, const SkPaint&);
705 711
706 /** 712 /**
707 * Draw the specified RRect using the specified paint The rrect will be fil led or stroked 713 * Draw the specified RRect using the specified paint The rrect will be fil led or stroked
708 * based on the Style in the paint. 714 * based on the Style in the paint.
709 * 715 *
710 * @param rrect The round-rect to draw 716 * @param rrect The round-rect to draw
711 * @param paint The paint used to draw the round-rect 717 * @param paint The paint used to draw the round-rect
712 */ 718 */
713 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint); 719 SK_LEGACY_CANVAS_VIRTUAL void drawRRect(const SkRRect& rrect, const SkPaint& paint);
714 720
715 /** 721 /**
716 * Draw the annulus formed by the outer and inner rrects. The results 722 * Draw the annulus formed by the outer and inner rrects. The results
717 * are undefined if the outer does not contain the inner. 723 * are undefined if the outer does not contain the inner.
718 */ 724 */
719 void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint&); 725 void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint&);
720 726
721 /** Draw the specified circle using the specified paint. If radius is <= 0, 727 /** Draw the specified circle using the specified paint. If radius is <= 0,
722 then nothing will be drawn. The circle will be filled 728 then nothing will be drawn. The circle will be filled
723 or framed based on the Style in the paint. 729 or framed based on the Style in the paint.
(...skipping 27 matching lines...) Expand all
751 @param paint The paint used to draw the roundRect 757 @param paint The paint used to draw the roundRect
752 */ 758 */
753 void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, 759 void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry,
754 const SkPaint& paint); 760 const SkPaint& paint);
755 761
756 /** Draw the specified path using the specified paint. The path will be 762 /** Draw the specified path using the specified paint. The path will be
757 filled or framed based on the Style in the paint. 763 filled or framed based on the Style in the paint.
758 @param path The path to be drawn 764 @param path The path to be drawn
759 @param paint The paint used to draw the path 765 @param paint The paint used to draw the path
760 */ 766 */
761 virtual void drawPath(const SkPath& path, const SkPaint& paint); 767 SK_LEGACY_CANVAS_VIRTUAL void drawPath(const SkPath& path, const SkPaint& pa int);
762 768
763 /** Draw the specified image, with its top/left corner at (x,y), using the 769 /** Draw the specified image, with its top/left corner at (x,y), using the
764 specified paint, transformed by the current matrix. 770 specified paint, transformed by the current matrix.
765 771
766 @param image The image to be drawn 772 @param image The image to be drawn
767 @param left The position of the left side of the image being drawn 773 @param left The position of the left side of the image being drawn
768 @param top The position of the top side of the image being drawn 774 @param top The position of the top side of the image being drawn
769 @param paint The paint used to draw the image, or NULL 775 @param paint The paint used to draw the image, or NULL
770 */ 776 */
771 virtual void drawImage(const SkImage* image, SkScalar left, SkScalar top, 777 SK_LEGACY_CANVAS_VIRTUAL void drawImage(const SkImage* image, SkScalar left, SkScalar top,
772 const SkPaint* paint = NULL); 778 const SkPaint* paint = NULL);
773 /** Draw the specified image, with the specified matrix applied (before the 779 /** Draw the specified image, with the specified matrix applied (before the
774 canvas' matrix is applied). 780 canvas' matrix is applied).
775 781
776 @param image The image to be drawn 782 @param image The image to be drawn
777 @param src Optional: specify the subset of the image to be drawn 783 @param src Optional: specify the subset of the image to be drawn
778 @param dst The destination rectangle where the scaled/translated 784 @param dst The destination rectangle where the scaled/translated
779 image will be drawn 785 image will be drawn
780 @param paint The paint used to draw the image, or NULL 786 @param paint The paint used to draw the image, or NULL
781 */ 787 */
782 virtual void drawImageRect(const SkImage* image, const SkRect* src, 788 SK_LEGACY_CANVAS_VIRTUAL void drawImageRect(const SkImage* image, const SkRe ct* src,
783 const SkRect& dst, 789 const SkRect& dst,
784 const SkPaint* paint = NULL); 790 const SkPaint* paint = NULL);
785 791
786 /** Draw the specified bitmap, with its top/left corner at (x,y), using the 792 /** Draw the specified bitmap, with its top/left corner at (x,y), using the
787 specified paint, transformed by the current matrix. Note: if the paint 793 specified paint, transformed by the current matrix. Note: if the paint
788 contains a maskfilter that generates a mask which extends beyond the 794 contains a maskfilter that generates a mask which extends beyond the
789 bitmap's original width/height, then the bitmap will be drawn as if it 795 bitmap's original width/height, then the bitmap will be drawn as if it
790 were in a Shader with CLAMP mode. Thus the color outside of the original 796 were in a Shader with CLAMP mode. Thus the color outside of the original
791 width/height will be the edge color replicated. 797 width/height will be the edge color replicated.
792 798
793 If a shader is present on the paint it will be ignored, except in the 799 If a shader is present on the paint it will be ignored, except in the
794 case where the bitmap is kAlpha_8_SkColorType. In that case, the color i s 800 case where the bitmap is kAlpha_8_SkColorType. In that case, the color i s
795 generated by the shader. 801 generated by the shader.
796 802
797 @param bitmap The bitmap to be drawn 803 @param bitmap The bitmap to be drawn
798 @param left The position of the left side of the bitmap being drawn 804 @param left The position of the left side of the bitmap being drawn
799 @param top The position of the top side of the bitmap being drawn 805 @param top The position of the top side of the bitmap being drawn
800 @param paint The paint used to draw the bitmap, or NULL 806 @param paint The paint used to draw the bitmap, or NULL
801 */ 807 */
802 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, 808 SK_LEGACY_CANVAS_VIRTUAL void drawBitmap(const SkBitmap& bitmap, SkScalar le ft, SkScalar top,
803 const SkPaint* paint = NULL); 809 const SkPaint* paint = NULL);
804 810
805 enum DrawBitmapRectFlags { 811 enum DrawBitmapRectFlags {
806 kNone_DrawBitmapRectFlag = 0x0, 812 kNone_DrawBitmapRectFlag = 0x0,
807 /** 813 /**
808 * When filtering is enabled, allow the color samples outside of 814 * When filtering is enabled, allow the color samples outside of
809 * the src rect (but still in the src bitmap) to bleed into the 815 * the src rect (but still in the src bitmap) to bleed into the
810 * drawn portion 816 * drawn portion
811 */ 817 */
812 kBleed_DrawBitmapRectFlag = 0x1, 818 kBleed_DrawBitmapRectFlag = 0x1,
813 }; 819 };
814 820
815 /** Draw the specified bitmap, with the specified matrix applied (before the 821 /** Draw the specified bitmap, with the specified matrix applied (before the
816 canvas' matrix is applied). 822 canvas' matrix is applied).
817 @param bitmap The bitmap to be drawn 823 @param bitmap The bitmap to be drawn
818 @param src Optional: specify the subset of the bitmap to be drawn 824 @param src Optional: specify the subset of the bitmap to be drawn
819 @param dst The destination rectangle where the scaled/translated 825 @param dst The destination rectangle where the scaled/translated
820 image will be drawn 826 image will be drawn
821 @param paint The paint used to draw the bitmap, or NULL 827 @param paint The paint used to draw the bitmap, or NULL
822 */ 828 */
823 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, 829 SK_LEGACY_CANVAS_VIRTUAL void drawBitmapRectToRect(const SkBitmap& bitmap, c onst SkRect* src,
824 const SkRect& dst, 830 const SkRect& dst,
825 const SkPaint* paint = NULL, 831 const SkPaint* paint = NULL,
826 DrawBitmapRectFlags flags = kNone_DrawBitm apRectFlag); 832 DrawBitmapRectFlags flags = kNone_DrawBitm apRectFlag);
827 833
828 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, 834 void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst,
829 const SkPaint* paint = NULL) { 835 const SkPaint* paint = NULL) {
830 this->drawBitmapRectToRect(bitmap, NULL, dst, paint, kNone_DrawBitmapRec tFlag); 836 this->drawBitmapRectToRect(bitmap, NULL, dst, paint, kNone_DrawBitmapRec tFlag);
831 } 837 }
832 838
833 void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* isrc, 839 void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* isrc,
(...skipping 15 matching lines...) Expand all
849 * bitmap is the "center", then the center-rect should be [2, 2, 3, 3]. 855 * bitmap is the "center", then the center-rect should be [2, 2, 3, 3].
850 * 856 *
851 * If the dst is >= the bitmap size, then... 857 * If the dst is >= the bitmap size, then...
852 * - The 4 corners are not stretched at all. 858 * - The 4 corners are not stretched at all.
853 * - The sides are stretched in only one axis. 859 * - The sides are stretched in only one axis.
854 * - The center is stretched in both axes. 860 * - The center is stretched in both axes.
855 * Else, for each axis where dst < bitmap, 861 * Else, for each axis where dst < bitmap,
856 * - The corners shrink proportionally 862 * - The corners shrink proportionally
857 * - The sides (along the shrink axis) and center are not drawn 863 * - The sides (along the shrink axis) and center are not drawn
858 */ 864 */
859 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 865 SK_LEGACY_CANVAS_VIRTUAL void drawBitmapNine(const SkBitmap& bitmap, const S kIRect& center,
860 const SkRect& dst, const SkPaint* paint = NULL); 866 const SkRect& dst, const SkPaint* paint = NULL);
861 867
862 /** Draw the specified bitmap, with its top/left corner at (x,y), 868 /** Draw the specified bitmap, with its top/left corner at (x,y),
863 NOT transformed by the current matrix. Note: if the paint 869 NOT transformed by the current matrix. Note: if the paint
864 contains a maskfilter that generates a mask which extends beyond the 870 contains a maskfilter that generates a mask which extends beyond the
865 bitmap's original width/height, then the bitmap will be drawn as if it 871 bitmap's original width/height, then the bitmap will be drawn as if it
866 were in a Shader with CLAMP mode. Thus the color outside of the original 872 were in a Shader with CLAMP mode. Thus the color outside of the original
867 width/height will be the edge color replicated. 873 width/height will be the edge color replicated.
868 @param bitmap The bitmap to be drawn 874 @param bitmap The bitmap to be drawn
869 @param left The position of the left side of the bitmap being drawn 875 @param left The position of the left side of the bitmap being drawn
870 @param top The position of the top side of the bitmap being drawn 876 @param top The position of the top side of the bitmap being drawn
871 @param paint The paint used to draw the bitmap, or NULL 877 @param paint The paint used to draw the bitmap, or NULL
872 */ 878 */
873 virtual void drawSprite(const SkBitmap& bitmap, int left, int top, 879 SK_LEGACY_CANVAS_VIRTUAL void drawSprite(const SkBitmap& bitmap, int left, i nt top,
874 const SkPaint* paint = NULL); 880 const SkPaint* paint = NULL);
875 881
876 /** Draw the text, with origin at (x,y), using the specified paint. 882 /** Draw the text, with origin at (x,y), using the specified paint.
877 The origin is interpreted based on the Align setting in the paint. 883 The origin is interpreted based on the Align setting in the paint.
878 @param text The text to be drawn 884 @param text The text to be drawn
879 @param byteLength The number of bytes to read from the text parameter 885 @param byteLength The number of bytes to read from the text parameter
880 @param x The x-coordinate of the origin of the text being drawn 886 @param x The x-coordinate of the origin of the text being drawn
881 @param y The y-coordinate of the origin of the text being drawn 887 @param y The y-coordinate of the origin of the text being drawn
882 @param paint The paint used for the text (e.g. color, size, style) 888 @param paint The paint used for the text (e.g. color, size, style)
883 */ 889 */
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 vertex, to be interpolated across the triangle. 992 vertex, to be interpolated across the triangle.
987 @param xmode Used if both texs and colors are present. In this 993 @param xmode Used if both texs and colors are present. In this
988 case the colors are combined with the texture using mode, 994 case the colors are combined with the texture using mode,
989 before being drawn using the paint. If mode is null, then 995 before being drawn using the paint. If mode is null, then
990 kModulate_Mode is used. 996 kModulate_Mode is used.
991 @param indices If not null, array of indices to reference into the 997 @param indices If not null, array of indices to reference into the
992 vertex (texs, colors) array. 998 vertex (texs, colors) array.
993 @param indexCount number of entries in the indices array (if not null) 999 @param indexCount number of entries in the indices array (if not null)
994 @param paint Specifies the shader/texture if present. 1000 @param paint Specifies the shader/texture if present.
995 */ 1001 */
996 virtual void drawVertices(VertexMode vmode, int vertexCount, 1002 SK_LEGACY_CANVAS_VIRTUAL void drawVertices(VertexMode vmode, int vertexCount ,
997 const SkPoint vertices[], const SkPoint texs[], 1003 const SkPoint vertices[], const SkPoint texs[],
998 const SkColor colors[], SkXfermode* xmode, 1004 const SkColor colors[], SkXfermode* xmode,
999 const uint16_t indices[], int indexCount, 1005 const uint16_t indices[], int indexCount,
1000 const SkPaint& paint); 1006 const SkPaint& paint);
1001 1007
1002 /** 1008 /**
1003 Draw a cubic coons patch 1009 Draw a cubic coons patch
1004 1010
1005 @param cubic specifies the 4 bounding cubic bezier curves of a patch with c lockwise order 1011 @param cubic specifies the 4 bounding cubic bezier curves of a patch with c lockwise order
1006 starting at the top left corner. 1012 starting at the top left corner.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 const SkPaint& paint); 1196 const SkPaint& paint);
1191 1197
1192 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, 1198 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
1193 const SkPaint& paint); 1199 const SkPaint& paint);
1194 1200
1195 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], 1201 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
1196 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint); 1202 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint);
1197 1203
1198 virtual void onDrawDrawable(SkCanvasDrawable*); 1204 virtual void onDrawDrawable(SkCanvasDrawable*);
1199 1205
1206 virtual void onDrawPaint(const SkPaint&);
1207 virtual void onDrawRect(const SkRect&, const SkPaint&);
1208 virtual void onDrawOval(const SkRect&, const SkPaint&);
1209 virtual void onDrawRRect(const SkRRect&, const SkPaint&);
1210 virtual void onDrawPoints(PointMode, size_t count, const SkPoint pts[], cons t SkPaint&);
1211 virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint verti ces[],
1212 const SkPoint texs[], const SkColor colors[], Sk Xfermode*,
1213 const uint16_t indices[], int indexCount, const SkPaint&);
1214 virtual void onDrawPath(const SkPath&, const SkPaint&);
1215 virtual void onDrawImage(const SkImage*, SkScalar dx, SkScalar dy, const SkP aint*);
1216 virtual void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, c onst SkPaint*);
1217 virtual void onDrawBitmap(const SkBitmap&, SkScalar dx, SkScalar dy, const S kPaint*);
1218 virtual void onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint*,
1219 DrawBitmapRectFlags);
1220 virtual void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect& dst,
1221 const SkPaint*);
1222 virtual void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint* );
1223
1200 enum ClipEdgeStyle { 1224 enum ClipEdgeStyle {
1201 kHard_ClipEdgeStyle, 1225 kHard_ClipEdgeStyle,
1202 kSoft_ClipEdgeStyle 1226 kSoft_ClipEdgeStyle
1203 }; 1227 };
1204 1228
1205 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle); 1229 virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle);
1206 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle); 1230 virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle);
1207 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle); 1231 virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle);
1208 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op); 1232 virtual void onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op);
1209 1233
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 1506
1483 class SkCanvasClipVisitor { 1507 class SkCanvasClipVisitor {
1484 public: 1508 public:
1485 virtual ~SkCanvasClipVisitor(); 1509 virtual ~SkCanvasClipVisitor();
1486 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1510 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1487 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1511 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1488 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1512 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1489 }; 1513 };
1490 1514
1491 #endif 1515 #endif
OLDNEW
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698