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

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

Issue 2495373003: Match html canvas which is transferred to OffscreenCanvas to CSS style (Closed)
Patch Set: fix compilation error 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..877241efe6087fca1efdfc28c23d4218b8123855 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -54,6 +54,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"
@@ -1404,8 +1406,13 @@ bool HTMLCanvasElement::createSurfaceLayer() {
mojo::GetProxy(&service));
m_surfaceLayerBridge =
WTF::wrapUnique(new CanvasSurfaceLayerBridge(std::move(service)));
- return m_surfaceLayerBridge->createSurfaceLayer(this->width(),
- this->height());
+ 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;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698