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 9fd7e8d3d938529fff7db558d1ea3227f7c1d8e2..04a34a22edbbf485ad87a93d4e5313ce146428a2 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" |
@@ -1370,8 +1372,14 @@ bool HTMLCanvasElement::createSurfaceLayer() { |
mojo::GetProxy(&service)); |
m_surfaceLayerBridge = |
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 |