diff --git a/Readme.md b/Readme.md index 90e4841..536f6c2 100644 --- a/Readme.md +++ b/Readme.md @@ -146,6 +146,8 @@ Given one of the values below will alter pattern (gradients, images, etc) render - fast - good - best + - nearest + - bilinear ### CanvasRenderingContext2d#textDrawingMode diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 93bfdc1..4e9630f 100644 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -778,6 +778,10 @@ Context2d::SetPatternQuality(Local prop, Local val, const Accesso context->state->patternQuality = CAIRO_FILTER_GOOD; } else if (0 == strcmp("best", *quality)) { context->state->patternQuality = CAIRO_FILTER_BEST; + } else if (0 == strcmp("nearest", *quality)) { + context->state->patternQuality = CAIRO_FILTER_NEAREST; + } else if (0 == strcmp("bilinear", *quality)) { + context->state->patternQuality = CAIRO_FILTER_BILINEAR; } } @@ -793,6 +797,8 @@ Context2d::GetPatternQuality(Local prop, const AccessorInfo &info) { switch (context->state->patternQuality) { case CAIRO_FILTER_FAST: quality = "fast"; break; case CAIRO_FILTER_BEST: quality = "best"; break; + case CAIRO_FILTER_NEAREST: quality = "nearest"; break; + case CAIRO_FILTER_BILINEAR: quality = "bilinear"; break; default: quality = "good"; } return scope.Close(String::NewSymbol(quality));