-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(): rm fabric.filterBackend
=> getFilterBackend
#8487
Conversation
prepare for dropping fabric NS
@@ -181,7 +181,7 @@ export class Image extends FabricObject { | |||
* Delete a single texture if in webgl mode | |||
*/ | |||
removeTexture(key: string) { | |||
const backend = fabric.filterBackend; | |||
const backend = getFilterBackend(false); | |||
if (backend && backend.evictCachesForKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use instanceof WebGL?
Build Stats
|
export function getFilterBackend(): FilterBackend { | ||
if (!fabric.filterBackend) { | ||
fabric.filterBackend = initFilterBackend(); | ||
export function getFilterBackend(strict = true): FilterBackend { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we want strict option here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image#removeTexture
: we don't want it to create the backend, only to probe it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so is the issue that initElement calls removeTexture? and that we don't want to strictly couple Image with having a filter Backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems correct
Merging this and coming back with
|
strict in terms of existence |
Maybe it is only a naming issue. |
prepare for dropping fabric NS
Motivation
Prepare for dropping fabric namespace
Description
The ref
fabric.filterBakend
is gone, I wonder if the dev needs to set the backend for any reason because it is now impossible.getFilterBackend
is a lazy initializer.Changes
Gist
In Action