summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 22:55:51 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 22:55:51 +0000
commit081a4fcc74cdf6365793e798cf4902114c502fec (patch)
tree9bbe7b5fdd5911957e43f6d456622fe287e958b4 /skia/ext
parent193c1d5f7eefb9a58cea348fc2fc7370ccbf89c9 (diff)
downloadchromium_src-081a4fcc74cdf6365793e798cf4902114c502fec.zip
chromium_src-081a4fcc74cdf6365793e798cf4902114c502fec.tar.gz
chromium_src-081a4fcc74cdf6365793e798cf4902114c502fec.tar.bz2
Implement gdk_skia_draw_segments. Initial implementation does not support
setting the line width or the GDK_LINE_DOUBLE_DASH style. Review URL: http://codereview.chromium.org/19521 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8992 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext')
-rw-r--r--skia/ext/GdkSkia.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/skia/ext/GdkSkia.cc b/skia/ext/GdkSkia.cc
index 3ef247b..0897d8d 100644
--- a/skia/ext/GdkSkia.cc
+++ b/skia/ext/GdkSkia.cc
@@ -363,7 +363,25 @@ gdk_skia_draw_segments(GdkDrawable *drawable,
GdkGC *gc,
GdkSegment *segs,
gint nsegs) {
- NOTIMPLEMENTED;
+ GdkSkiaObject *skia = (GdkSkiaObject *) drawable;
+ GdkGCValues values;
+ SkPaint paint;
+ int nskip = 1;
+
+ gc_set_paint(gc, &paint);
+ gdk_gc_get_values(gc, &values);
+
+ // TODO(jhawkins): how to set line width in skia?
+
+ // GDK_LINE_ON_OFF_DASH only renders the even segments
+ if (values.line_style == GDK_LINE_ON_OFF_DASH)
+ nskip++;
+
+ for (int i = 0; i < nsegs; i += nskip) {
+ // TODO(jhawkins): GDK_LINE_DOUBLE_DASH
+ skia->canvas->drawLine(segs[i].x1, segs[i].y1,
+ segs[i].x2, segs[i].y2, paint);
+ }
}
static void