File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project are documented in this file.
4
4
5
+ ## 0.0.3
6
+
7
+ - Changed: Optimized WebGL Check.
8
+
5
9
## 0.0.2
6
10
7
11
- Added: Ability to pass styles in.
Original file line number Diff line number Diff line change 1
- export const getDevicePixelRatio = ( ) => {
2
- if ( typeof document === "undefined" ) return 1 ;
3
- return devicePixelRatio || 1 ;
4
- } ;
1
+ let supported = undefined ;
5
2
6
3
export const isWebGlSupported = ( ) => {
7
4
if ( typeof document === "undefined" ) return false ;
8
- return ! ! document . createElement ( "canvas" ) . getContext ( "webgl" ) ;
5
+ if ( supported === undefined ) {
6
+ supported = ! ! document . createElement ( "canvas" ) . getContext ( "webgl" ) ;
7
+ }
8
+ return supported ;
9
+ } ;
10
+
11
+ export const getDevicePixelRatio = ( ) => {
12
+ if ( typeof document === "undefined" ) return 1 ;
13
+ return devicePixelRatio || 1 ;
9
14
} ;
You can’t perform that action at this time.
0 commit comments