diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 18:17:04 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 18:17:04 +0000 |
commit | 2caf4d005cb3b86b61ae559f08f2493e19129e3f (patch) | |
tree | 95e9eb1d2ec77fc179f5fdc26573db1449a5afb4 /gfx/canvas.h | |
parent | 797794bd42c10ff1dfecc25f91ec32a17d991b15 (diff) | |
download | chromium_src-2caf4d005cb3b86b61ae559f08f2493e19129e3f.zip chromium_src-2caf4d005cb3b86b61ae559f08f2493e19129e3f.tar.gz chromium_src-2caf4d005cb3b86b61ae559f08f2493e19129e3f.tar.bz2 |
Add support for Radial Gradient Brush and Bitmap Brush to gfx::Canvas.
BUG=none
TEST=see unittest
Review URL: http://codereview.chromium.org/3058012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gfx/canvas.h')
-rw-r--r-- | gfx/canvas.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/gfx/canvas.h b/gfx/canvas.h index 52857a4..6b59c6d 100644 --- a/gfx/canvas.h +++ b/gfx/canvas.h @@ -207,9 +207,9 @@ class Canvas { // |positions| is a list of positions corresponding to the color stops, an // array of floats of increasing value ranging from 0.0f to 1.0f. // |position_count| is the size of the |colors| and |positions| arrays. - // |tile_mode| - // Returns an encapsulated platform shader object which the caller must - // delete. + // |tile_mode| specifies how the gradient brush repeats outside its natural + // bounds. + // Returns an encapsulated platform brush object which the caller must delete. virtual Brush* CreateLinearGradientBrush( const gfx::Point& start_point, const gfx::Point& end_point, @@ -218,6 +218,34 @@ class Canvas { size_t position_count, TileMode tile_mode) = 0; + // Creates a radial gradient brush. + // |center_point| is the center of the circle in the brush's coordinate space. + // |radius| is the radius of the circle. + // |colors| is a list of color stops. + // |positions| is a list of positions corresponding to the color stops, an + // array of floats of increasing value ranging from 0.0f to 1.0f. + // |position_count| is the size of the |colors| and |positions| arrays. + // |tile_mode| specifies how the gradient brush repeats outside its natural + // bounds. + // Returns an encapsulated platform brush object which the caller must delete. + virtual Brush* CreateRadialGradientBrush( + const gfx::Point& center_point, + float radius, + const SkColor colors[], + const float positions[], + size_t position_count, + TileMode tile_mode) = 0; + + // Creates a bitmap brush. + // |bitmap| is the bitmap to be used for the brush. + // |tile_mode_x,y| - specifies how the brush tiles the areas beyond those + // filled by its bitmap along each axis. + // Returns an encapsulated platform brush object which the caller must delete. + virtual Brush* CreateBitmapBrush( + const SkBitmap& bitmap, + TileMode tile_mode_x, + TileMode tile_mode_y) = 0; + // TODO(beng): remove this once we don't need to use any skia-specific methods // through this interface. // A quick and dirty way to obtain the underlying SkCanvas. |