Socket
Socket
Sign inDemoInstall

@pixi/settings

Package Overview
Dependencies
Maintainers
3
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/settings - npm Package Compare versions

Comparing version 5.0.0-alpha.3 to 5.0.0-rc

108

lib/settings.es.js
/*!
* @pixi/settings - v5.0.0-alpha.3
* Compiled Tue, 03 Jul 2018 04:08:21 UTC
* @pixi/settings - v5.0.0-rc
* Compiled Fri, 01 Feb 2019 04:50:10 UTC
*

@@ -10,22 +10,69 @@ * @pixi/settings is licensed under the MIT License.

/**
* The maximum recommended texture units to use.
* In theory the bigger the better, and for desktop we'll use as many as we can.
* But some mobile devices slow down if there is to many branches in the shader.
* So in practice there seems to be a sweet spot size that varies depending on the device.
*
* In v4, all mobile devices were limited to 4 texture units because for this.
* In v5, we allow all texture units to be used on modern Apple or Android devices.
*
* @private
* @param {number} max
* @returns {number}
*/
function maxRecommendedTextures(max)
{
var allowMax = true;
if (Device.tablet || Device.phone)
{
// check if the res is iphone 6 or higher..
return 4;
allowMax = false;
if (Device.apple.device)
{
var match = (navigator.userAgent).match(/OS (\d+)_(\d+)?/);
if (match)
{
var majorVersion = parseInt(match[1], 10);
// All texture units can be used on devices that support ios 11 or above
if (majorVersion >= 11)
{
allowMax = true;
}
}
}
if (Device.android.device)
{
var match$1 = (navigator.userAgent).match(/Android\s([0-9.]*)/);
if (match$1)
{
var majorVersion$1 = parseInt(match$1[1], 10);
// All texture units can be used on devices that support Android 7 (Nougat) or above
if (majorVersion$1 >= 7)
{
allowMax = true;
}
}
}
}
// desktop should be ok
return max;
return allowMax ? max : 4;
}
/**
* Uploading the same buffer multiple times in a single frame can cause performance issues.
* Apparent on iOS so only check for that at the moment
* This check may become more complex if this issue pops up elsewhere.
*
* @private
* @returns {boolean}
*/
function canUploadSameBuffer()
{
// Uploading the same buffer multiple times in a single frame can cause perf issues.
// Apparent on IOS so only check for that at the moment
// this check may become more complex if this issue pops up elsewhere.
var ios = !!navigator.platform && (/iPad|iPhone|iPod/).test(navigator.platform);
return !ios;
return !Device.apple.device;
}

@@ -52,2 +99,3 @@

* @static
* @name MIPMAP_TEXTURES
* @memberof PIXI.settings

@@ -63,2 +111,3 @@ * @type {boolean}

* @static
* @name RESOLTION
* @memberof PIXI.settings

@@ -74,2 +123,3 @@ * @type {number}

* @static
* @name FILTER_RESOLUTION
* @memberof PIXI.settings

@@ -85,2 +135,3 @@ * @type {number}

* @static
* @name SPRITE_MAX_TEXTURES
* @memberof PIXI.settings

@@ -101,2 +152,3 @@ * @type {number}

* @static
* @name SPRITE_BATCH_SIZE
* @memberof PIXI.settings

@@ -113,3 +165,3 @@ * @type {number}

* @static
* @constant
* @name RENDER_OPTIONS
* @memberof PIXI.settings

@@ -126,3 +178,2 @@ * @type {object}

* @property {boolean} preserveDrawingBuffer=false
* @property {boolean} roundPixels=false
* @property {number} width=800

@@ -141,3 +192,2 @@ * @property {number} height=600

preserveDrawingBuffer: false,
roundPixels: false,
width: 800,

@@ -152,2 +202,3 @@ height: 600,

* @static
* @name GC_MODE
* @memberof PIXI.settings

@@ -163,2 +214,3 @@ * @type {PIXI.GC_MODES}

