// Class: openfl._internal.renderer.dom.DOMBlendModeManager

var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this

$global.Object.defineProperty(exports, "__esModule", {value: true});

var __map_reserved = {};

// Imports

var $hxClasses = require("./../../../../hxClasses_stub").default;
var $import = require("./../../../../import_stub").default;
var $extend = require("./../../../../extend_stub").default;
function openfl__$internal_renderer_AbstractBlendModeManager() {return require("./../../../../openfl/_internal/renderer/AbstractBlendModeManager");}

// Constructor

var DOMBlendModeManager = function(renderSession) {
	(openfl__$internal_renderer_AbstractBlendModeManager().default).call(this);
	this.renderSession = renderSession;
}

// Meta

DOMBlendModeManager.__name__ = ["openfl","_internal","renderer","dom","DOMBlendModeManager"];
DOMBlendModeManager.__super__ = (openfl__$internal_renderer_AbstractBlendModeManager().default);
DOMBlendModeManager.prototype = $extend((openfl__$internal_renderer_AbstractBlendModeManager().default).prototype, {
	setBlendMode: function(blendMode) {
		if(this.currentBlendMode == blendMode) {
			return;
		}
		this.currentBlendMode = blendMode;
		if(this.renderSession.context != null) {
			switch(blendMode) {
			case "add":
				this.renderSession.context.globalCompositeOperation = "lighter";
				break;
			case "alpha":
				this.renderSession.context.globalCompositeOperation = "destination-in";
				break;
			case "darken":
				this.renderSession.context.globalCompositeOperation = "darken";
				break;
			case "difference":
				this.renderSession.context.globalCompositeOperation = "difference";
				break;
			case "erase":
				this.renderSession.context.globalCompositeOperation = "destination-out";
				break;
			case "hardlight":
				this.renderSession.context.globalCompositeOperation = "hard-light";
				break;
			case "layer":
				this.renderSession.context.globalCompositeOperation = "source-over";
				break;
			case "lighten":
				this.renderSession.context.globalCompositeOperation = "lighten";
				break;
			case "multiply":
				this.renderSession.context.globalCompositeOperation = "multiply";
				break;
			case "overlay":
				this.renderSession.context.globalCompositeOperation = "overlay";
				break;
			case "screen":
				this.renderSession.context.globalCompositeOperation = "screen";
				break;
			default:
				this.renderSession.context.globalCompositeOperation = "source-over";
			}
		}
	}
});
DOMBlendModeManager.prototype.__class__ = $hxClasses["openfl._internal.renderer.dom.DOMBlendModeManager"] = DOMBlendModeManager;

// Init



// Statics




// Export

exports.default = DOMBlendModeManager;