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

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

Issue 2588053003: Make OffscreenCanvas resizable (Closed)
Patch Set: 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 a6d00fdaf5c6e695a8977b6533c4f9a7d4597d81..dc8a76dc178b0b81543829883cb6943c9d723caa 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1404,7 +1404,10 @@ void HTMLCanvasElement::createLayer() {
m_surfaceLayerBridge->createSolidColorLayer();
}
-void HTMLCanvasElement::OnWebLayerReplaced() {
+void HTMLCanvasElement::OnWebLayerReplaced(int width, int height) {
+ if (width != sourceWidth() || height != sourceHeight()) {
+ setSize(IntSize(width, height));
+ }
setNeedsCompositingUpdate();
}

Powered by Google App Engine
This is Rietveld 408576698