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 655442579b0afbc4d611446376ec62f42f9455c4..d892b3c66f6a8a2891e172293ab5eeb41447792c 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" |
@@ -1385,8 +1387,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 |