mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-12 08:58:50 +01:00
Try willReadFrequently
This commit is contained in:
parent
fea1d77342
commit
696a46311d
2 changed files with 6 additions and 2 deletions
|
@ -188,7 +188,9 @@ function AccountInfo({
|
||||||
try {
|
try {
|
||||||
// Get color from four corners of image
|
// Get color from four corners of image
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d', {
|
||||||
|
willReadFrequently: true,
|
||||||
|
});
|
||||||
canvas.width = e.target.width;
|
canvas.width = e.target.width;
|
||||||
canvas.height = e.target.height;
|
canvas.height = e.target.height;
|
||||||
ctx.drawImage(e.target, 0, 0);
|
ctx.drawImage(e.target, 0, 0);
|
||||||
|
|
|
@ -16,7 +16,9 @@ const alphaCache = {};
|
||||||
const canvas = window.OffscreenCanvas
|
const canvas = window.OffscreenCanvas
|
||||||
? new OffscreenCanvas(1, 1)
|
? new OffscreenCanvas(1, 1)
|
||||||
: document.createElement('canvas');
|
: document.createElement('canvas');
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d', {
|
||||||
|
willReadFrequently: true,
|
||||||
|
});
|
||||||
|
|
||||||
function Avatar({ url, size, alt = '', squircle, ...props }) {
|
function Avatar({ url, size, alt = '', squircle, ...props }) {
|
||||||
size = SIZES[size] || size || SIZES.m;
|
size = SIZES[size] || size || SIZES.m;
|
||||||
|
|
Loading…
Reference in a new issue