Skip to content

Commit bbdacb3

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 08d66de commit bbdacb3

4 files changed

Lines changed: 259 additions & 244 deletions

File tree

‎src/CanvasPattern.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Pattern::createCairoPattern(double alpha, cairo_filter_t patternQuality) {
119119
if (canvas) {
120120
source_surface = canvas->ensureSurface();
121121
} else if (image) {
122-
source_surface = image->surface();
122+
source_surface = image->surface.surface();
123123
}
124124

125125
if (!source_surface) return nullptr;

‎src/CanvasRenderingContext2d.cc‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,9 @@ Context2d::DrawImage(const Napi::CallbackInfo& info) {
12651265
Napi::Error::New(env, "Image given has not completed loading").ThrowAsJavaScriptException();
12661266
return;
12671267
}
1268-
source_w = sw = img->width;
1269-
source_h = sh = img->height;
1270-
surface = img->surface();
1268+
source_w = sw = img->surface.width;
1269+
source_h = sh = img->surface.height;
1270+
surface = img->surface.surface();
12711271

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

0 commit comments

Comments
 (0)