Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: Furnish Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index bd018fb2bb42717c660af90e3f0df765951d9797..2039f5f53c2ca6c99446ef332be916b4faa2a8f6 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1397,15 +1397,19 @@ String HTMLCanvasElement::getIdFromControl(const Element* element) {
return String();
}
-bool HTMLCanvasElement::createSurfaceLayer() {
+void HTMLCanvasElement::createLayer() {
DCHECK(!m_surfaceLayerBridge);
mojom::blink::OffscreenCanvasSurfacePtr service;
Platform::current()->interfaceProvider()->getInterface(
mojo::GetProxy(&service));
m_surfaceLayerBridge =
- WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service)));
- return m_surfaceLayerBridge->createSurfaceLayer(this->width(),
- this->height());
+ WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service), this));
+ // Creates a placeholder layer first before Surface is created.
+ m_surfaceLayerBridge->createSolidColorLayer();
+}
+
+void HTMLCanvasElement::OnWebLayerReplaced() {
+ setNeedsCompositingUpdate();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698