Skip to content

Commit f993cdc

Browse files
committed
split Image into ImageSurface
ImageSurface can now be used by the SVG engine to render images from PNG/GIF/JPEG/BMP data.
1 parent 9c158bb commit f993cdc

4 files changed

Lines changed: 259 additions & 241 deletions

File tree

‎src/CanvasPattern.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Pattern::Pattern(const Napi::CallbackInfo& info) : ObjectWrap<Pattern>(info), en
5050
Napi::Error::New(env, "Image given has not completed loading").ThrowAsJavaScriptException();
5151
return;
5252
}
53-
surface = img->surface();
53+
surface = img->surface.surface();
5454

5555
// Canvas
5656
} else if (obj.InstanceOf(data->CanvasCtor.Value()).UnwrapOr(false)) {

‎src/CanvasRenderingContext2d.cc‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,9 +1302,9 @@ Context2d::DrawImage(const Napi::CallbackInfo& info) {
13021302
Napi::Error::New(env, "Image given has not completed loading").ThrowAsJavaScriptException();
13031303
return;
13041304
}
1305-
source_w = sw = img->width;
1306-
source_h = sh = img->height;
1307-
surface = img->surface();
1305+
source_w = sw = img->surface.width;
1306+
source_h = sh = img->surface.height;
1307+
surface = img->surface.surface();
13081308

13091309
// Canvas
13101310
} else if (obj.InstanceOf(env.GetInstanceData<InstanceData>()->CanvasCtor.Value()).UnwrapOr(false)) {

0 commit comments

Comments
 (0)