summaryrefslogtreecommitdiffstats
path: root/src/display/drawing-item.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-12-12 21:53:22 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-12-12 21:53:22 +0000
commitcfecf64d6adad14f73f9c169b181ec59bf54c8f3 (patch)
treed976a56df96484ab7d4efe1565c372218db6fdae /src/display/drawing-item.cpp
parentMoving tolerance (diff)
parentName a few more widgets. (diff)
downloadinkscape-cfecf64d6adad14f73f9c169b181ec59bf54c8f3.tar.gz
inkscape-cfecf64d6adad14f73f9c169b181ec59bf54c8f3.zip
Merge branch 'master' into powerpencilII
Diffstat (limited to 'src/display/drawing-item.cpp')
-rw-r--r--src/display/drawing-item.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp
index 43db4f259..cc4673bc8 100644
--- a/src/display/drawing-item.cpp
+++ b/src/display/drawing-item.cpp
@@ -667,7 +667,7 @@ struct MaskLuminanceToAlpha {
/**
* Rasterize items.
- * This method submits the drawing opeartions required to draw this item
+ * This method submits the drawing operations required to draw this item
* to the supplied DrawingContext, restricting drawing the specified area.
*
* This method does some common tasks and calls the item-specific rendering
@@ -699,6 +699,9 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
Geom::OptIntRect carea = Geom::intersect(area, _drawbox);
if (!carea) return RENDER_OK;
+ // Device scale for HiDPI screens (typically 1 or 2)
+ int device_scale = dc.surface()->device_scale();
+
switch(_antialias){
case 0:
cairo_set_antialias(dc.raw(), CAIRO_ANTIALIAS_NONE);
@@ -731,7 +734,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
Geom::OptIntRect cl = _drawing.cacheLimit();
cl.intersectWith(_drawbox);
if (cl) {
- _cache = new DrawingCache(*cl);
+ _cache = new DrawingCache(*cl, device_scale);
}
}
} else {
@@ -785,7 +788,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
iarea.intersectWith(_drawbox);
}
- DrawingSurface intermediate(*iarea);
+ DrawingSurface intermediate(*iarea, device_scale);
DrawingContext ict(intermediate);
unsigned render_result = RENDER_OK;
@@ -832,7 +835,7 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
if (bg_root->_background_new) break;
}
if (bg_root) {
- DrawingSurface bg(*iarea);
+ DrawingSurface bg(*iarea, device_scale);
DrawingContext bgdc(bg);
bg_root->render(bgdc, *iarea, flags | RENDER_FILTER_BACKGROUND, this);
_filter->render(this, ict, &bgdc);