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..877241efe6087fca1efdfc28c23d4218b8123855 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
@@ -54,6 +54,8 @@ |
#include "core/imagebitmap/ImageBitmapOptions.h" |
#include "core/layout/HitTestCanvasResult.h" |
#include "core/layout/LayoutHTMLCanvas.h" |
+#include "core/layout/api/LayoutViewItem.h" |
+#include "core/layout/compositing/PaintLayerCompositor.h" |
#include "core/paint/PaintLayer.h" |
#include "core/paint/PaintTiming.h" |
#include "platform/Histogram.h" |
@@ -1404,8 +1406,13 @@ bool HTMLCanvasElement::createSurfaceLayer() { |
mojo::GetProxy(&service)); |
m_surfaceLayerBridge = |
WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); |
- return m_surfaceLayerBridge->createSurfaceLayer(this->width(), |
- this->height()); |
+ bool result = |
+ m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height()); |
+ // After creating a new WebLayer, we want to force compositor commit |
+ // to repaint. |
+ document().layoutViewItem().compositor()->setNeedsCompositingUpdate( |
+ CompositingUpdateRebuildTree); |
+ return result; |
} |
} // namespace blink |