UNPKG

@visactor/vrender-core

Version:
53 lines (47 loc) 2.37 kB
"use strict"; var __decorate = this && this.__decorate || function(decorators, target, key, desc) { var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r); return c > 3 && r && Object.defineProperty(target, key, r), r; }, __metadata = this && this.__metadata || function(k, v) { if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.EmptyLayerHandlerContribution = void 0; const inversify_lite_1 = require("../../../common/inversify-lite"), application_1 = require("../../../application"); let EmptyLayerHandlerContribution = class { constructor() { this.offscreen = !1, this.type = "virtual", this.global = application_1.application.global; } setDpr(dpr) {} init(layer, window, params) { if (this.layer = layer, this.window = window, params.main) throw new Error("virtual layer不能作为main layer"); this.main = !1, this.canvas = null, this.context = null; } resize(w, h) {} resizeView(w, h) {} render(group, params, userParams) { this.mainHandler.render(group, params, Object.assign(Object.assign({}, userParams), { clear: !1 })); } merge(layerHandlers) {} prepare(dirtyBounds, params) {} drawTo(target, group, params) { var _a; const context = target.getContext(); params.renderService.render(group, Object.assign(Object.assign({ context: context }, params), { clear: params.clear ? null !== (_a = params.background) && void 0 !== _a ? _a : "#fff" : void 0 })); } getContext() { return null; } release() {} }; EmptyLayerHandlerContribution = __decorate([ (0, inversify_lite_1.injectable)(), __metadata("design:paramtypes", []) ], EmptyLayerHandlerContribution), exports.EmptyLayerHandlerContribution = EmptyLayerHandlerContribution; //# sourceMappingURL=empty-contribution.js.map