// Class: openfl._internal.renderer.cairo.CairoRenderer

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_AbstractRenderer() {return require("./../../../../openfl/_internal/renderer/AbstractRenderer");}

// Constructor

var CairoRenderer = function(stage,cairo) {
	(openfl__$internal_renderer_AbstractRenderer().default).call(this,stage);
}

// Meta

CairoRenderer.__name__ = ["openfl","_internal","renderer","cairo","CairoRenderer"];
CairoRenderer.__super__ = (openfl__$internal_renderer_AbstractRenderer().default);
CairoRenderer.prototype = $extend((openfl__$internal_renderer_AbstractRenderer().default).prototype, {
	clear: function() {
		if(this.cairo == null) {
			return;
		}
		this.cairo.identityMatrix();
		if(this.stage.__clearBeforeRender) {
			this.cairo.setSourceRGB(this.stage.__colorSplit[0],this.stage.__colorSplit[1],this.stage.__colorSplit[2]);
			this.cairo.paint();
		}
	},
	render: function() {
		if(this.cairo == null) {
			return;
		}
		this.renderSession.allowSmoothing = this.stage.quality != "low";
		this.stage.__renderCairo(this.renderSession);
	},
	renderStage3D: function() {
		if(this.cairo == null) {
			return;
		}
		var _g = 0;
		var _g1 = this.stage.stage3Ds;
		while(_g < _g1.get_length()) {
			var stage3D = _g1.get(_g);
			++_g;
			stage3D.__renderCairo(this.stage,this.renderSession);
		}
	}
});
CairoRenderer.prototype.__class__ = $hxClasses["openfl._internal.renderer.cairo.CairoRenderer"] = CairoRenderer;

// Init



// Statics




// Export

exports.default = CairoRenderer;