From 5badfa1e64cca9febfff81e524cd31e7a79bc9d1 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 12 Nov 2010 10:09:35 -0800 Subject: [PATCH] Grab image surface data --- src/CanvasRenderingContext2d.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index ef7e9bb..56b2239 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -407,11 +407,9 @@ Context2d::DrawImage(const Arguments &args) { double dw = args[3]->IsNumber() ? args[3]->NumberValue() : img->width; double dh = args[4]->IsNumber() ? args[4]->NumberValue() : img->height; + // Draw + uint8_t *src = cairo_image_surface_get_data(img->surface()); cairo_t *ctx = context->context(); - cairo_save(ctx); - cairo_set_source_surface(ctx, img->surface(), dx, dy); - cairo_paint(ctx); - cairo_restore(ctx); return Undefined(); }