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

Unified Diff: gfx/canvas.h

Issue 3058012: Add support for Radial Gradient Brush and Bitmap Brush to gfx::Canvas.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gfx/canvas_direct2d.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas.h
===================================================================
--- gfx/canvas.h (revision 54142)
+++ gfx/canvas.h (working copy)
@@ -207,9 +207,9 @@
// |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 @@
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.
« no previous file with comments | « no previous file | gfx/canvas_direct2d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698