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

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

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: 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..cbe4410132a331d9ee361e1c21d21ab03b6f93ed 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/FrameView.h"
#include "core/frame/ImageBitmap.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
@@ -54,6 +55,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"
@@ -1397,15 +1400,19 @@ 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());
+ WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service), 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