* @static
* @name GC_MAX_IDLE
* @memberof PIXI.settings

@@ -174,2 +226,3 @@ * @type {number}

* @static
* @name GC_MAX_CHECK_COUNT
* @memberof PIXI.settings

@@ -185,2 +238,3 @@ * @type {number}

* @static
* @name WRAP_MODE
* @memberof PIXI.settings

@@ -193,5 +247,6 @@ * @type {PIXI.WRAP_MODES}

/**
* The scale modes that are supported by pixi.
* Default scale mode for textures.
*
* @static
* @name SCALE_MODE
* @memberof PIXI.settings

@@ -207,2 +262,3 @@ * @type {PIXI.SCALE_MODES}

* @static
* @name PRECISION_VERTEX
* @memberof PIXI.settings

@@ -218,2 +274,3 @@ * @type {PIXI.PRECISION}

* @static
* @name PRECISION_FRAGMENT
* @memberof PIXI.settings

@@ -223,3 +280,3 @@ * @type {PIXI.PRECISION}

*/
PRECISION_FRAGMENT: 'mediump',
PRECISION_FRAGMENT: Device.apple.device ? 'highp' : 'mediump',

@@ -230,3 +287,3 @@ /**

* @static
* @constant
* @name CAN_UPLOAD_SAME_BUFFER
* @memberof PIXI.settings

@@ -241,3 +298,3 @@ * @type {boolean}

* @static
* @constant
* @name CREATE_IMAGE_BITMAP
* @memberof PIXI.settings

@@ -248,2 +305,15 @@ * @type {boolean}

CREATE_IMAGE_BITMAP: true,
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
*
* @static
* @constant
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
ROUND_PIXELS: false,
};

@@ -250,0 +320,0 @@

/*!
* @pixi/settings - v5.0.0-alpha.3
* Compiled Tue, 03 Jul 2018 04:08:21 UTC
* @pixi/settings - v5.0.0-rc
* Compiled Fri, 01 Feb 2019 04:50:10 UTC
*

@@ -16,22 +16,69 @@ * @pixi/settings is licensed under the MIT License.

/**
* The maximum recommended texture units to use.
* In theory the bigger the better, and for desktop we'll use as many as we can.
* But some mobile devices slow down if there is to many branches in the shader.
* So in practice there seems to be a sweet spot size that varies depending on the device.
*
* In v4, all mobile devices were limited to 4 texture units because for this.
* In v5, we allow all texture units to be used on modern Apple or Android devices.
*
* @private
* @param {number} max
* @returns {number}
*/
function maxRecommendedTextures(max)
{
var allowMax = true;
if (Device.tablet || Device.phone)
{
// check if the res is iphone 6 or higher..
return 4;
allowMax = false;
if (Device.apple.device)
{
var match = (navigator.userAgent).match(/OS (\d+)_(\d+)?/);
if (match)
{
var majorVersion = parseInt(match[1], 10);
// All texture units can be used on devices that support ios 11 or above
if (majorVersion >= 11)
{
allowMax = true;
}
}
}
if (Device.android.device)
{
var match$1 = (navigator.userAgent).match(/Android\s([0-9.]*)/);
if (match$1)
{
var majorVersion$1 = parseInt(match$1[1], 10);
// All texture units can be used on devices that support Android 7 (Nougat) or above
if (majorVersion$1 >= 7)
{
allowMax = true;
}
}
}
}
// desktop should be ok
return max;
return allowMax ? max : 4;
}
/**
* Uploading the same buffer multiple times in a single frame can cause performance issues.
* Apparent on iOS so only check for that at the moment
* This check may become more complex if this issue pops up elsewhere.
*
* @private
* @returns {boolean}
*/
function canUploadSameBuffer()
{
// Uploading the same buffer multiple times in a single frame can cause perf issues.
// Apparent on IOS so only check for that at the moment
// this check may become more complex if this issue pops up elsewhere.
var ios = !!navigator.platform && (/iPad|iPhone|iPod/).test(navigator.platform);
return !ios;
return !Device.apple.device;
}

