зеркало из https://github.com/mozilla/gecko-dev.git
Bug 984845 - BrowserElementParent.getScreenshot should return more accurate screenshots. r=fabrice
This commit is contained in:
Родитель
93246f1384
Коммит
7ebe220b92
|
@ -831,10 +831,16 @@ BrowserElementChild.prototype = {
|
|||
canvas.width = canvasWidth;
|
||||
canvas.height = canvasHeight;
|
||||
|
||||
var ctx = canvas.getContext("2d", { willReadFrequently: true });
|
||||
let ctx = canvas.getContext("2d", { willReadFrequently: true });
|
||||
ctx.scale(scale * devicePixelRatio, scale * devicePixelRatio);
|
||||
|
||||
let flags = ctx.DRAWWINDOW_DRAW_VIEW |
|
||||
ctx.DRAWWINDOW_USE_WIDGET_LAYERS |
|
||||
ctx.DRAWWINDOW_DO_NOT_FLUSH |
|
||||
ctx.DRAWWINDOW_ASYNC_DECODE_IMAGES;
|
||||
ctx.drawWindow(content, 0, 0, content.innerWidth, content.innerHeight,
|
||||
transparent ? "rgba(255,255,255,0)" : "rgb(255,255,255)");
|
||||
transparent ? "rgba(255,255,255,0)" : "rgb(255,255,255)",
|
||||
flags);
|
||||
|
||||
// Take a JPEG screenshot by default instead of PNG with alpha channel.
|
||||
// This requires us to unpremultiply the alpha channel, which
|
||||
|
|
Загрузка…
Ссылка в новой задаче