Skip to content

Commit

Permalink
Fixmobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Affolter Matias committed Jan 21, 2024
1 parent 8ab7277 commit 2b101dc
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 211 deletions.
2 changes: 1 addition & 1 deletion client/chunk_16.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ var LOAD_FILES_USEFUL = ["/src/fonts/normative/index.css"].concat(["illusion.jpg
var LOAD_FILES_STATIC = ["sfx/md/hero_decorative-celebration-02", "sfx/md/navigation_selection-complete-celebration", "sfx/md/navigation_transition-left", "sfx/md/state-change_confirm-down", "sfx/md/ui_lock", "sfx/md/ui_unlock", "sfx/md/ui_scan", "sfx/md/alert_high-intensity", "sfx/md/navigation_transition-right", "voice/cn/accessing_memory", "voice/cn/complete", "voice/cn/please_wait", "voice/cn/data_upload", "voice/cn/processing", "voice/cn/enhanced", "voice/cn/rewriting_deep_layer_protocols", "voice/cn/vision_activated", "voice/cn/vision_deactivated", "voice/cn/filtering", "music/redeclipse/track_09"].map(F_SND).concat(["presentation", "tutorial", "create", "enhanced", "pixelated", "upload", "share1", "joke1", "create", "enhanced", "pixelated", "presentation", "presentation2", "sponsors", "tutorial", "upload", "labintro", "share2", "share3", "share4", "share5", "share6", "share7", "joke2", "joke3", "joke4", "joke5", "joke6", "joke7", "joke8", "joke9", "joke10", "joke11"].map(F_VID));

// Cache names
var REQUIRED_CACHE = "unless-update-cache-v920-required";
var USEFUL_CACHE = "unless-update-cache-v920-useful";
var STATIC_CACHE = "unless-update-cache-v920-static";
var OTHER_CACHE = "unless-update-cache-v920-other";
var REQUIRED_CACHE = "unless-update-cache-v921-required";
var USEFUL_CACHE = "unless-update-cache-v921-useful";
var STATIC_CACHE = "unless-update-cache-v921-static";
var OTHER_CACHE = "unless-update-cache-v921-other";

// Regular expressions for chunk matching
var MAIN_CHILD_CHUNK_REGEX = /chunk_(main_[a-z0-9]+)\.min\.js$/i;
Expand Down
118 changes: 81 additions & 37 deletions src/js/components/canvaspixels/utils/SuperBlend.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var MODE = SIMDopeCreateConfAdd({
"methods": {
"get_use_element": true,
"set_tail": true,
"set_from_simdope": true,
"get_tail": true,
"get_tail_opacity": true,
"reset_tail": true,
Expand Down Expand Up @@ -126,6 +127,8 @@ var SuperBlend = function(opts) {
this.colors_data_in_layers_uint32_ = this.state_.colors_data_in_layers_uint32;
this.shadow_state_ = _build_shadow_state();
this.data_array_= [];
this.destination_rgba_colors_for_blending_;
this.destination_rgba_colors_for_blending_SIMDope_;

return this;
}
Expand Down Expand Up @@ -167,11 +170,13 @@ Object.defineProperty(SuperBlend.prototype, 'get_updated_shadow_state', {
this.shadow_state_.layers_colors = new Array(this.number_length_index_byte_[0] + 1 | 0).fill(null).map(function (){return new Color(new ArrayBuffer(4))});
}

if(this.shadow_state_.base_rgba_colors_for_blending.length >= this.number_length_index_byte_[2]) { // If we have enough space for what we use this time
this.shadow_state_.base_rgba_colors_for_blending.fill(0, 0, this.shadow_state_.used_colors_length); // Only erase what we used the previous time, so it has no filthy data, always.
}else { // else define a new blank color list (a typed array) with the length we use this time
this.shadow_state_.base_rgba_colors_for_blending = new Uint32Array(this.number_length_index_byte_[2] | 0);
this.shadow_state_.base_rgba_colors_for_blending_SIMDope = new Colors(this.shadow_state_.base_rgba_colors_for_blending.buffer);
if(!this.destination_rgba_colors_for_blending_){
if(this.shadow_state_.base_rgba_colors_for_blending.length >= this.number_length_index_byte_[2]) { // If we have enough space for what we use this time
this.shadow_state_.base_rgba_colors_for_blending.fill(0, 0, this.shadow_state_.used_colors_length); // Only erase what we used the previous time, so it has no filthy data, always.
}else { // else define a new blank color list (a typed array) with the length we use this time
this.shadow_state_.base_rgba_colors_for_blending = new Uint32Array(this.number_length_index_byte_[2] | 0);
this.shadow_state_.base_rgba_colors_for_blending_SIMDope = new Colors(this.shadow_state_.base_rgba_colors_for_blending.buffer);
}
}

this.shadow_state_.all_layers_length = this.number_length_index_byte_[0] | 0;
Expand Down Expand Up @@ -207,9 +212,16 @@ Object.defineProperty(SuperBlend.prototype, 'data_array', {
configurable: false
});
Object.defineProperty(SuperBlend.prototype, 'set_data_array', {
get: function() { "use strict"; return function (da) {
get: function() { "use strict"; return function (da, dest) {
"use strict";
return this.data_array_ = da;
this.data_array_ = da;
if(dest){
this.destination_rgba_colors_for_blending_ = dest;
this.destination_rgba_colors_for_blending_SIMDope_ = new Colors(this.destination_rgba_colors_for_blending_.buffer);
}else {
this.destination_rgba_colors_for_blending_ = undefined;
this.destination_rgba_colors_for_blending_SIMDope_ = undefined;
}
}},
enumerable: false,
configurable: false
Expand Down Expand Up @@ -280,57 +292,89 @@ SuperBlend.prototype.blend = function(should_return_transparent, alpha_addition)
indexes_data_for_layers
} = this.state;

var dest = this.destination_rgba_colors_for_blending_;
var dest_simdope = this.destination_rgba_colors_for_blending_SIMDope_;
var dasd = this.data_array.map(function (d){return new Colors(d.data.buffer);});
var dasdl = dasd.length||0;
var layers_color_0 = layers_colors[0];
var transparent = new Color(new ArrayBuffer(4));

return new Promise(function (resolve) {
"use strict";

var i = 0, off = new Uint32Array(2), layer_n = 0;

for (; uint_less(i | 0, used_colors_length); i = plus_uint(i, 1)) {

base_rgba_colors_for_blending_SIMDope.get_use_element(i | 0, layers_color_0);
off[0] = multiply_int(i, all_layers_length);
// Sum up all colors above
for (layer_n = 0; int_less(layer_n, dasdl); layer_n = plus_int(layer_n, 1)) {

dasd[layer_n|0].get_use_element(indexes_data_for_layers[i|0], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
if(dest_simdope){
for (; uint_less(i | 0, used_colors_length); i = plus_uint(i, 1)) {
dest_simdope.get_use_element(indexes_data_for_layers[i|0], layers_color_0);
layers_color_0.set_from_simdope(transparent)
off[0] = multiply_int(i, all_layers_length);
// Sum up all colors above
for (layer_n = 0; int_less(layer_n, dasdl); layer_n = plus_int(layer_n, 1)) {

dasd[layer_n|0].get_use_element(indexes_data_for_layers[i|0], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
}
for (layer_n = dasdl; int_less(layer_n, all_layers_length); layer_n = plus_int(layer_n, 1)) {

off[1] = plus_int(off[0], layer_n);
colors_data_in_layers_uint32_SIMDope.get_use_element(off[1], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
}

layers_colors[layer_n|0].reset_tail();

if((hover_data_in_layer[i | 0]|0) > 0) {
layers_color_0.blend_first_with_tails(alpha_addition)
layers_color_0.blend_first_with(layers_color_0.is_dark() ? color_less_uint8x4 : color_full_uint8x4, hover_data_in_layer[i | 0], false, false);
}else {
layers_color_0.blend_first_with_tails(alpha_addition);
}
}
for (layer_n = dasdl; int_less(layer_n, all_layers_length); layer_n = plus_int(layer_n, 1)) {

off[1] = plus_int(off[0], layer_n);
colors_data_in_layers_uint32_SIMDope.get_use_element(off[1], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
}

//layers_colors[layer_n|0].reset_tail();

if((hover_data_in_layer[i | 0]|0) > 0) {
layers_color_0.blend_first_with_tails(alpha_addition)
layers_color_0.blend_first_with(layers_color_0.is_dark() ? color_less_uint8x4 : color_full_uint8x4, hover_data_in_layer[i | 0], false, false);
}else {
layers_color_0.blend_first_with_tails(alpha_addition);
resolve();
}else {
for (; uint_less(i | 0, used_colors_length); i = plus_uint(i, 1)) {
base_rgba_colors_for_blending_SIMDope.get_use_element(i | 0, layers_color_0);
layers_color_0.set_from_simdope(transparent)
off[0] = multiply_int(i, all_layers_length);
// Sum up all colors above
for (layer_n = 0; int_less(layer_n, dasdl); layer_n = plus_int(layer_n, 1)) {

dasd[layer_n|0].get_use_element(indexes_data_for_layers[i|0], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
}
for (layer_n = dasdl; int_less(layer_n, all_layers_length); layer_n = plus_int(layer_n, 1)) {

off[1] = plus_int(off[0], layer_n);
colors_data_in_layers_uint32_SIMDope.get_use_element(off[1], layers_colors[layer_n+1|0]);
layers_colors[layer_n|0].set_tail(layers_colors[layer_n+1|0], layers_opacity_255[layer_n|0]);
}

layers_colors[layer_n|0].reset_tail();

if((hover_data_in_layer[i | 0]|0) > 0) {
layers_color_0.blend_first_with_tails(alpha_addition)
layers_color_0.blend_first_with(layers_color_0.is_dark() ? color_less_uint8x4 : color_full_uint8x4, hover_data_in_layer[i | 0], false, false);
}else {
layers_color_0.blend_first_with_tails(alpha_addition);
}
}
resolve(Array.of(indexes_data_for_layers.subarray(0, used_colors_length), base_rgba_colors_for_blending.subarray(0, used_colors_length)));
}

resolve(Array.of(indexes_data_for_layers.subarray(0, used_colors_length), base_rgba_colors_for_blending.subarray(0, used_colors_length)));
});
};

SuperBlend.prototype.build = function(layer_number, max_length, layers_opacity_255, layers) {
SuperBlend.prototype.build = function(layer_number, max_length, layers_opacity_255, layers, uint32Destination) {
"use strict";
layer_number = (layer_number | 0) >>> 0;
max_length = (max_length | 0) >>> 0;
layers = layers || [];

this.set_bytes_index(0);
this.set_state(_build_state(layer_number, max_length, layers_opacity_255));
this.set_data_array(layers);
this.set_data_array(layers, uint32Destination);
}
SuperBlend.prototype.update = function(layer_number, max_length, layers_opacity_255, layers) {
SuperBlend.prototype.update = function(layer_number, max_length, layers_opacity_255, layers, uint32Destination) {
"use strict";

layer_number = (layer_number | 0) >>> 0;
Expand All @@ -339,13 +383,13 @@ SuperBlend.prototype.update = function(layer_number, max_length, layers_opacity_

this.set_bytes_index(0);
this.set_state(_update_state(this.state, layer_number, max_length, layers_opacity_255));
this.set_data_array(layers);
this.set_data_array(layers, uint32Destination);
}
SuperBlend.prototype.clear = function() {
"use strict";
this.set_bytes_index(0);
this.set_state(_update_state(this.state, 1, 1));
this.set_data_array([]);
this.set_data_array([], new Uint32Array(0));
}

module.exports = SuperBlend;
Loading

0 comments on commit 2b101dc

Please sign in to comment.