@@ -58,2 +105,3 @@

* @static
* @name MIPMAP_TEXTURES
* @memberof PIXI.settings

@@ -69,2 +117,3 @@ * @type {boolean}

* @static
* @name RESOLTION
* @memberof PIXI.settings

@@ -80,2 +129,3 @@ * @type {number}

* @static
* @name FILTER_RESOLUTION
* @memberof PIXI.settings

@@ -91,2 +141,3 @@ * @type {number}

* @static
* @name SPRITE_MAX_TEXTURES
* @memberof PIXI.settings

@@ -107,2 +158,3 @@ * @type {number}

* @static
* @name SPRITE_BATCH_SIZE
* @memberof PIXI.settings

@@ -119,3 +171,3 @@ * @type {number}

* @static
* @constant
* @name RENDER_OPTIONS
* @memberof PIXI.settings

@@ -132,3 +184,2 @@ * @type {object}

* @property {boolean} preserveDrawingBuffer=false
* @property {boolean} roundPixels=false
* @property {number} width=800

@@ -147,3 +198,2 @@ * @property {number} height=600

preserveDrawingBuffer: false,
roundPixels: false,
width: 800,

@@ -158,2 +208,3 @@ height: 600,

* @static
* @name GC_MODE
* @memberof PIXI.settings

@@ -169,2 +220,3 @@ * @type {PIXI.GC_MODES}

* @static
* @name GC_MAX_IDLE
* @memberof PIXI.settings

@@ -180,2 +232,3 @@ * @type {number}

* @static
* @name GC_MAX_CHECK_COUNT
* @memberof PIXI.settings

@@ -191,2 +244,3 @@ * @type {number}

* @static
* @name WRAP_MODE
* @memberof PIXI.settings

@@ -199,5 +253,6 @@ * @type {PIXI.WRAP_MODES}

/**
* The scale modes that are supported by pixi.
* Default scale mode for textures.
*
* @static
* @name SCALE_MODE
* @memberof PIXI.settings

@@ -213,2 +268,3 @@ * @type {PIXI.SCALE_MODES}

* @static
* @name PRECISION_VERTEX
* @memberof PIXI.settings

@@ -224,2 +280,3 @@ * @type {PIXI.PRECISION}

* @static
* @name PRECISION_FRAGMENT
* @memberof PIXI.settings

@@ -229,3 +286,3 @@ * @type {PIXI.PRECISION}

*/
PRECISION_FRAGMENT: 'mediump',
PRECISION_FRAGMENT: Device.apple.device ? 'highp' : 'mediump',

@@ -236,3 +293,3 @@ /**

* @static
* @constant
* @name CAN_UPLOAD_SAME_BUFFER
* @memberof PIXI.settings

@@ -247,3 +304,3 @@ * @type {boolean}

* @static
* @constant
* @name CREATE_IMAGE_BITMAP
* @memberof PIXI.settings

@@ -254,2 +311,15 @@ * @type {boolean}

CREATE_IMAGE_BITMAP: true,
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
*
* @static
* @constant
* @memberof PIXI.settings
* @type {boolean}
* @default false
*/
ROUND_PIXELS: false,
};

@@ -256,0 +326,0 @@

11

package.json
{
"name": "@pixi/settings",
"version": "5.0.0-alpha.3",
"version": "5.0.0-rc",
"main": "lib/settings.js",
"module": "lib/settings.es.js",
"description": "PixiJS Application",
"description": "Collecting of user configurable settings used throughout PixiJS",
"author": "Mat Groves",

@@ -28,7 +28,8 @@ "contributors": [

"dependencies": {
"ismobilejs": "^0.4.0"
"ismobilejs": "^0.5.1"
},
"devDependencies": {
"floss": "^2.1.3"
}
"floss": "^2.1.5"
},
"gitHead": "9026a1bbca9a9d86b7a3b6d5eb4fa2c3145c2b85"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc