void HTMLCanvasElement::didFinalizeFrame() { if (m_dirtyRect.isEmpty()) return; // Propagate the m_dirtyRect accumulated so far to the compositor // before restarting with a blank dirty rect. FloatRect srcRect(0, 0, size().width(), size().height()); m_dirtyRect.intersect(srcRect); if (RenderBox* ro = renderBox()) { FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBoxRect()); ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); } notifyObserversCanvasChanged(m_dirtyRect); m_finalizeFrameTask.Cancel(); m_dirtyRect = FloatRect(); }
void HTMLCanvasElement::didFinalizeFrame() { if (m_dirtyRect.isEmpty()) return; // Propagate the m_dirtyRect accumulated so far to the compositor // before restarting with a blank dirty rect. FloatRect srcRect(0, 0, size().width(), size().height()); m_dirtyRect.intersect(srcRect); if (RenderBox* ro = renderBox()) { FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBoxRect()); // For querying RenderLayer::compositingState() // FIXME: is this invalidation using the correct compositing state? DisableCompositingQueryAsserts disabler; ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); } notifyObserversCanvasChanged(m_dirtyRect); blink::Platform::current()->currentThread()->removeTaskObserver(this); m_dirtyRect = FloatRect(); }