From 721c5a5e5a1dffa5392250680d16ba92dd4e3aa0 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 15 Nov 2010 18:20:29 -0800 Subject: [PATCH] Marking dirty rect --- src/CanvasRenderingContext2d.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 2cb3489..964c229 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -414,11 +414,14 @@ Context2d::PutImageData(const Arguments &args) { , rows , cols; + // TODO: spec boundaries switch (args.Length()) { + // imageData, dx, dy case 3: cols = arr->width(); rows = arr->height(); break; + // imageData, dx, dy, sx, sy, dw, dh case 7: { sx = args[3]->NumberValue(); sy = args[4]->NumberValue(); @@ -426,7 +429,8 @@ Context2d::PutImageData(const Arguments &args) { sh = args[6]->NumberValue(); cols = sw; rows = sh; - //dx += sx + sw; + dx += sx; + dy += sy; } break; default: @@ -455,7 +459,12 @@ Context2d::PutImageData(const Arguments &args) { srcRows += srcStride; } - // TODO: cairo_surface_mark_dirty_rectangle + cairo_surface_mark_dirty_rectangle( + context->canvas()->surface() + , dx + , dy + , cols + , rows); return Undefined(); }