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 877241efe6087fca1efdfc28c23d4218b8123855..a6d00fdaf5c6e695a8977b6533c4f9a7d4597d81 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
@@ -70,10 +70,8 @@ |
#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h" |
#include "platform/image-encoders/ImageEncoderUtils.h" |
#include "platform/transforms/AffineTransform.h" |
-#include "public/platform/InterfaceProvider.h" |
#include "public/platform/Platform.h" |
#include "public/platform/WebTraceLocation.h" |
-#include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h" |
#include "wtf/CheckedNumeric.h" |
#include "wtf/PtrUtil.h" |
#include <math.h> |
@@ -1399,20 +1397,15 @@ 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))); |
- 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; |
+ m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this)); |
+ // Creates a placeholder layer first before Surface is created. |
+ m_surfaceLayerBridge->createSolidColorLayer(); |
+} |
+ |
+void HTMLCanvasElement::OnWebLayerReplaced() { |
+ setNeedsCompositingUpdate(); |
} |
} // namespace blink |