(root, storage, opts)
| 9497 | * @param {Object} opts |
| 9498 | */ |
| 9499 | var Painter = function (root, storage, opts) { |
| 9500 | |
| 9501 | this.type = 'canvas'; |
| 9502 | |
| 9503 | // In node environment using node-canvas |
| 9504 | var singleCanvas = !root.nodeName // In node ? |
| 9505 | || root.nodeName.toUpperCase() === 'CANVAS'; |
| 9506 | |
| 9507 | this._opts = opts = extend({}, opts || {}); |
| 9508 | |
| 9509 | /** |
| 9510 | * @type {number} |
| 9511 | */ |
| 9512 | this.dpr = opts.devicePixelRatio || devicePixelRatio; |
| 9513 | /** |
| 9514 | * @type {boolean} |
| 9515 | * @private |
| 9516 | */ |
| 9517 | this._singleCanvas = singleCanvas; |
| 9518 | /** |
| 9519 | * 绘图容器 |
| 9520 | * @type {HTMLElement} |
| 9521 | */ |
| 9522 | this.root = root; |
| 9523 | |
| 9524 | var rootStyle = root.style; |
| 9525 | |
| 9526 | if (rootStyle) { |
| 9527 | rootStyle['-webkit-tap-highlight-color'] = 'transparent'; |
| 9528 | rootStyle['-webkit-user-select'] = |
| 9529 | rootStyle['user-select'] = |
| 9530 | rootStyle['-webkit-touch-callout'] = 'none'; |
| 9531 | |
| 9532 | root.innerHTML = ''; |
| 9533 | } |
| 9534 | |
| 9535 | /** |
| 9536 | * @type {module:zrender/Storage} |
| 9537 | */ |
| 9538 | this.storage = storage; |
| 9539 | |
| 9540 | /** |
| 9541 | * @type {Array.<number>} |
| 9542 | * @private |
| 9543 | */ |
| 9544 | var zlevelList = this._zlevelList = []; |
| 9545 | |
| 9546 | /** |
| 9547 | * @type {Object.<string, module:zrender/Layer>} |
| 9548 | * @private |
| 9549 | */ |
| 9550 | var layers = this._layers = {}; |
| 9551 | |
| 9552 | /** |
| 9553 | * @type {Object.<string, Object>} |
| 9554 | * @private |
| 9555 | */ |
| 9556 | this._layerConfig = {}; |
nothing calls this directly
no test coverage detected