Lines Matching refs:layer
31 #include "Layer.h"
87 LayerAndroid* layer = static_cast<LayerAndroid*>(baseLayer->getChild(i));
88 serializeLayer(layer, stream);
100 BaseLayerAndroid* layer = new BaseLayerAndroid();
103 layer->setBackgroundColor(color);
106 layer->setContent(picture);
112 layer->addChild(childLayer);
115 return layer;
242 void serializeLayer(LayerAndroid* layer, SkWStream* stream)
244 if (!layer) {
245 XLOG("NULL layer!");
249 if (layer->isMedia() || layer->isVideo()) {
250 XLOG("Layer isn't supported for serialization: isMedia: %s, isVideo: %s",
251 layer->isMedia() ? "true" : "false",
252 layer->isVideo() ? "true" : "false");
256 LayerTypes type = layer->contentIsScrollable()
261 // Start with Layer fields
262 stream->writeBool(layer->shouldInheritFromRootTransform());
263 stream->writeScalar(layer->getOpacity());
264 stream->writeScalar(layer->getSize().width());
265 stream->writeScalar(layer->getSize().height());
266 stream->writeScalar(layer->getPosition().x());
267 stream->writeScalar(layer->getPosition().y());
268 stream->writeScalar(layer->getAnchorPoint().x());
269 stream->writeScalar(layer->getAnchorPoint().y());
270 writeMatrix(stream, layer->getMatrix());
271 writeMatrix(stream, layer->getChildrenMatrix());
274 stream->writeBool(layer->m_haveClip);
275 stream->writeBool(layer->m_isFixed);
276 stream->writeBool(layer->m_backgroundColorSet);
277 stream->writeBool(layer->m_isIframe);
278 writeSkLength(stream, layer->m_fixedLeft);
279 writeSkLength(stream, layer->m_fixedTop);
280 writeSkLength(stream, layer->m_fixedRight);
281 writeSkLength(stream, layer->m_fixedBottom);
282 writeSkLength(stream, layer->m_fixedMarginLeft);
283 writeSkLength(stream, layer->m_fixedMarginTop);
284 writeSkLength(stream, layer->m_fixedMarginRight);
285 writeSkLength(stream, layer->m_fixedMarginBottom);
286 writeSkRect(stream, layer->m_fixedRect);
287 stream->write32(layer->m_renderLayerPos.x());
288 stream->write32(layer->m_renderLayerPos.y());
289 stream->writeBool(layer->m_backfaceVisibility);
290 stream->writeBool(layer->m_visible);
291 stream->write32(layer->m_backgroundColor);
292 stream->writeBool(layer->m_preserves3D);
293 stream->writeScalar(layer->m_anchorPointZ);
294 stream->writeScalar(layer->m_drawOpacity);
295 bool hasContentsImage = layer->m_imageCRC != 0;
301 ImagesManager::instance()->retainImage(layer->m_imageCRC);
304 ImagesManager::instance()->releaseImage(layer->m_imageCRC);
308 bool hasRecordingPicture = layer->m_recordingPicture != 0;
311 layer->m_recordingPicture->serialize(stream);
314 writeTransformationMatrix(stream, layer->m_transform);
315 writeTransformationMatrix(stream, layer->m_childrenTransform);
318 static_cast<ScrollableLayerAndroid*>(layer);
324 int childCount = layer->countChildren();
327 serializeLayer(layer->getChild(i), stream);
336 LayerAndroid *layer;
338 layer = new LayerAndroid((RenderLayer*) 0);
340 layer = new ScrollableLayerAndroid((RenderLayer*) 0);
342 XLOG("Unexpected layer type: %d, aborting!", type);
346 // Layer fields
347 layer->setShouldInheritFromRootTransform(stream->readBool());
348 layer->setOpacity(stream->readScalar());
349 layer->setSize(stream->readScalar(), stream->readScalar());
350 layer->setPosition(stream->readScalar(), stream->readScalar());
351 layer->setAnchorPoint(stream->readScalar(), stream->readScalar());
352 layer->setMatrix(readMatrix(stream));
353 layer->setChildrenMatrix(readMatrix(stream));
356 layer->m_haveClip = stream->readBool();
357 layer->m_isFixed = stream->readBool();
358 layer->m_backgroundColorSet = stream->readBool();
359 layer->m_isIframe = stream->readBool();
360 layer->m_fixedLeft = readSkLength(stream);
361 layer->m_fixedTop = readSkLength(stream);
362 layer->m_fixedRight = readSkLength(stream);
363 layer->m_fixedBottom = readSkLength(stream);
364 layer->m_fixedMarginLeft = readSkLength(stream);
365 layer->m_fixedMarginTop = readSkLength(stream);
366 layer->m_fixedMarginRight = readSkLength(stream);
367 layer->m_fixedMarginBottom = readSkLength(stream);
368 layer->m_fixedRect = readSkRect(stream);
369 layer->m_renderLayerPos.setX(stream->readS32());
370 layer->m_renderLayerPos.setY(stream->readS32());
371 layer->m_backfaceVisibility = stream->readBool();
372 layer->m_visible = stream->readBool();
373 layer->m_backgroundColor = stream->readU32();
374 layer->m_preserves3D = stream->readBool();
375 layer->m_anchorPointZ = stream->readScalar();
376 layer->m_drawOpacity = stream->readScalar();
386 layer->setContentsImage(imageRef);
391 layer->m_recordingPicture = new SkPicture(stream);
394 readTransformationMatrix(stream, layer->m_transform);
395 readTransformationMatrix(stream, layer->m_childrenTransform);
398 static_cast<ScrollableLayerAndroid*>(layer);
409 layer->addChild(childLayer);
411 layer->needsRepaint();
412 XLOG("Created layer with id %d", layer->uniqueId());
413 return layer;