Lines Matching refs:layer

34 function transform_layer(layer, {parentBounds, parentHidden}) {  argument
35 function get_size(layer) { argument
36 var size = layer.size || {w: 0, h: 0};
45 function get_crop(layer) { argument
46 var crop = layer.crop || {left: 0, top: 0, right: 0 , bottom:0};
73 function get_cropped_bounds(layer, parentBounds) { argument
74 var size = get_size(layer);
75 var crop = get_crop(layer);
97 function transform_bounds(layer, parentBounds) { argument
98 var result = layer.bounds || get_cropped_bounds(layer, parentBounds);
99 var tx = (layer.position) ? layer.position.x || 0 : 0;
100 var ty = (layer.position) ? layer.position.y || 0 : 0;
102 result.label = layer.name;
103 result.transform = layer.transform || {dsdx:1, dtdx:0, dsdy:0, dtdy:1};
109 function is_opaque(layer) { argument
110 return layer.color == undefined || (layer.color.a || 0) > 0;
151 function is_visible(layer) { argument
152 var visible = (layer.activeBuffer || layer.type === 'ColorLayer')
153 && !hidden && is_opaque(layer);
154 visible &= !is_empty(layer.visibleRegion);
158 function postprocess_flags(layer) { argument
159 if (!layer.flags) return;
161 if (layer.flags & FLAG_HIDDEN) {
164 if (layer.flags & FLAG_OPAQUE) {
167 if (layer.flags & FLAG_SECURE) {
171 layer.flags = verboseFlags.join('|') + " (" + layer.flags + ")";
175 var rect = transform_bounds(layer, parentBounds);
176 var hidden = (layer.flags & FLAG_HIDDEN) != 0 || parentHidden;
177 var visible = is_visible(layer);
185 if (layer.name.startsWith("Display Root#0") && layer.sourceBounds) {
186 bounds = {width: layer.sourceBounds.right, height: layer.sourceBounds.bottom};
189 if ((layer.zOrderRelativeOf || -1) !== -1) {
192 if (layer.zOrderRelativeParentOf !== undefined) {
195 if (layer.missing) {
198 function visibilityReason(layer) { argument
200 if (!layer.color || layer.color.a === 0) {
203 if (layer.flags && (layer.flags & FLAG_HIDDEN != 0)) {
206 if (is_rect_empty_and_valid(layer.crop)) {
209 if (is_transform_invalid(layer.transform)) {
212 if (layer.isRelativeOf && layer.zOrderRelativeOf == -1) {
218 layer.invisibleDueTo = 'Hidden by parent with ID: ' + parentHidden;
220 let reasons_hidden = visibilityReason(layer);
221 let isBufferLayer = (layer.type === 'BufferStateLayer' || layer.type === 'BufferQueueLayer');
223 layer.invisibleDueTo = reasons_hidden;
224 parentHidden = layer.id
225 } else if (layer.type === 'ContainerLayer') {
226 layer.invisibleDueTo = 'This is a ContainerLayer.';
227 } else if (isBufferLayer && (!layer.activeBuffer ||
228 layer.activeBuffer.height === 0 || layer.activeBuffer.width === 0)) {
229 layer.invisibleDueTo = 'The buffer is empty.';
231 layer.invisibleDueTo = 'Unknown. Occluded by another layer?';
235 (layer) => transform_layer(layer, {parentBounds: rect, parentHidden: parentHidden});
236 postprocess_flags(layer);
238 obj: layer,
240 name: layer.id + ": " + layer.name,
242 [layer.resolvedChildren, transform_layer_with_parent_hidden],