/* \reimp (GraphicsLayer.h) */ void GraphicsLayerTextureMapper::setContentsToImage(Image* image) { if (image) { // Make the decision about whether the image has changed. // This code makes the assumption that pointer equality on a NativeImagePtr is a valid way to tell if the image is changed. // This assumption is true in Qt, GTK and EFL. NativeImagePtr newNativeImagePtr = image->nativeImageForCurrentFrame(); if (!newNativeImagePtr) return; if (newNativeImagePtr == m_compositedNativeImagePtr) return; m_compositedNativeImagePtr = newNativeImagePtr; if (!m_compositedImage) m_compositedImage = TextureMapperTiledBackingStore::create(); m_compositedImage->setContentsToImage(image); } else { m_compositedNativeImagePtr = 0; m_compositedImage = 0; } setContentsToMedia(m_compositedImage.get()); notifyChange(TextureMapperLayer::ContentChange); GraphicsLayer::setContentsToImage(image); }
/* \reimp (GraphicsLayer.h) */ void GraphicsLayerTextureMapper::setContentsToImage(Image* image) { if (image == m_image) return; m_image = image; if (m_image) { RefPtr<TextureMapperTiledBackingStore> backingStore = TextureMapperTiledBackingStore::create(); backingStore->setContentsToImage(image); m_compositedImage = backingStore; } else m_compositedImage = 0; setContentsToMedia(m_compositedImage.get()); notifyChange(TextureMapperLayer::ContentChange); GraphicsLayer::setContentsToImage(image); }