void ThreadedCompositor::updateSceneState(const CoordinatedGraphicsState& state) { RefPtr<CoordinatedGraphicsScene> scene = m_scene; m_scene->appendUpdate([scene, state] { scene->commitSceneState(state); }); setNeedsDisplay(); }
void DrawingAreaImpl::setPageOverlayNeedsDisplay(const IntRect& rect) { if (m_layerTreeHost) { m_layerTreeHost->setPageOverlayNeedsDisplay(rect); return; } setNeedsDisplay(rect); }
void WebGraphicsLayer::setDrawsContent(bool b) { if (drawsContent() == b) return; GraphicsLayer::setDrawsContent(b); if (b) setNeedsDisplay(); notifyChange(); }
/* \reimp (GraphicsLayer.h) */ void GraphicsLayerTextureMapper::setDrawsContent(bool value) { if (value == drawsContent()) return; GraphicsLayer::setDrawsContent(value); notifyChange(DrawsContentChange); if (value) setNeedsDisplay(); }
void GraphicsLayer::setSize(const FloatSize& size) { if (size == m_size) return; m_size = size; if (shouldRepaintOnSizeChange()) setNeedsDisplay(); }
void GraphicsLayerWKC::setDrawsContent(bool drawsContent) { if (drawsContent == m_drawsContent) return; GraphicsLayer::setDrawsContent(drawsContent); if (m_drawsContent) { setNeedsDisplay(); } }
void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset) { if (offset == m_offsetFromRenderer) return; m_offsetFromRenderer = offset; // If the compositing layer offset changes, we need to repaint. setNeedsDisplay(); }
void WKCACFLayer::setBounds(const CGRect& rect) { if (CGRectEqualToRect(rect, bounds())) return; CACFLayerSetBounds(layer(), rect); setNeedsCommit(); if (m_needsDisplayOnBoundsChange) setNeedsDisplay(); }
void GraphicsLayer::setOffsetFromRenderer(const FloatSize& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay) { if (offset == m_offsetFromRenderer) return; m_offsetFromRenderer = offset; // If the compositing layer offset changes, we need to repaint. if (shouldSetNeedsDisplay == SetNeedsDisplay) setNeedsDisplay(); }
void WebGraphicsLayer::setSize(const FloatSize& size) { if (this->size() == size) return; GraphicsLayer::setSize(size); setNeedsDisplay(); if (maskLayer()) maskLayer()->setSize(size); notifyChange(); }
void GraphicsLayerAndroid::setDrawsContent(bool drawsContent) { if (drawsContent == m_drawsContent) return; GraphicsLayer::setDrawsContent(drawsContent); m_contentLayer->setVisible(drawsContent); if (m_drawsContent) { m_haveContents = true; setNeedsDisplay(); } askForSync(); }
void GraphicsLayerClutter::updateLayerDrawsContent(float pageScaleFactor, const FloatPoint& positionRelativeToBase) { if (m_drawsContent) { graphicsLayerActorSetDrawsContent(m_layer.get(), TRUE); setNeedsDisplay(); } else { graphicsLayerActorSetDrawsContent(m_layer.get(), FALSE); graphicsLayerActorSetSurface(m_layer.get(), 0); } updateDebugIndicators(); }
void WKCACFLayer::setFrame(const CGRect& rect) { CGRect oldFrame = frame(); if (CGRectEqualToRect(rect, oldFrame)) return; CACFLayerSetFrame(layer(), rect); setNeedsCommit(); if (m_needsDisplayOnBoundsChange) setNeedsDisplay(); }
/* \reimp (GraphicsLayer.h) */ void GraphicsLayerTextureMapper::setDrawsContent(bool value) { #if PLATFORM(JS) webkitTrace(); #endif if (value == drawsContent()) return; GraphicsLayer::setDrawsContent(value); notifyChange(DrawsContentChange); if (value) setNeedsDisplay(); }
TextureMapperNode::~TextureMapperNode() { setNeedsDisplay(); { const int childrenSize = m_children.size(); for (int i = childrenSize-1; i >= 0; --i) { ASSERT(m_children[i]->m_parent == this); m_children[i]->m_parent = 0; } } if (m_parent) m_parent->m_children.remove(m_parent->m_children.find(this)); if (m_cache) delete m_cache; }
void PluginLayerWebKitThread::setPluginView(PluginView* pluginView) { m_pluginView = pluginView; setNeedsTexture(isDrawable() && pluginView); setLayerProgram(LayerProgramRGBA); if (m_pluginView) setNeedsDisplay(); else { // We can't afford to wait until the next commit // to set the m_pluginView to 0 in the impl, because it is // about to be destroyed. layerCompositingThread()->setPluginView(0); setNeedsCommit(); } }
void ThreadedCompositor::updateSceneState(const CoordinatedGraphicsState& state) { RefPtr<ThreadedCompositor> protector(this); RefPtr<CoordinatedGraphicsScene> scene = m_scene; m_scene->appendUpdate([protector, scene, state] { scene->commitSceneState(state); protector->m_clientRendersNextFrame.store(true); bool coordinateUpdate = std::any_of(state.layersToUpdate.begin(), state.layersToUpdate.end(), [](const std::pair<CoordinatedLayerID, CoordinatedGraphicsLayerState>& it) { return it.second.platformLayerChanged; }); protector->m_coordinateUpdateCompletionWithClient.store(coordinateUpdate); }); setNeedsDisplay(); }
void DrawingAreaImpl::resumePainting() { if (!m_isPaintingSuspended) { // FIXME: We can get a call to resumePainting when painting is not suspended. // This happens when sending a synchronous message to create a new page. See <rdar://problem/8976531>. return; } if (m_layerTreeHost) m_layerTreeHost->resumeRendering(); m_isPaintingSuspended = false; // FIXME: We shouldn't always repaint everything here. setNeedsDisplay(m_webPage->bounds()); m_webPage->corePage()->resumeScriptedAnimations(); }
void GraphicsLayerAndroid::setSize(const FloatSize& size) { if (size == m_size) return; MLOG("(%x) setSize (%.2f,%.2f)", this, size.width(), size.height()); GraphicsLayer::setSize(size); // If it is a media layer the size may have changed as a result of the media // element (e.g. plugin) gaining focus. Therefore, we must sync the size of // the focus' outline so that our UI thread can draw accordingly. RenderLayer* layer = renderLayerFromClient(m_client); if (layer && m_contentLayer->isMedia()) { RenderBox* box = layer->renderBox(); int outline = box->view()->maximalOutlineSize(); static_cast<MediaLayer*>(m_contentLayer)->setOutlineSize(outline); LOG("Media Outline: %d %p %p %p", outline, m_client, layer, box); LOG("Media Size: %g,%g", size.width(), size.height()); } m_contentLayer->setSize(size.width(), size.height()); setNeedsDisplay(); askForSync(); }
void DrawingAreaImpl::forceRepaint() { setNeedsDisplay(m_webPage->bounds()); m_webPage->layoutIfNeeded(); if (m_layerTreeHost) { // FIXME: We need to do the same work as the layerHostDidFlushLayers function here, // but clearly it doesn't make sense to call the function with that name. // Consider refactoring and renaming it. if (m_compositingAccordingToProxyMessages) m_layerTreeHost->forceRepaint(); else { // Call setShouldNotifyAfterNextScheduledLayerFlush(false) here to // prevent layerHostDidFlushLayers() from being called a second time. m_layerTreeHost->setShouldNotifyAfterNextScheduledLayerFlush(false); layerHostDidFlushLayers(); } return; } m_isWaitingForDidUpdate = false; display(); }
void GraphicsLayerAndroid::setContentsToImage(Image* image) { TLOG("(%x) setContentsToImage", this, image); if (image && image != m_image) { image->ref(); if (m_image) m_image->deref(); m_image = image; SkBitmapRef* bitmap = image->nativeImageForCurrentFrame(); m_contentLayer->setContentsImage(bitmap); m_haveContents = true; m_newImage = true; } if (!image && m_image) { m_contentLayer->setContentsImage(0); m_image->deref(); m_image = 0; } setNeedsDisplay(); askForSync(); }
void GraphicsLayerAndroid::setContentsNeedsDisplay() { if (m_is3DCanvas) setNeedsDisplay(); }
void ChunkedUpdateDrawingArea::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate) { setNeedsDisplay(rect); }
void CanvasLayerWebKitThread::setDevice(SkGpuDevice* device) { m_device = device; setLayerProgramShader(LayerProgramShaderRGBA); setNeedsDisplay(); }
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 TileController::forceRepaint() { setNeedsDisplay(); }
void TiledDrawingArea::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) { // FIXME: Do something much smarter. setNeedsDisplay(rectToScroll); }
void ChunkedUpdateDrawingArea::invalidateContentsAndWindow(const IntRect& rect, bool immediate) { setNeedsDisplay(rect); }
void LayerBackedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollOffset) { // FIXME: Do something much smarter. setNeedsDisplay(scrollRect); }
void PageOverlay::setNeedsDisplay() { setNeedsDisplay(bounds()); }