void Object3D::invalidateRotation() { if (m_rotationDirty) return; m_rotationDirty = true; invalidateTransform(); }
void Object3D::invalidateScale() { if (m_scaleDirty) return; m_scaleDirty = true; invalidateTransform(); }
void Object3D::invalidatePosition() { if (m_positionDirty) return; m_positionDirty = true; invalidateTransform(); }
void Widget::setPosition(sf::Vector2f pos) { if (myPosition != pos) { myPosition = pos; invalidateTransform(); notify(NotifyMoved); } }
void Widget::setPosition(float x, float y) { if (myPosition.x != x || myPosition.y != y) { myPosition.x = x; myPosition.y = y; invalidateTransform(); notify(NotifyMoved); } }
void TextureMapperNode::syncCompositingStateSelf(GraphicsLayerTextureMapper* graphicsLayer, TextureMapper* textureMapper) { const int changeMask = graphicsLayer->changeMask(); initializeTextureMapper(textureMapper); const TextureMapperNode::ContentData& pendingContent = graphicsLayer->pendingContent(); if (changeMask == NoChanges && pendingContent.needsDisplayRect.isEmpty() && !pendingContent.needsDisplay) return; setNeedsDisplay(); if (m_parent) m_parent->m_state.dirty = true; if (m_currentContent.contentType == HTMLContentType && (changeMask & ParentChange)) { // The WebCore compositor manages item ownership. We have to make sure graphicsview doesn't // try to snatch that ownership. if (!graphicsLayer->parent()) m_parent = 0; else m_parent = toTextureMapperNode(graphicsLayer->parent()); if (!graphicsLayer->parent() && m_parent) { size_t index = m_parent->m_children.find(this); m_parent->m_children.remove(index); } } if (changeMask & ChildrenChange) { m_children.clear(); for (size_t i = 0; i < graphicsLayer->children().size(); ++i) { if (TextureMapperNode* child = toTextureMapperNode(graphicsLayer->children()[i])) { if (!child) continue; m_children.append(child); child->m_parent = this; } } m_state.dirty = true; } if (changeMask & (SizeChange | ContentsRectChange)) { IntSize wantedSize = IntSize(graphicsLayer->size().width(), graphicsLayer->size().height()); if (wantedSize.isEmpty() && pendingContent.contentType == HTMLContentType) wantedSize = IntSize(graphicsLayer->contentsRect().width(), graphicsLayer->contentsRect().height()); if (wantedSize != m_size) { m_size = IntSize(wantedSize.width(), wantedSize.height()); if (m_platformClient) m_platformClient->setSizeChanged(m_size); const bool needsTiling = m_size.width() > 2000 || m_size.height() > 2000; if (m_state.tiled != needsTiling) m_state.tiled = needsTiling; m_state.dirty = true; } } if (changeMask & MaskLayerChange) { if (TextureMapperNode* layer = toTextureMapperNode(graphicsLayer->maskLayer())) layer->m_effectTarget = this; } if (changeMask & ReplicaLayerChange) { if (TextureMapperNode* layer = toTextureMapperNode(graphicsLayer->replicaLayer())) layer->m_effectTarget = this; } if (changeMask & (TransformChange | SizeChange | AnchorPointChange | PositionChange)) m_transforms.localDirty = true; if (changeMask & (ChildrenTransformChange | SizeChange)) m_transforms.perspectiveDirty = true; if (changeMask & (ChildrenTransformChange | Preserves3DChange | TransformChange | AnchorPointChange | SizeChange | ContentsRectChange | BackfaceVisibilityChange | PositionChange | MaskLayerChange | DrawsContentChange | ContentChange | ReplicaLayerChange)) { // Due to the differences between the way WebCore handles transforms and the way Qt handles transforms, // all these elements affect the transforms of all the descendants. invalidateTransform(); } if (changeMask & DisplayChange) m_state.dirty = true; m_state.maskLayer = toTextureMapperNode(graphicsLayer->maskLayer()); m_state.replicaLayer = toTextureMapperNode(graphicsLayer->replicaLayer()); m_state.pos = graphicsLayer->position(); m_state.anchorPoint = graphicsLayer->anchorPoint(); m_state.size = graphicsLayer->size(); m_state.transform = graphicsLayer->transform(); m_state.contentsRect = graphicsLayer->contentsRect(); m_state.opacity = graphicsLayer->opacity(); m_state.contentsRect = graphicsLayer->contentsRect(); m_state.preserves3D = graphicsLayer->preserves3D(); m_state.masksToBounds = graphicsLayer->masksToBounds(); m_state.drawsContent = graphicsLayer->drawsContent(); m_state.contentsOpaque = graphicsLayer->contentsOpaque(); m_state.backfaceVisibility = graphicsLayer->backfaceVisibility(); m_state.childrenTransform = graphicsLayer->childrenTransform(); m_currentContent.contentType = pendingContent.contentType; m_currentContent.image = pendingContent.image; m_currentContent.media = pendingContent.media; m_currentContent.backgroundColor = pendingContent.backgroundColor; m_currentContent.needsDisplay = m_currentContent.needsDisplay || pendingContent.needsDisplay; m_currentContent.needsDisplayRect.unite(pendingContent.needsDisplayRect); }
void XMesh::SetScale( const Vector3 &scale ) { m_scale = scale; invalidateTransform(); }
void XMesh::SetRotation( const Vector3 &rot ) { m_rotation = rot; invalidateTransform(); }
void XMesh::SetPosition( const Vector3 &pos ) { m_position = pos; invalidateTransform(); }