Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: more fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0e79057b252a7ee7170e566e101e39bc22408175 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -68,10 +68,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>
@@ -1397,15 +1395,16 @@ 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)));
- return m_surfaceLayerBridge->createSurfaceLayer(this->width(),
- this->height());
+
+ 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

Powered by Google App Engine
This is Rietveld 408576698