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

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

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: rebase and fix conflict 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 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

Powered by Google App Engine
This is Rietveld 408576698