• Home
  • Raw
  • Download

Lines Matching refs:textStyle

178     function copyArrays(textStyle) {  argument
181 textStyle['_colorPtr'] = copyColorToWasm(textStyle['color']);
182 textStyle['_foregroundColorPtr'] = nullptr; // nullptr is 0, from helper.js
183 textStyle['_backgroundColorPtr'] = nullptr;
184 textStyle['_decorationColorPtr'] = nullptr;
185 if (textStyle['foregroundColor']) {
186textStyle['_foregroundColorPtr'] = copyColorToWasm(textStyle['foregroundColor'], scratchForeground…
188 if (textStyle['backgroundColor']) {
189textStyle['_backgroundColorPtr'] = copyColorToWasm(textStyle['backgroundColor'], scratchBackground…
191 if (textStyle['decorationColor']) {
192textStyle['_decorationColorPtr'] = copyColorToWasm(textStyle['decorationColor'], scratchDecoration…
195 if (Array.isArray(textStyle['fontFamilies']) && textStyle['fontFamilies'].length) {
196 textStyle['_fontFamiliesPtr'] = naiveCopyStrArray(textStyle['fontFamilies']);
197 textStyle['_fontFamiliesLen'] = textStyle['fontFamilies'].length;
199 textStyle['_fontFamiliesPtr'] = nullptr;
200 textStyle['_fontFamiliesLen'] = 0;
204 if (textStyle['locale']) {
205 var str = textStyle['locale'];
206 textStyle['_localePtr'] = cacheOrCopyString(str);
207 textStyle['_localeLen'] = lengthBytesUTF8(str) + 1; // add 1 for the null terminator.
209 textStyle['_localePtr'] = nullptr;
210 textStyle['_localeLen'] = 0;
213 if (Array.isArray(textStyle['shadows']) && textStyle['shadows'].length) {
214 var shadows = textStyle['shadows'];
217 textStyle['_shadowLen'] = shadows.length;
227 textStyle['_shadowColorsPtr'] = copyFlexibleColorArray(shadowColors).colorPtr;
228 textStyle['_shadowOffsetsPtr'] = ptr;
229 textStyle['_shadowBlurRadiiPtr'] = copy1dArray(shadowBlurRadii, 'HEAPF32');
231 textStyle['_shadowLen'] = 0;
232 textStyle['_shadowColorsPtr'] = nullptr;
233 textStyle['_shadowOffsetsPtr'] = nullptr;
234 textStyle['_shadowBlurRadiiPtr'] = nullptr;
237 if (Array.isArray(textStyle['fontFeatures']) && textStyle['fontFeatures'].length) {
238 var fontFeatures = textStyle['fontFeatures'];
241 textStyle['_fontFeatureLen'] = fontFeatures.length;
242 textStyle['_fontFeatureNamesPtr'] = naiveCopyStrArray(fontFeatureNames);
243 textStyle['_fontFeatureValuesPtr'] = copy1dArray(fontFeatureValues, 'HEAPU32');
245 textStyle['_fontFeatureLen'] = 0;
246 textStyle['_fontFeatureNamesPtr'] = nullptr;
247 textStyle['_fontFeatureValuesPtr'] = nullptr;
251 function freeArrays(textStyle) { argument
254 CanvasKit._free(textStyle['_fontFamiliesPtr']);
255 CanvasKit._free(textStyle['_shadowColorsPtr']);
256 CanvasKit._free(textStyle['_shadowOffsetsPtr']);
257 CanvasKit._free(textStyle['_shadowBlurRadiiPtr']);
258 CanvasKit._free(textStyle['_fontFeatureNamesPtr']);
259 CanvasKit._free(textStyle['_fontFeatureValuesPtr']);
289 CanvasKit.ParagraphBuilder.prototype.pushStyle = function(textStyle) { argument
290 copyArrays(textStyle);
291 this._pushStyle(textStyle);
292 freeArrays(textStyle);
295 CanvasKit.ParagraphBuilder.prototype.pushPaintStyle = function(textStyle, fg, bg) { argument
296 copyArrays(textStyle);
297 this._pushPaintStyle(textStyle, fg, bg);
298 freeArrays(textStyle);