MCPcopy Create free account
hub / github.com/apache/cloudstack / copyImage

Method copyImage

systemvm/agent/noVNC/core/display.js:333–362  ·  view source on GitHub ↗
(oldX, oldY, newX, newY, w, h, fromQueue)

Source from the content-addressed store, hash-verified

331 }
332
333 copyImage(oldX, oldY, newX, newY, w, h, fromQueue) {
334 if (this._renderQ.length !== 0 && !fromQueue) {
335 this._renderQPush({
336 'type': 'copy',
337 'oldX': oldX,
338 'oldY': oldY,
339 'x': newX,
340 'y': newY,
341 'width': w,
342 'height': h,
343 });
344 } else {
345 // Due to this bug among others [1] we need to disable the image-smoothing to
346 // avoid getting a blur effect when copying data.
347 //
348 // 1. https://bugzilla.mozilla.org/show_bug.cgi?id=1194719
349 //
350 // We need to set these every time since all properties are reset
351 // when the size is changed
352 this._drawCtx.mozImageSmoothingEnabled = false;
353 this._drawCtx.webkitImageSmoothingEnabled = false;
354 this._drawCtx.msImageSmoothingEnabled = false;
355 this._drawCtx.imageSmoothingEnabled = false;
356
357 this._drawCtx.drawImage(this._backbuffer,
358 oldX, oldY, w, h,
359 newX, newY, w, h);
360 this._damage(newX, newY, w, h);
361 }
362 }
363
364 imageRect(x, y, width, height, mime, arr) {
365 /* The internal logic cannot handle empty images, so bail early */

Callers 2

_scanRenderQMethod · 0.95
decodeRectMethod · 0.80

Calls 3

_renderQPushMethod · 0.95
_damageMethod · 0.95
drawImageMethod · 0.80

Tested by

no test coverage detected