| 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 68d1351e64a3af40a74ff91a8bf00eac10f2c91e..a37e4106b3aacc12cf278c06b95a5f064a29a94d 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
|
| @@ -38,6 +38,7 @@
|
| #include "core/dom/ExceptionCode.h"
|
| #include "core/dom/TaskRunnerHelper.h"
|
| #include "core/fileapi/File.h"
|
| +#include "core/frame/FrameHost.h"
|
| #include "core/frame/ImageBitmap.h"
|
| #include "core/frame/LocalFrame.h"
|
| #include "core/frame/Settings.h"
|
| @@ -56,6 +57,7 @@
|
| #include "core/layout/LayoutHTMLCanvas.h"
|
| #include "core/layout/api/LayoutViewItem.h"
|
| #include "core/layout/compositing/PaintLayerCompositor.h"
|
| +#include "core/page/ChromeClient.h"
|
| #include "core/paint/PaintLayer.h"
|
| #include "core/paint/PaintTiming.h"
|
| #include "platform/Histogram.h"
|
| @@ -1423,7 +1425,14 @@ String HTMLCanvasElement::getIdFromControl(const Element* element) {
|
|
|
| void HTMLCanvasElement::createLayer() {
|
| DCHECK(!m_surfaceLayerBridge);
|
| - m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this));
|
| + LocalFrame* frame = document().frame();
|
| + WebLayerTreeView* layerTreeView = nullptr;
|
| + if (frame && frame->host()) {
|
| + layerTreeView = frame->host()->chromeClient().getWebLayerTreeView();
|
| + }
|
| +
|
| + m_surfaceLayerBridge =
|
| + WTF::wrapUnique(new CanvasSurfaceLayerBridge(this, layerTreeView));
|
| // Creates a placeholder layer first before Surface is created.
|
| m_surfaceLayerBridge->createSolidColorLayer();
|
| }
|
|
|